SqlConnection con=new SqlConnection("database=cvp;server=.;integrated security=true;");
SqlCommand cmd;
SqlDataAdapter da;
DataSet ds;
string query,tablename;
{
tablename=
}
tablename =
query = slct + frm + tablename + whr + tblcol + sign + val;
ListBox1.Items.Add(query);
protected
cmd =
ss = query;
cmd.CommandText = ss;
cmd.Connection = con;
con.Open();
dr=cmd.ExecuteReader();
dt.Columns.Add(dc1);
dt.Columns.Add(dc2);
dt.Columns.Add(dc3);
dr1[0] = dr.GetSqlInt32(0);
dr1[1] = dr.GetString(1);
dr1[2] = dr.GetSqlInt32(2);
dt.Rows.Add(dr1);
GridView1.DataSource = dt;
GridView1.DataBind();
con.Close();