public bool executeSqlStr(string str) { try { SqlConnection conn = new SqlConnection(); conn.ConnectionString = ConServerStr; conn.Open(); SqlCommand cmd = new SqlCommand(str, conn); cmd.ExecuteNonQuery(); cmd.Dispose(); DBOperation.destroySqlConn(conn); return(true); } catch (Exception) { return(false); } }
public bool CreateTable() { try { SqlConnection conn = new SqlConnection(); conn.ConnectionString = ConServerStr; conn.Open(); string sqlstring = "CREATE TABLE malibutest (id INTEGER NOT Null primary key, value varchar(MAX))"; SqlCommand cmd = new SqlCommand(sqlstring, conn); cmd.ExecuteNonQuery(); cmd.Dispose(); DBOperation.destroySqlConn(conn); return(true); } catch (Exception) { return(false); } }