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; } }
public static void ReOrganizeTable(string tableName) { try { SQLHandler sqlH = new SQLHandler(); sqlH.ExecuteSQL("ALTER INDEX ALL ON " + tableName + " REORGANIZE"); } catch (Exception e) { throw e; } }
//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); } }
private void btnExecuteSQLAsDataTable_Click(object sender, EventArgs e) { try { lblTitle.Text = "Execute SQL to DataTable : GET ALL COUNTRIES"; string query = QueryBase.GetAllFrom(eTables.country); DataTable dataTable = null; Task.Factory.StartNew(() => { dataTable = sqlHandler.ExecuteSQL(query); }).Wait(); dgvResult.DataSource = dataTable; } catch (Exception ex) { DisplayError(ex.Message); } }
public void Dispose() { _connection.ExecuteSQL(""); }