I posted earlier to no response to the same question so after some trial and error I came up with:
Dim conPubs As Data.SqlClient.SqlConnection
Dim SQL As String
Dim MYCompany As String
conPubs = New Data.SqlClient.SqlConnection("Server=xxx.xxx.xx.xx ;uid=;pwd=;database=DB")
conPubs.Open()
MYCompany = BillDropDown.Text
SQL = "SELECT Name,City,Address1,Address2,State,Country,Postal_C ode,Phone_Num FROM [CUSTOMER] where NAME = '" & MYCompany & " 'Group By Name,City,Address1,Address2,State,Country,Postal_C ode,Phone_Num"
Dim cmdSelectPeople As Data.SqlClient.SqlCommand
Dim getpeople As Data.SqlClient.SqlDataReader
cmdSelectPeople = New Data.SqlClient.SqlCommand(SQL, conPubs)
getpeople = cmdSelectPeople.ExecuteReader()
If (getpeople.HasRows) Then
While (getpeople.Read())
txtbillname.Text = getpeople("Name").ToString()
txtcity.Text = getpeople("CITY").ToString()
txtaddress.Text = getpeople("Address1").ToString()
txtaddress2.Text = getpeople("Address2").ToString()
txtState.Text = getpeople("State").ToString()
txtcountry.Text = getpeople("Country").ToString()
txtzip.Text = getpeople("Postal_Code").ToString()
txtbillphone.Text = getpeople("Phone_Num").ToString()
End While
End If
getpeople.Close()
conPubs.Close()
Being very new to asp and dot net in generalâ¦it may not be the best but it works for me. Itâs written in
VB but sould give some pointers for C.
HTH
Marty