about visual basic.net

5 pts.
Tags:
Database connectivity
SQL
VB.NET
VB.NET 2003
Visual Basic .NET
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
ASKED: June 24, 2009  1:15 AM
UPDATED: December 15, 2010  11:10 PM

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.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

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.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

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

Following