about visual basic.net

5 pts.
Tags:
Database connectivity
SQL
VB.NET
VB.NET 2003
Hi I install vb.net ready and make connection ready, but when I try to using SQL statement it is error: my SQL is dim strSQL as string="select * from tblCustome where CustomerID="& intCustomerID the error is it does not no the string &? Please show me the solution how to solve this error! thank my email is narath-chhay@hotmail.com

Answer Wiki

Thanks. We'll let you know when a new response is added.

What is the error message ?

Are you sure your table name is “tblCustome” and not “tblCustome<b>r</b>”

Also, if you used the ampersand (&) to indicate that intCustomerID is a parameter, you should do it this way (assuming that SqlClient was being used) :

<pre>
command.CommandText = “select * from tblCustomer where CustomerID = :pCustomerId”
command.Parameters.AddWithValue(“pCustomerId”,intCustomerID)
</pre>

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: