myysl97
پنج شنبه 14 فروردین 1393, 10:24 صبح
سلام دوستان به این تکه کد چطوری من پارامتر textbox رو معرفی کنم؟!
string cnf = System.Configuration.ConfigurationManager.Connecti onStrings["god"].ToString();
SqlConnection con = new SqlConnection(cnf);
con.Open();
string str = "select * from tblqustion where qustionname like N'%'+@textbox+'%'";
SqlDataAdapter sdr = new SqlDataAdapter(str, con);
System.Data.DataSet ds = new System.Data.DataSet();
sdr.Fill(ds);
GridView1.DataSource = ds;
GridView1.DataBind();
con.Close();
string cnf = System.Configuration.ConfigurationManager.Connecti onStrings["god"].ToString();
SqlConnection con = new SqlConnection(cnf);
con.Open();
string str = "select * from tblqustion where qustionname like N'%'+@textbox+'%'";
SqlDataAdapter sdr = new SqlDataAdapter(str, con);
System.Data.DataSet ds = new System.Data.DataSet();
sdr.Fill(ds);
GridView1.DataSource = ds;
GridView1.DataBind();
con.Close();