General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Accessing VFP 5.0 Databases from .NET?
I have been trying to access some of the accounting data of a client (SBT Pro Series 5.0, for those who might know it) that is written in VFP 6.0 through the VFPOLEDB driver from Microsoft.
Unfortunately, I am a bit new to the .NET framework and cannot be sure if its that lack of knowledge or if its a limitation of that OLEdb driver. Anyone knows if that driver can access VFP6 .DBC or just later versions? I am almost running out of hairs to pull out of my head so hoping someone here has done somehting similar ;)
Here is some sample code in case someone can catch what I am doing wrong:
sub BindDataGrid()
dim strConnection as String
dim VFPConnection as OleDbConnection
VFPConnection.ConnectionString = "provider=VFPOLEDB.1 ;datasource=C:\DEV\ACCENTLABELS\WEBORDERS\DATASERVICETIER\SODATA.DBC;"
VFPConnection.Open()
'// Create a Command object with the select statement.
dim strSelect as string = "SELECT * FROM somast"
dim VFPSelectCommand as OleDbCommand = new OleDbCommand(strSelect,VFPConnection)
'// Create a DataAdapter.
dim VFPDataAdapter as OleDbDataAdapter = new OleDbDataAdapter()
VFPDataAdapter.SelectCommand = VFPSelectCommand
'// Create a DataSet.
dim VFPDataSet as DataSet = new DataSet()
'// Fill the DataSet with table information.
VFPDataAdapter.Fill(VFPDataSet,"somast")
'// Bind to the DataGrid.
dim VFPDataView as DataView
VFPDataView = new DataView(VFPDataSet.Tables("somast"))
dgrSomaster.DataSource = VFPDataSet.DefaultView
dgrSomaster.DataBind()
end sub
If someone knows good articles on VFP-.NET integration and data sharing please let me know too ;)
Thanks in advance
Pascal
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only