vwalla
asked on
Create Dataset from SQL CE Database
Is there a way to create a dataset from a sqlce database. Basically I want to iterate through the structure of a local database on the client computer and compare it with another sqlcedb (strongly typed so that is easy) to update any column or table changes.
Here is all I have so far. There are never any tables in the collection, so I beleive I need to "populate" the schema info from the database on the client machine, but I am not sure how to do it. Thanks.
Here is all I have so far. There are never any tables in the collection, so I beleive I need to "populate" the schema info from the database on the client machine, but I am not sure how to do it. Thanks.
Dim sConnectionString As String
sConnectionString = "Data Source=" & My.Settings.DBLocation
Dim objConn As New SqlCeConnection(sConnectionString)
objConn.Open()
Dim dsUserDB As New DataSet("UserDB")
Dim table As DataTable
For Each table In dsUserDB.tables
Console.WriteLine(table.TableName)
Next
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Perfect! Thanks. I can figure out iterating the columns from here http://msdn.microsoft.com/en-us/library/ms188348.aspx.
Thanks again!
Thanks again!
Refer Information Schema (SQL Server Compact)
Open in new window