I have two datasets. One comes from a webservice. The other is in my 'client' program. What I want todo is take the dataset from the webservice and write it to my database (it contains one table with about 4,000 records). Now I can get the dataset to my 'client' program but once I do I can't do anything with it. I am trying to fill the program's dataset from a data adapter pointing to a table that is empty and I get an error(generic systems error from the system.data.sql.dll or somthing like that).
Here is the code I have:
I have also tried the merge feature. And I have the acceptchangesduringfill properity on the webservices data adapter set to false.
Any one have any ideas?
Thanks in advanced
Branden
Here is the code I have:
Code:
Sub GetEMS()
'--open the connection to my SQL Server database (local)
Dim cn As SqlConnection = New SqlConnection("user id=MEDCOMSITE;data source=192.168.1.100\VSDOTNET;persist security info=False;initial catalog=MEDCOMMLOCAL;password=medevac")
cn.open()
'--set the sql statment to populate the data adapter and create it
Dim sql As String = "SELECT * FROM EMS"
dim da As New SqlDataAdapter(sql, cn)
'--set up the command builder
Dim autogen As New SqlCommandBuilder(da)
'--create dataset and populate it (this part gives me an error, but I know the table is empty, I have taken it out)
dim ds as dataset
'da.fill(ds, "EMS")
'--create the reference to webservce and get dataset it sends back
Dim myEMSCharts As New WebReference.Service1
Dim EMSds As DataSet = myEMSCharts.getEMS
'--update local db with dataset info from webservice (gives error, non specific system error)
da.Update(EMSds, "EMS")
cn.Close()
I have also tried the merge feature. And I have the acceptchangesduringfill properity on the webservices data adapter set to false.
Any one have any ideas?
Thanks in advanced
Branden