本文整理汇总了C#中SQLHandler.ExecuteSQL方法的典型用法代码示例。如果您正苦于以下问题:C# SQLHandler.ExecuteSQL方法的具体用法?C# SQLHandler.ExecuteSQL怎么用?C# SQLHandler.ExecuteSQL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SQLHandler
的用法示例。
在下文中一共展示了SQLHandler.ExecuteSQL方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReOrganizeTable
public static void ReOrganizeTable(string tableName)
{
try
{
SQLHandler sqlH = new SQLHandler();
sqlH.ExecuteSQL("ALTER INDEX ALL ON " + tableName + " REORGANIZE");
}
catch (Exception e)
{
throw e;
}
}
示例2: ReIndexTable
public static void ReIndexTable(string tableName)
{
try
{
SQLHandler sqlH = new SQLHandler();
sqlH.ExecuteSQL("ALTER INDEX ALL ON " + tableName + " REBUILD WITH (FILLFACTOR=90,ONLINE=ON)");
}
catch (Exception e)
{
throw e;
}
}
示例3: ExecuteSql
//public static byte[] ConvertImageToByteArray(Stream afuInputStream, int contentLength)
//{
// byte[] sqlBinaryData = new byte[contentLength];
// afuInputStream.Read(sqlBinaryData, 0, contentLength);
// return sqlBinaryData;
//}
private void ExecuteSql()
{
try
{
SQLHandler objSqlh = new SQLHandler();
if (chkRunAsScript.Checked == true)
{
string strError = objSqlh.ExecuteScript(txtSqlQuery.Text);
if (string.IsNullOrEmpty(strError))
{
ShowMessage(SageMessageTitle.Information.ToString(), GetSageMessage("SQL", "TheQueryCompletedSuccessfully"), "", SageMessageType.Success);
}
else
{
ShowMessage(SageMessageTitle.Notification.ToString(), strError, "", SageMessageType.Alert);
}
}
else
{
System.Data.DataTable dt = objSqlh.ExecuteSQL(txtSqlQuery.Text);
if (dt != null)
{
gdvResults.DataSource = dt;
gdvResults.DataBind();
}
else
{
ShowMessage(SageMessageTitle.Notification.ToString(), GetSageMessage("SQL", "ThereIsAnErrorInYourQuery"), "", SageMessageType.Alert);
}
}
string txt = txtSqlQuery.Text;
}
catch (Exception ex)
{
ProcessException(ex);
}
}