Hi, I have the following code which gives the error
"Incorrect syntax near '='". Any help please
Code:Private Sub populateOrgDetails() Dim cmd As New SqlCommand Dim conn As SqlConnection = GetDbConnection() Dim Orgdetails As New System.Data.SqlClient.SqlCommand(("Select OrgAdd1, OrgAdd2, OrgTown, OrgCountry From dbo.tbl_Organisation WHERE OrgID = " & _ Me.txtclientOrgnw.Text & ""), conn) Using reader As System.Data.SqlClient.SqlDataReader = Orgdetails.ExecuteReader() While reader.Read() Dim OrgAdd1 As String = FixNull(reader.GetValue(0)) Dim OrgAdd2 As String = FixNull(reader.GetValue(1)) Dim OrgTown As String = FixNull(reader.GetValue(2)) Dim OrgCountry As String = FixNull(reader.GetValue(3)) txtOrgAdd1.Text = OrgAdd1 txtOrgAdd2.Text = OrgAdd2 txtOrgTown.Text = OrgTown txtOrgCountry.Text = OrgCountry End While End Using End Sub




Reply With Quote