-1
cmd = New SqlCommand
cmd.Parameters.Add("@Mod", SqlDbType.Int).Value = 4
con.Open()
dr = cmd.ExecuteReader
Db1.DataSource = dr
Db1.DataBind()

为什么 Db1.DataBind() 属性不起作用?

4

1 回答 1

0
SqlConnection conn=new SqlConnection(your db connestionString);
con.Open()
SqlCommand cmd = New SqlCommand();
cmd.Connection=conn;
//here Iguess you are trying to pass this parameter to sql strored procedure.
//So first set cmd.Commanndtype to sproc
cmd.Parameters.Add("@Mod", SqlDbType.Int).Value = 4
dr = cmd.ExecuteReader
Db1.DataSource = dr
Db1.DataBind()
于 2012-09-02T09:51:51.977 回答