how can we connect to microsoft access foxpro


How can we connect to Microsoft Access, Foxpro , Oracle etc ?

The Microsoft provides System.Data.OleDb namespace to communicate with the databases such as Oracle, scess  etc. In brief any OLE DB-Compliant database can be connected using the System.Data.OldDb namespace.

Private Sub loadData()

Dim strPath As String

strPath = AppDomain.CurrentDomain.BaseDirectory

Dim objOLEDBCon As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source =" & strPath & "Nwind.mdb")

Dim objOLEDBCommand As OleDbCommand Dim objOLEDBReader As OleDbDataReader Try

objOLEDBCommand = New OleDbCommand("Select FirstName from Employees")

objOLEDBCon.Open() objOLEDBCommand.Connection = objOLEDBCon objOLEDBReader = objOLEDBCommand.ExecuteReader() Do While objOLEDBReader.Read()

lstNorthwinds.Items.Add(objOLEDBReader.GetString(0)) Loop

Catch ex As Exception

Throw ex

Finally objOLEDBCon.Close()

End Try

End Sub

Request for Solution File

Ask an Expert for Answer!!
DOT NET Programming: how can we connect to microsoft access foxpro
Reference No:- TGS0161344

Expected delivery within 24 Hours