本文整理匯總了C#中Westwind.Utilities.Data.SqlDataAccess.RunSqlScript方法的典型用法代碼示例。如果您正苦於以下問題:C# SqlDataAccess.RunSqlScript方法的具體用法?C# SqlDataAccess.RunSqlScript怎麽用?C# SqlDataAccess.RunSqlScript使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Westwind.Utilities.Data.SqlDataAccess
的用法示例。
在下文中一共展示了SqlDataAccess.RunSqlScript方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: CreateLocalizationTable
/// <summary>
/// Creates the Localization table on the current connection string for
/// the provider.
/// </summary>
/// <param name="tableName"></param>
/// <returns></returns>
public bool CreateLocalizationTable(string tableName = null)
{
if (tableName == null)
tableName = DbResourceConfiguration.Current.ResourceTableName;
if (string.IsNullOrEmpty(tableName))
tableName = "Localizations";
string Sql = string.Format(TableCreationSql, tableName);
// Check for table existing already
if (IsLocalizationTable(tableName))
{
SetError(Resources.Resources.LocalizationTable_Localization_Table_exists_already);
return false;
}
SqlDataAccess Data = new SqlDataAccess(DbResourceConfiguration.Current.ConnectionString);
// Now execute the script one batch at a time
if (!Data.RunSqlScript(Sql, false, false))
{
ErrorMessage = Data.ErrorMessage;
return false;
}
return true;
}