Solved

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

Posted on 2006-07-19
1
171 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

733 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