I am trying to convert an application that was written for Access to MySql or SQL-Server. I know that "most" of the commands would be same. But I am getting some problems
The following code for the SQLCommand... is not correct. What would be the correct code?
The following code for the SQLCommand... is not correct. What would be the correct code?
Code:
Try
cmbEmployerName.DataSource = Nothing
dt = New DataTable
dt.Clear()
dt2.Clear()
adp = NewSqlClient.SqlCommand("select distinct Employer_Trading_Name, ID ,notes from Employee ", con)
If con.State = ConnectionState.Closed Then
con.Open()
End If
adp.Fill(dt)
cmbEmployerName.DataSource = dt
cmbEmployerName.DisplayMember = "Employer_Trading_Name"
Catch ex As Exception
MsgBox(ex.Message)
End Try