SQL server and the other is a Foxpro DBF table. What I'm trying to do is
take data from the SQL server and place it into the DBF table this is the
code I have so far.
Expand|Select|Wrap|Line Numbers
- '======= SQL Connection ======
- Dim strConn As String = "user id=*******;password=*******;data
- source=***.***.***.***;persist security info=False;initial catalog=*******"
- Dim sqlCon As New SqlConnection(strConn)
- Dim objDR As SqlDataReader
- Dim objDA As New SqlDataAdapter
- Dim objDS As New DataSet
- '==============================
- Try
- 'Open Connection
- sqlCon.Open()
- 'Define SQL command
- objDA.SelectCommand = New SqlCommand("contacts", sqlCon)
- 'Execute SQL command
- objDA.Fill(objDS, "contacts")
- Catch strError As Exception
- MessageBox.Show(strError.ToString)
- Finally
- 'Close and Dispose Connection
- sqlCon.Close()
- sqlCon.Dispose()
- End Try
- '==============================
- 'Foxpro ODBC Connection
- Dim strFoxProConn As String = "Driver={Microsoft Visual FoxPro
- Driver};SourceType=DBF;SourceDB=c:\;Exclusive=No"
- Dim OdbcConn As New OdbcConnection(strFoxProConn)
- '==============================
dataset. I have then created a ODBC connection to the DBF table, this is
where I am now stuck and not too sure what to do. My knowledge of VB.NET is
not great that's why I'm posting on here with the hope that somebody can
point me in the right direction of what to do next.
Thanks in Advance.
--
Martin