this is my code :
string aaa;
aaa = Request.Params["aaa"];
string strSel;
if (aaa != "" && aaa != null)
{
// Response.Write("<script>alert('" + aaa + "');</script>");
strSel = "Select * from inout where FName like '%" + aaa + "%'";
}
else
{
strSel = "Select * from inout";
}
Response.Write(strSel);
string strProvider = "Server=(local);DataBase=AIS20060712101417;UID=sa;PWD=";
Data0 ds= new Data0();
SqlConnection MyConn = new SqlConnection(strProvider);
MyConn.Open();
SqlDataAdapter MyAdapter = new SqlDataAdapter(strSel, MyConn);
MyAdapter.Fill(ds,"inout");
GridView1.DataSource = ds;
GridView1.DataBind();
then the gridview is empty.
Is
AutoGenerateColumnsset to true ?Try adding
ds.Tables[0]asDataSource.