Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language


 
 
Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

C# Programming

Copying DataRows from one table to other


  SqlConnection sql;
        SqlDataAdapter sqlda;
        DataSet sqlds, msads;
        OleDbConnection msa;
        OleDbDataAdapter msada;
        //DataRow drs,drm;
        DataTable ab, abcopy;

        private void Form1_Load(object sender, EventArgs e)
        {
            sql = new SqlConnection("data source=SRAVAN;user
id=sa;database=master");
            sqlda = new SqlDataAdapter("Select * from addressbook",
sql);
            sqlds = new DataSet();
            sqlda.Fill(sqlds, "ab");
            msa = new OleDbConnection("provider=microsoft.jet.oledb.
4.0;"
                + "data source=C:\\Documents and Settings\\sravan\\My
Documents\\AddressBook.mdb");
            msada = new OleDbDataAdapter("select * from addressbook",
msa);
            msads = new DataSet();
            //msada.Fill(msads, "ab");
            //string name, mobile, residence, notes,count;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            /*drs = sqlds.Tables["ab"].NewRow();
            drm = msads.Tables["ab"].NewRow();
            for (int i = 0; i < sqlds.Tables["ab"].Rows.Count; i++)
            {
                drs = sqlds.Tables["ab"].Rows[i];
                drm=drs;
                msads.Tables["ab"].Rows.Add(drm);
                msada.Update(msads, "ab");
            }*/
            ab = sqlds.Tables["ab"];
            abcopy = ab.Clone();
            for(int i=0;i<sqlds.Tables["ab"].Rows.Count;i++)
                abcopy.ImportRow(ab.Rows[i]);
            msada.Fill(abcopy);
            msada.Update(abcopy);
        }

this is code i had written..
please provide me the code to transfers the rows from one table in
[sql server 2000-->master-->addressbook] to other [MS Access-

>addressbook.mdb->addressbook(table_name)]

please provide the code for this..
Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc