0

I am trying to set strCustomerNumber to CustomerNumber from tblcustomers
The tricky part is It has to be a specific Customer, so I have to retrieve the customerName from ddlCustomers before I can get the correct number here is my code:

Dim strCustomerNumber as new string("")
strCustomerNumber = ("SELECT CustomerNumber from tblcustomers Where CustomerName = " [U]ddlCustomers[/U])

I am getting ')' expected on "ddlCustomers"

Anyone have any suggestions?

3
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by scorpio26krf
0
strCustomerNumber = "SELECT CustomerNumber from tblcustomers Where CustomerName = '" & ddlCustomers & "'"

try it

0
strCustomerNumber = "SELECT CustomerNumber from tblcustomers Where CustomerName = '" & ddlCustomers.SelectedValue&"'
0

Had to do it this way.

localOutputServer = New SQLServer(ConfigurationManager.AppSettings("dbConnectionString"))
strSQL = New StringBuilder
strSQL.Append("SELECT PrintStreamACNO from tblcustomers Where CustomerName ='" & ddlCustomers.SelectedValue & "'")
localdr = localOutputServer.runSQLDataReader(strSQL.ToString)

If localdr.HasRows Then
If localdr.Read Then
strCustomerNumber = localdr(0).ToString
End If
End If

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.