Click here to Skip to main content
15,914,500 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralThanks for your reply! Pin
Innovathis7-Sep-04 3:51
Innovathis7-Sep-04 3:51 
GeneralRe: Thanks for your reply! Pin
Dave Kreskowiak7-Sep-04 12:27
mveDave Kreskowiak7-Sep-04 12:27 
GeneralSource Safe is driving me mad! Pin
MrMickeyDeeGimp6-Sep-04 4:22
MrMickeyDeeGimp6-Sep-04 4:22 
GeneralRe: Source Safe is driving me mad! Pin
Pradeep Shamarao8-Sep-04 2:09
Pradeep Shamarao8-Sep-04 2:09 
GeneralShow form from remotable object Pin
fleetwood6-Sep-04 4:21
fleetwood6-Sep-04 4:21 
Generalplease help me! Pin
Member 9046056-Sep-04 3:13
Member 9046056-Sep-04 3:13 
GeneralRecord with a web cam using vb.net code Pin
Sunil Naidu6-Sep-04 2:27
Sunil Naidu6-Sep-04 2:27 
QuestionHow do I update my DB tables with datasets Pin
Cyberclown6-Sep-04 1:49
Cyberclown6-Sep-04 1:49 
Smile | :) Hi there,

I have been trying to get to read from one DB into a dataset. Then read from the dataset into an XML file and then read from the XML file into a second dataset. Now all of this I got right but the part where I update the DB (a different one to the original) is not working. I am not getting any errors but the table stays empty.

I prosume that the problem is the same as mentioned by Ami but I would appreciate any comments or help regarding this. Below I have included the part of my code that does this.

Kind regards!
Etienne


Dim myAdapter As New SqlClient.SqlDataAdapter
Dim myAdapterLocal As New SqlClient.SqlDataAdapter
Dim objData As New ExtITPOSData.Data
Dim myConnServer As New System.Data.SqlClient.SqlConnection(objData.GetConnectionString)
Dim myConnLocal As New System.Data.SqlClient.SqlConnection(objData.GetLocalConnectionString)
Dim dsServer As New dsSyncronization
Dim dsLocal As New dsSyncronization
'--put data into dataset
myAdapter = New SqlClient.SqlDataAdapter("SELECT VAT, GST FROM Tax", myConnServer)
myAdapter.Fill(dsServer, "Tax")
dsServer.WriteXml("../Tax.xml", XmlWriteMode.DiffGram)
myAdapter = Nothing
dsServer = Nothing

myAdapterLocal = New SqlClient.SqlDataAdapter("SELECT VAT, GST FROM Tax", myConnLocal)
Try
dsLocal.ReadXml("../Tax.xml", XmlReadMode.DiffGram)
Catch FileNotFound As FileNotFoundException
' The XML data must be written before it can be read
MsgBox("No XML file available. View data online and save to offline.", MsgBoxStyle.Critical)
End Try
Dim myCmdBuilder As New SqlClient.SqlCommandBuilder(myAdapterLocal)
myAdapterLocal.InsertCommand = myCmdBuilder.GetInsertCommand
myAdapterLocal.Update(dsLocal, "Tax")

Thanx!
AnswerRe: How do I update my DB tables with datasets Pin
Dave Kreskowiak7-Sep-04 1:28
mveDave Kreskowiak7-Sep-04 1:28 
GeneralSMTP CDO.Message error Pin
denisdurand5-Sep-04 23:44
denisdurand5-Sep-04 23:44 
GeneralRe: SMTP CDO.Message error Pin
Dave Kreskowiak7-Sep-04 1:18
mveDave Kreskowiak7-Sep-04 1:18 
GeneralRe: SMTP CDO.Message error Pin
denisdurand7-Sep-04 8:26
denisdurand7-Sep-04 8:26 
Generalhelp~a codeDom segment Pin
noway5865-Sep-04 20:05
noway5865-Sep-04 20:05 
GeneralRe: help~a codeDom segment Pin
noway5865-Sep-04 20:08
noway5865-Sep-04 20:08 
GeneralPlease please help. Pin
Mega15-Sep-04 17:26
Mega15-Sep-04 17:26 
GeneralDatagrid ColumnHeader Captions Pin
beowulfagate5-Sep-04 15:42
beowulfagate5-Sep-04 15:42 
GeneralRe: Datagrid ColumnHeader Captions Pin
Anonymous6-Sep-04 8:14
Anonymous6-Sep-04 8:14 
Generalcreating a "please wait" dialog Pin
sagmam5-Sep-04 7:19
sagmam5-Sep-04 7:19 
GeneralRe: creating a "please wait" dialog Pin
Greg Eales6-Sep-04 2:02
Greg Eales6-Sep-04 2:02 
GeneralRe: creating a "please wait" dialog Pin
sagmam12-Sep-04 2:48
sagmam12-Sep-04 2:48 
GeneralRe: creating a "please wait" dialog Pin
jonathan156-Sep-04 4:27
jonathan156-Sep-04 4:27 
GeneralConnecting to SQL Server DB Pin
RamBhatt5-Sep-04 4:13
RamBhatt5-Sep-04 4:13 
GeneralRe: Connecting to SQL Server DB Pin
Mekong River5-Sep-04 7:27
Mekong River5-Sep-04 7:27 
GeneralRe: Connecting to SQL Server DB Pin
RamBhatt5-Sep-04 20:03
RamBhatt5-Sep-04 20:03 
GeneralRe: Connecting to SQL Server DB Pin
jonathan156-Sep-04 4:38
jonathan156-Sep-04 4:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.