Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27554

VS 2012 Convert from Access to SQL-Server

$
0
0
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?

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


Viewing all articles
Browse latest Browse all 27554

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>