Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
const string BATCH_SEPERATOR = "GO";
string[] commands = sqlStr.Split(BATCH_SEPERATOR);
SqlCommand cmd = this.sqlConn.CreateCommand();
sqlConn.Open();
foreach (string commandText in commands)
{
cmd.CommandText = commandText;
cmd.ExecuteNonQuery();
}
sqlConn.Close();
[blue]private void[/blue] Page_Load([blue]object[/blue] sender, System.EventArgs e)
{
SqlConnection objConn = [blue]new[/blue] SqlConnection("server=MyServer;uid=sa;password=sa;database=Northwind;pooling=true;max pool size=6");
objConn.Open();
DataSet ds = [blue]new[/blue] DataSet();
SqlCommand objComm = [blue]new[/blue] SqlCommand("select * from Products go; select * from Categories go");
SqlDataAdapter objDA = [blue]new[/blue] SqlDataAdapter(objComm.CommandText,objConn);
objDA.Fill(ds);
[blue]if[/blue] (objConn.State == System.Data.ConnectionState.Open)
{
objConn.Close();
}
objDA = [blue]null[/blue];
objComm = [blue]null[/blue];
objConn = [blue]null[/blue];
[blue]foreach[/blue](DataTable dt [blue]in[/blue] ds.Tables)
{
DataGrid dg = [blue]new[/blue] DataGrid();
dg.DataSource = dt;
dg.DataBind();
Page.Controls.Add(dg);
}
ds = [blue]null[/blue];
}