Friday, March 9, 2012

I need to put ‘ExecuteNonQuery’ in this Command ?


Dim CmdCertAut AS New SqlCommand("sel_CertAuto", strConnection)
CmdCertAut.CommandType = CommandType.StoredProcedure

CmdCertAut.Parameters.Add(New SqlParameter("@.Product_id", SqlDbType.smallint, 2, "Product_id"))
CmdCertAut.Parameters("@.Product_id").Value = product.SelectedItem.Value

CmdCertAut.Parameters.Add(New SqlParameter("@.Region_id", SqlDbType.smallint, 2, "Region_id"))
CmdCertAut.Parameters("@.Region_id").Value = reg.SelectedItem.Value

strConnection.open()
CmdCertAut.ExecuteNonQuery

Dim Certif_Aut As SqlDataReader = CmdCertAut.ExecuteReader(CommandBehavior.CloseConnection)

certAut.DataSource = Certif_Aut
certAut.DataBind()

Dim Cert_Aut As New ListItem
Cert_Aut.Text = "(Select)"
Cert_Aut.Value = "0"
certAut.Items.Insert(0, Cert_Aut)
certAut.SelectedIndex = 0

what are you trying to do ? bind the results of the stored proc to a datagrid ?|||Yes|||Then.. I need tho put it?

No comments:

Post a Comment