本文整理汇总了C#中Database.GetStoredProcCommand方法的典型用法代码示例。如果您正苦于以下问题:C# Database.GetStoredProcCommand方法的具体用法?C# Database.GetStoredProcCommand怎么用?C# Database.GetStoredProcCommand使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Database
的用法示例。
在下文中一共展示了Database.GetStoredProcCommand方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateDataAdapterCommands
public static void CreateDataAdapterCommands(Database db, ref DbCommand insertCommand, ref DbCommand updateCommand, ref DbCommand deleteCommand)
{
insertCommand = db.GetStoredProcCommand("RegionInsert");
updateCommand = db.GetStoredProcCommand("RegionUpdate");
deleteCommand = db.GetStoredProcCommand("RegionDelete");
db.AddInParameter(insertCommand, "vRegionID", DbType.Int32, "RegionID", DataRowVersion.Default);
db.AddInParameter(insertCommand, "vRegionDescription", DbType.String, "RegionDescription", DataRowVersion.Default);
db.AddInParameter(updateCommand, "vRegionID", DbType.Int32, "RegionID", DataRowVersion.Default);
db.AddInParameter(updateCommand, "vRegionDescription", DbType.String, "RegionDescription", DataRowVersion.Default);
db.AddInParameter(deleteCommand, "vRegionID", DbType.Int32, "RegionID", DataRowVersion.Default);
}
示例2: GetFeesTermbyMonthIDAndFeeCategoryID
public static DataSet GetFeesTermbyMonthIDAndFeeCategoryID(int FeeCategoryID, int Month)
{
db = DatabaseFactory.CreateDatabase();
sqlCommand = "[dbo].TMS_GetFeesTermbyMonthIDAndFeeCategoryID";
dbCommand = db.GetStoredProcCommand(sqlCommand, FeeCategoryID,Month);
ds = db.ExecuteDataSet(dbCommand);
return ds;
}
示例3: GetAllFeesSetup
public static DataSet GetAllFeesSetup()
{
db = DatabaseFactory.CreateDatabase();
sqlCommand = "[dbo].TMS_GetFeesSetup";
dbCommand = db.GetStoredProcCommand(sqlCommand);
ds = db.ExecuteDataSet(dbCommand);
return ds;
}
示例4: FilterFeesCategories
public static DataSet FilterFeesCategories(string filter)
{
db = DatabaseFactory.CreateDatabase();
sqlCommand = "[dbo].TMS_FilterFeesCategories";
dbCommand = db.GetStoredProcCommand(sqlCommand,filter);
ds = db.ExecuteDataSet(dbCommand);
return ds;
}
示例5: SetUp
public void SetUp()
{
DatabaseProviderFactory factory = new DatabaseProviderFactory(TestConfigurationSource.CreateConfigurationSource());
db = factory.CreateDefault();
storedProcedure = db.GetStoredProcCommand("CustOrdersOrders");
connection = db.CreateConnection();
connection.Open();
storedProcedure.Connection = connection;
cache = new ParameterCache();
baseFixture = new ParameterDiscoveryFixture(storedProcedure);
}
示例6: Save
public void Save(Database db)
{
DbCommand dbCommand = db.GetStoredProcCommand("AG_SaveFeatureClass");
db.AddInParameter(dbCommand, "FeatureClassID", DbType.Int32, FeatureClassID);
db.AddInParameter(dbCommand, "Name", DbType.String, Name);
db.AddInParameter(dbCommand, "Description", DbType.String, Description);
using (IDataReader dr = db.ExecuteReader(dbCommand))
{
// get the returned ID
if (dr.Read())
{
int ID = Int32.Parse(dr[0].ToString());
//if the ID is NOT zero then the query was an insert
if (ID != 0)
this.FeatureClassID = ID;
}
dr.Close();
}
}
示例7: YoGomeeUser
/// <summary>
/// Instanciates a YoGomeeUser object from the database via the YoGomeeUserID
/// </summary>
public YoGomeeUser(int YoGomeeUserID)
{
db = DatabaseFactory.CreateDatabase();
DbCommand dbCommand = db.GetStoredProcCommand("AG_GetYoGomeeUserByYoGomeeUserID");
db.AddInParameter(dbCommand, "YoGomeeUserID", DbType.Int32, YoGomeeUserID);
//execute the stored procedure
using (IDataReader dr = db.ExecuteReader(dbCommand))
{
ColumnFieldList list = new ColumnFieldList(dr);
if (dr.Read())
{
if (list.IsColumnPresent("YoGomeeUserID")) { this._yoGomeeUserID = (int)dr["YoGomeeUserID"]; }
if (list.IsColumnPresent("FirstName")) { this._firstName = (string)dr["FirstName"]; }
if (list.IsColumnPresent("LastName")) { this._lastName = (string)dr["LastName"]; }
if (list.IsColumnPresent("EmailAddress")) { this._emailAddress = (string)dr["EmailAddress"]; }
if (list.IsColumnPresent("Password")) { this._password = (string)dr["Password"]; }
if (list.IsColumnPresent("PhoneNumber")) { this._phoneNumber = (string)dr["PhoneNumber"]; }
if (list.IsColumnPresent("PhoneModel")) { this._phoneModel = (int)dr["PhoneModel"]; }
if (list.IsColumnPresent("ISOCountry")) { this._iSOCountry = (string)dr["ISOCountry"]; }
if (list.IsColumnPresent("SignupIPAddress")) { this._signupIPAddress = (string)dr["SignupIPAddress"]; }
if (list.IsColumnPresent("Created")) { this._created = (DateTime)dr["Created"]; }
}
else
{
throw new Exception("There is no YoGomeeUser in the database with the ID " + YoGomeeUserID);
}
dr.Close();
}
}
示例8: Country
/// <summary>
/// Instanciates a Country object from the database via the CountryID
/// </summary>
public Country(int CountryID)
{
db = DatabaseFactory.CreateDatabase();
DbCommand dbCommand = db.GetStoredProcCommand("AG_GetCountryByCountryID");
db.AddInParameter(dbCommand, "CountryID", DbType.Int32, CountryID);
//execute the stored procedure
using (IDataReader dr = db.ExecuteReader(dbCommand))
{
ColumnFieldList list = new ColumnFieldList(dr);
if (dr.Read())
{
if (list.IsColumnPresent("CountryID")) { this._countryID = (int)dr["CountryID"]; }
if (list.IsColumnPresent("CountryCode")) { this._countryCode = (string)dr["CountryCode"]; }
if (list.IsColumnPresent("Name")) { this._name = (string)dr["Name"]; }
}
else
{
throw new Exception("There is no Country in the database with the ID " + CountryID);
}
dr.Close();
}
}
示例9: Friend
/// <summary>
/// Instanciates a Friend object from the database via the FriendID
/// </summary>
public Friend(int FriendID)
{
db = DatabaseFactory.CreateDatabase();
DbCommand dbCommand = db.GetStoredProcCommand("AG_GetFriendByFriendID");
db.AddInParameter(dbCommand, "FriendID", DbType.Int32, FriendID);
//execute the stored procedure
using (IDataReader dr = db.ExecuteReader(dbCommand))
{
ColumnFieldList list = new ColumnFieldList(dr);
if (dr.Read())
{
if (list.IsColumnPresent("FriendID")) { this._friendID = (int)dr["FriendID"]; }
if (list.IsColumnPresent("YoGomeeUserID1")) { this._yoGomeeUserID1 = (int)dr["YoGomeeUserID1"]; }
if (list.IsColumnPresent("YoGomeeUserID2")) { this._yoGomeeUserID2 = (int)dr["YoGomeeUserID2"]; }
if (list.IsColumnPresent("User1Accepted")) { this._user1Accepted = (bool)dr["User1Accepted"]; }
if (list.IsColumnPresent("User2Accepted")) { this._user2Accepted = (bool)dr["User2Accepted"]; }
if (list.IsColumnPresent("UnfriendedUserID")) { this._unfriendedUserID = (int)dr["UnfriendedUserID"]; }
}
else
{
throw new Exception("There is no Friend in the database with the ID " + FriendID);
}
dr.Close();
}
}
示例10: Metadata
/// <summary>
/// Instanciates a Metadata object from the database via the MetaDataID
/// </summary>
public Metadata(int MetaDataID)
{
db = DatabaseFactory.CreateDatabase();
DbCommand dbCommand = db.GetStoredProcCommand("AG_GetMetadataByMetaDataID");
db.AddInParameter(dbCommand, "MetaDataID", DbType.Int32, MetaDataID);
//execute the stored procedure
using (IDataReader dr = db.ExecuteReader(dbCommand))
{
ColumnFieldList list = new ColumnFieldList(dr);
if (dr.Read())
{
if (list.IsColumnPresent("MetaDataID")) { this._metaDataID = (int)dr["MetaDataID"]; }
if (list.IsColumnPresent("GeoNamesModDate")) { this._geoNamesModDate = (DateTime)dr["GeoNamesModDate"]; }
}
else
{
throw new Exception("There is no Metadata in the database with the ID " + MetaDataID);
}
dr.Close();
}
}
示例11: ISOLanguage
/// <summary>
/// Instanciates a ISOLanguage object from the database via the ISOLanguageID
/// </summary>
public ISOLanguage(int ISOLanguageID)
{
db = DatabaseFactory.CreateDatabase();
DbCommand dbCommand = db.GetStoredProcCommand("AG_GetISOLanguageByISOLanguageID");
db.AddInParameter(dbCommand, "ISOLanguageID", DbType.Int32, ISOLanguageID);
//execute the stored procedure
using (IDataReader dr = db.ExecuteReader(dbCommand))
{
ColumnFieldList list = new ColumnFieldList(dr);
if (dr.Read())
{
if (list.IsColumnPresent("ISOLanguageID")) { this._iSOLanguageID = (int)dr["ISOLanguageID"]; }
if (list.IsColumnPresent("ISO639_1")) { this._iSO639_1 = (string)dr["ISO639_1"]; }
if (list.IsColumnPresent("ISO639_2")) { this._iSO639_2 = (string)dr["ISO639_2"]; }
if (list.IsColumnPresent("ISO639_3")) { this._iSO639_3 = (string)dr["ISO639_3"]; }
if (list.IsColumnPresent("Name")) { this._name = (string)dr["Name"]; }
}
else
{
throw new Exception("There is no ISOLanguage in the database with the ID " + ISOLanguageID);
}
dr.Close();
}
}
示例12: GomeeMap
/// <summary>
/// Instanciates a GomeeMap object from the database via the GomeeMapID
/// </summary>
public GomeeMap(int GomeeMapID)
{
db = DatabaseFactory.CreateDatabase();
DbCommand dbCommand = db.GetStoredProcCommand("AG_GetGomeeMapByGomeeMapID");
db.AddInParameter(dbCommand, "GomeeMapID", DbType.Int32, GomeeMapID);
//execute the stored procedure
using (IDataReader dr = db.ExecuteReader(dbCommand))
{
ColumnFieldList list = new ColumnFieldList(dr);
if (dr.Read())
{
if (list.IsColumnPresent("GomeeMapID")) { this._gomeeMapID = (int)dr["GomeeMapID"]; }
if (list.IsColumnPresent("YoGomeeUserID")) { this._yoGomeeUserID = (int)dr["YoGomeeUserID"]; }
if (list.IsColumnPresent("GomeeID")) { this._gomeeID = (int)dr["GomeeID"]; }
if (list.IsColumnPresent("ProximityHit")) { this._proximityHit = (bool)dr["ProximityHit"]; }
if (list.IsColumnPresent("ProximityDateTime")) { this._proximityDateTime = (DateTime)dr["ProximityDateTime"]; }
if (list.IsColumnPresent("ReceivedGomee")) { this._receivedGomee = (bool)dr["ReceivedGomee"]; }
if (list.IsColumnPresent("ReceivedGomeeDateTime")) { this._receivedGomeeDateTime = (DateTime)dr["ReceivedGomeeDateTime"]; }
}
else
{
throw new Exception("There is no GomeeMap in the database with the ID " + GomeeMapID);
}
dr.Close();
}
}
示例13: Gomee
/// <summary>
/// Instanciates a Gomee object from the database via the GomeeID
/// </summary>
public Gomee(int GomeeID)
{
db = DatabaseFactory.CreateDatabase();
DbCommand dbCommand = db.GetStoredProcCommand("AG_GetGomeeByGomeeID");
db.AddInParameter(dbCommand, "GomeeID", DbType.Int32, GomeeID);
//execute the stored procedure
using (IDataReader dr = db.ExecuteReader(dbCommand))
{
ColumnFieldList list = new ColumnFieldList(dr);
if (dr.Read())
{
if (list.IsColumnPresent("GomeeID")) { this._gomeeID = (int)dr["GomeeID"]; }
if (list.IsColumnPresent("YoGomeeUserID")) { this._yoGomeeUserID = (int)dr["YoGomeeUserID"]; }
if (list.IsColumnPresent("Active")) { this._active = (bool)dr["Active"]; }
if (list.IsColumnPresent("Latitude")) { this._latitude = (decimal)dr["Latitude"]; }
if (list.IsColumnPresent("Longitude")) { this._longitude = (decimal)dr["Longitude"]; }
if (list.IsColumnPresent("Expiration")) { this._expiration = (DateTime)dr["Expiration"]; }
if (list.IsColumnPresent("DoesExpire")) { this._doesExpire = (bool)dr["DoesExpire"]; }
if (list.IsColumnPresent("GomeeType")) { this._gomeeType = (int)dr["GomeeType"]; }
if (list.IsColumnPresent("RawValue1")) { this._rawValue1 = (string)dr["RawValue1"]; }
if (list.IsColumnPresent("RawValue2")) { this._rawValue2 = (string)dr["RawValue2"]; }
if (list.IsColumnPresent("Created")) { this._created = (DateTime)dr["Created"]; }
}
else
{
throw new Exception("There is no Gomee in the database with the ID " + GomeeID);
}
dr.Close();
}
}
示例14: GetGeoNameByFeatureClassID
/// <summary>
/// Calls the database and gets all the GeoName objects for this FeatureClass
/// </summary>
private List<GeoName> GetGeoNameByFeatureClassID()
{
db = DatabaseFactory.CreateDatabase();
DbCommand dbCommand = db.GetStoredProcCommand("AG_GetGeoNameByFeatureClassID");
db.AddInParameter(dbCommand, "FeatureClassID", DbType.Int32, FeatureClassID);
List<GeoName> arr = null;
// Populate the datareader
using (IDataReader dr = db.ExecuteReader(dbCommand))
{
// Call the PopulateObject method passing the datareader to return the object array
arr = yoGomee.Data.GeoName.PopulateObject(dr);
dr.Close();
}
return arr;
}
示例15: FeatureCode
/// <summary>
/// Instanciates a FeatureCode object from the database via the FeatureCodeID
/// </summary>
public FeatureCode(int FeatureCodeID)
{
db = DatabaseFactory.CreateDatabase();
DbCommand dbCommand = db.GetStoredProcCommand("AG_GetFeatureCodeByFeatureCodeID");
db.AddInParameter(dbCommand, "FeatureCodeID", DbType.Int32, FeatureCodeID);
//execute the stored procedure
using (IDataReader dr = db.ExecuteReader(dbCommand))
{
ColumnFieldList list = new ColumnFieldList(dr);
if (dr.Read())
{
if (list.IsColumnPresent("FeatureCodeID")) { this._featureCodeID = (int)dr["FeatureCodeID"]; }
if (list.IsColumnPresent("FeatureCodeCD")) { this._featureCodeCD = (string)dr["FeatureCodeCD"]; }
if (list.IsColumnPresent("FeatureClassID")) { this._featureClassID = (int)dr["FeatureClassID"]; }
if (list.IsColumnPresent("Name")) { this._name = (string)dr["Name"]; }
if (list.IsColumnPresent("Description")) { this._description = (string)dr["Description"]; }
}
else
{
throw new Exception("There is no FeatureCode in the database with the ID " + FeatureCodeID);
}
dr.Close();
}
}