level 2
建文1129
楼主
protected void bind2()
{
SqlConnection myconn = getconnection();
myconn.Open();
new SqlParameter("@box1", "this.TextBox1.Text");//定义页面参数,这样子无法把参数传给sql存储过程,需要怎么修正?
string sqlStr = @"exec pd ";
SqlDataAdapter myDa = new SqlDataAdapter(sqlStr, myconn);
DataSet myDs = new DataSet();
myDa.Fill(myDs);
GridView3.DataSource = myDs;
GridView3.DataBind();
myDa.Dispose();
myDs.Dispose();
myconn.Close();
}
-----------------
这样子写,无法传递参数给存储过程,需要怎么修正?
大佬们帮忙看一下。 帮忙指点一下。
2019年08月02日 00点08分
1
{
SqlConnection myconn = getconnection();
myconn.Open();
new SqlParameter("@box1", "this.TextBox1.Text");//定义页面参数,这样子无法把参数传给sql存储过程,需要怎么修正?
string sqlStr = @"exec pd ";
SqlDataAdapter myDa = new SqlDataAdapter(sqlStr, myconn);
DataSet myDs = new DataSet();
myDa.Fill(myDs);
GridView3.DataSource = myDs;
GridView3.DataBind();
myDa.Dispose();
myDs.Dispose();
myconn.Close();
}
-----------------
这样子写,无法传递参数给存储过程,需要怎么修正?
大佬们帮忙看一下。 帮忙指点一下。