-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 に答える