PC Review Forums Newsgroups Microsoft DotNet Microsoft ADO .NET Copy a database table into another using ado.net

Reply

Copy a database table into another using ado.net

 
Thread Tools Rate Thread
Old 02-01-2007, 10:44 PM   #1
kkizer@gmail.com
Guest
 
Posts: n/a
Default Copy a database table into another using ado.net


I need help! Here is what i have going. I have a cobal database that i
connect with using a DSN/ODBC (the source data) and i have a Sql 2000
database that i am trying to copy the data to. I have a DTS package
setup doing this task just fine but i need to do this process using
ado.net/vb.net, not using DTS (dont ask why, long story). I have been
searching around places and just cant find any good code examples to
help me get started. Can anyone helP?

I already have the tables setup in sql server and they are identical to
the Cobal database.

  Reply With Quote
Old 03-01-2007, 03:08 AM   #2
RobinS
Guest
 
Posts: n/a
Default Re: Copy a database table into another using ado.net

Open a connection to both databases, read the data from one, and write
it to the other.

Robin S.
----------------------------
<kkizer@gmail.com> wrote in message
news:1167777897.160161.96810@i12g2000cwa.googlegroups.com...
>I need help! Here is what i have going. I have a cobal database that i
> connect with using a DSN/ODBC (the source data) and i have a Sql 2000
> database that i am trying to copy the data to. I have a DTS package
> setup doing this task just fine but i need to do this process using
> ado.net/vb.net, not using DTS (dont ask why, long story). I have been
> searching around places and just cant find any good code examples to
> help me get started. Can anyone helP?
>
> I already have the tables setup in sql server and they are identical
> to
> the Cobal database.
>



  Reply With Quote
Old 03-01-2007, 06:42 PM   #3
William \(Bill\) Vaughn
Guest
 
Posts: n/a
Default Re: Copy a database table into another using ado.net

No problem. ADO.NET 2.0 exposes the SqlBulkCopy method that does what DTS
does...
hth

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
-----------------------------------------------------------------------------------------------------------------------

<kkizer@gmail.com> wrote in message
news:1167777897.160161.96810@i12g2000cwa.googlegroups.com...
>I need help! Here is what i have going. I have a cobal database that i
> connect with using a DSN/ODBC (the source data) and i have a Sql 2000
> database that i am trying to copy the data to. I have a DTS package
> setup doing this task just fine but i need to do this process using
> ado.net/vb.net, not using DTS (dont ask why, long story). I have been
> searching around places and just cant find any good code examples to
> help me get started. Can anyone helP?
>
> I already have the tables setup in sql server and they are identical to
> the Cobal database.
>



  Reply With Quote
Old 03-01-2007, 09:50 PM   #4
ep3hatchsi
Guest
 
Posts: n/a
Default Re: Copy a database table into another using ado.net

I am using visual studios 2003. does that not use ado.net 1.0?




William (Bill) Vaughn wrote:
> No problem. ADO.NET 2.0 exposes the SqlBulkCopy method that does what DTS
> does...
> hth
>
> --
> ____________________________________
> William (Bill) Vaughn
> Author, Mentor, Consultant
> Microsoft MVP
> INETA Speaker
> www.betav.com/blog/billva
> www.betav.com
> Please reply only to the newsgroup so that others can benefit.
> This posting is provided "AS IS" with no warranties, and confers no rights.
> __________________________________
> Visit www.hitchhikerguides.net to get more information on my latest book:
> Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
> and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
> -----------------------------------------------------------------------------------------------------------------------
>
> <kkizer@gmail.com> wrote in message
> news:1167777897.160161.96810@i12g2000cwa.googlegroups.com...
> >I need help! Here is what i have going. I have a cobal database that i
> > connect with using a DSN/ODBC (the source data) and i have a Sql 2000
> > database that i am trying to copy the data to. I have a DTS package
> > setup doing this task just fine but i need to do this process using
> > ado.net/vb.net, not using DTS (dont ask why, long story). I have been
> > searching around places and just cant find any good code examples to
> > help me get started. Can anyone helP?
> >
> > I already have the tables setup in sql server and they are identical to
> > the Cobal database.
> >


  Reply With Quote
Old 04-01-2007, 07:49 PM   #5
William \(Bill\) Vaughn
Guest
 
Posts: n/a
Default Re: Copy a database table into another using ado.net

Yes, right. 1.1. You can still call BCP via SQLDMO API calls.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
-----------------------------------------------------------------------------------------------------------------------

"ep3hatchsi" <kkizer@gmail.com> wrote in message
news:1167861046.777280.222770@q40g2000cwq.googlegroups.com...
>I am using visual studios 2003. does that not use ado.net 1.0?
>
>
>
>
> William (Bill) Vaughn wrote:
>> No problem. ADO.NET 2.0 exposes the SqlBulkCopy method that does what DTS
>> does...
>> hth
>>
>> --
>> ____________________________________
>> William (Bill) Vaughn
>> Author, Mentor, Consultant
>> Microsoft MVP
>> INETA Speaker
>> www.betav.com/blog/billva
>> www.betav.com
>> Please reply only to the newsgroup so that others can benefit.
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>> __________________________________
>> Visit www.hitchhikerguides.net to get more information on my latest book:
>> Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
>> and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
>> -----------------------------------------------------------------------------------------------------------------------
>>
>> <kkizer@gmail.com> wrote in message
>> news:1167777897.160161.96810@i12g2000cwa.googlegroups.com...
>> >I need help! Here is what i have going. I have a cobal database that i
>> > connect with using a DSN/ODBC (the source data) and i have a Sql 2000
>> > database that i am trying to copy the data to. I have a DTS package
>> > setup doing this task just fine but i need to do this process using
>> > ado.net/vb.net, not using DTS (dont ask why, long story). I have been
>> > searching around places and just cant find any good code examples to
>> > help me get started. Can anyone helP?
>> >
>> > I already have the tables setup in sql server and they are identical to
>> > the Cobal database.
>> >

>



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off