本文整理汇总了C#中SqlDatabase.GetParameterValue方法的典型用法代码示例。如果您正苦于以下问题:C# SqlDatabase.GetParameterValue方法的具体用法?C# SqlDatabase.GetParameterValue怎么用?C# SqlDatabase.GetParameterValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SqlDatabase
的用法示例。
在下文中一共展示了SqlDatabase.GetParameterValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ShouldChangeScriptRun
private bool ShouldChangeScriptRun(int MajorNumber, int MinorNumber, int RevisionNumber, int PatchNumber)
{
try
{
SqlDatabase db = new SqlDatabase(GetConnectionString());
string sqlCommand = "_CheckVersion";
DbCommand dbCommand = db.GetStoredProcCommand(sqlCommand);
db.AddInParameter(dbCommand, "MajorNumber", DbType.Int32, MajorNumber);
db.AddInParameter(dbCommand, "MinorNumber", DbType.Int32, MinorNumber);
db.AddInParameter(dbCommand, "RevisionNumber", DbType.Int32, RevisionNumber);
db.AddInParameter(dbCommand, "PatchNumber", DbType.Int32, PatchNumber);
db.AddOutParameter(dbCommand, "ReturnValue", DbType.Int32, 0);
int DataFoundIndicator = 0;
db.ExecuteNonQuery(dbCommand);
DataFoundIndicator = Convert.ToInt32(db.GetParameterValue(dbCommand, "ReturnValue"));
if (DataFoundIndicator == 0)
{
//This means the previous one was found, but the current one was not.
return true;
}
if (DataFoundIndicator == 1)
{
//This means the current one was not found.
return false;
}
if (SkipMissingChangeScripts)
{
//If flag is set to skip,then allow skips....
Log("File not found for change script (skipped flag set): " + String.Format("{0:00}", MajorNumber) + "." +
String.Format("{0:00}",MinorNumber) + "." +
String.Format("{0:00}",RevisionNumber) + "." +
String.Format("{0:00}",PatchNumber));
return true;
}
throw (new DBBuildException("A file is found to process, but the previous one was not found as processed. "));
}
catch (DBBuildException ex)
{
Log(ex, "ChangeScriptRun", "DBBuildException");
throw (ex);
}
catch (Exception ex)
{
Log(ex, "ChangeScriptRun");
return false;
}
}