Solved

Updating a Table on a remote server using a Dataset, cant get it working

Posted on 2006-07-19
1
165 Views
Last Modified: 2010-04-24
This is the code iam trying to get to copy all data from one table and insert it in a remote server.

The data is filled into the dData dataSet just fine.. and the MessageBox pops up to .. however no data is written..

                SqlConnection sCnxn = new SqlConnection("server=195.69.130.88\\SQLEXPRESS,1434;database=tasklist;uid=sa;pwd=x7xvlwv1;");
                sCnxn.Open();
                DataSet dData = new DataSet();
                SqlCeDataAdapter aDBs=new SqlCeDataAdapter("Select * from phoneLog", cnxn);
                aDBs.Fill(dData);
                SqlDataAdapter bDBs = new SqlDataAdapter("select * from phoneLog",sCnxn);
                bDBs.Update(dData);
                MessageBox.Show("Sync completed");

Can someone tell me what iam doing wrong ?
0
Comment
Question by:mSchmidt
1 Comment
 
LVL 15

Accepted Solution

by:
lakshman_ce earned 500 total points
ID: 17140776
1. I don't see you creating 'cnxn' object.
2. Write the UpdateCommands and then call update as shown in the link
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconupdatingdatabasewithdataadapterdataset.asp

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
C# - Function parentheses 11 53
using dll from another object 1 81
FTP Directory Listing 2 65
Visual Studio 2015 error "not a valid Win32 application" 6 389
The following diagram presents a diamond class hierarchy: As depicted, diamond inheritance denotes when two classes (e.g., CDerived1 and CDerived2), separately extending a common base class (e.g., CBase), are sub classed simultaneously by a fourt…
In Easy String Encryption Using CryptoAPI in C++ (http://www.experts-exchange.com/viewArticle.jsp?aid=1193) I described how to encrypt text and recommended that the encrypted text be stored as a series of hexadecimal digits -- because cyphertext may…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now