Solved

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

Posted on 2006-07-19
1
163 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

747 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

14 Experts available now in Live!

Get 1:1 Help Now