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. Image for the cookie policy date

problem executing a parameterized command

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

Live Chat Icon For mobile
Up arrow icon