We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

problem executing a parameterized command

Thread ID:




7947 Oct 15,2003 08:36 AM Windows Forms 0
Tags: FAQ
Asked On October 15, 2003 08:36 AM

Hi, I am trying to execute a parameterized command as follows: *********************************************** cn.Open() Dim sql As String = "Select creditlimit, vatcode from customers where Name = @v_name " Dim cmd As New System.Data.SqlClient.SqlCommand(sql, cn) cmd.Parameters.Add("v_name", "test") Dim dr As SqlClient.SqlDataReader = cmd.ExecuteReader dr.Read() cn.close() ************************************************* I am getting an error at the statement Dim dr As SqlClient.SqlDataReader = cmd.ExecuteReader as ********************************************* An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in system.data.dll Additional information: System error. *********************************************** It doesn't seem to have accepted the parameters. Please let me know what mistake I am doing in the above declaration. Thanks & Regards, Shailaja


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.