Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
|
ADO.NET For discussion about ADO.NET.  Topics such as question regarding the System.Data namespace are appropriate.  Questions specific to a particular application should be posted in a forum specific to the application .
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ADO.NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 26th, 2004, 08:35 AM
Authorized User
 
Join Date: May 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to jitu
Default Creating & Populating Tables

Hi

I will be grateful for any help. I am trying to create and populate a table from a dataset.

I am writing a basic reporting tool which loads data from a Sybase Database into a Dataset (done) then I would like to take that data and create and populate a table on a SQL Sever Database.

The Datatypes etc. are not really important.

Thank you in advance

Jitu Tivari
__________________
Jitu Tivari
 
Old May 26th, 2004, 09:32 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,101
Thanks: 0
Thanked 2 Times in 2 Posts
Default

I'd use a DTS package in SQL server to do something like that

Hal Levy
Web Developer, PDI Inc.

NOT a Wiley/Wrox Employee
 
Old May 26th, 2004, 10:46 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

Check [u]Priview DataSet</u> if u get data at disign time?!
Then Check ur Command not at run time!
Do u feel ur DataSet?! Does it give any error?!

Always:),
Hovik Melkomian.
 
Old June 2nd, 2004, 03:19 AM
Authorized User
 
Join Date: May 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to jitu
Default

Hi

Thank you for replying my topic. I would like to automate this process as much as possible so that the users do not are not required to use DTS from MSSQL. is there a way you can automate a DTS package? for example the select stateent will very from statement to statement and the target table names will also change.

thanks

Jitu

Jitu Tivari
 
Old June 2nd, 2004, 03:20 AM
Authorized User
 
Join Date: May 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to jitu
Default

Sorry Hovik i have no idea what you are talking about.

but thank you for responding.

Jitu Tivari
 
Old June 2nd, 2004, 04:47 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

Sorry I guess I had some typing problem!
Check [u]Priview Data</u> (right click on Adapter) do u get data at disign time?!
Then Check ur Select Command (T-SQL i mean: the command that u run frm Server)
Do u fill ur DataSet?! Does it give any error?!

Quote:
quote:Originally posted by melvik
 Check [u]Priview DataSet</u> if u get data at disign time?!
Then Check ur Command not at run time!
Do u feel ur DataSet?! Does it give any error?!
Always:),
Hovik Melkomian.
 
Old June 2nd, 2004, 05:36 AM
Authorized User
 
Join Date: May 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to jitu
Default

Hi

I have no problems connecting to Sybase and populating a DataSet i.e. obDataSetTab1.

I would then like to create a table on MSSQL database and then populate it from obDataSetTab1 dataset.

this is where I cannot find the data. I am now looking into writing a wizard using DTS to copy the table from Sybase to MSSQL using a Select Statement.

thank you for your help.


Jitu Tivari
 
Old June 2nd, 2004, 08:51 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,101
Thanks: 0
Thanked 2 Times in 2 Posts
Default

OK- lets start over.. What is it your trying to do.. what's the point of the system your writing.. From what you have said, I see no reason to create a dataset from Sybase and then write that same dataset out to SQL server.

So- what's the business problem your trying to solve?


Hal Levy
Web Developer, PDI Inc.

NOT a Wiley/Wrox Employee
 
Old June 3rd, 2004, 08:31 AM
Authorized User
 
Join Date: May 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to jitu
Default

Hi,

Thank you for your reply.

After reading through many websites I have discovered that the best way to approach the issue is to use DTS from a VB.NET application. Here is a quick summary of what i need to do:

Create an User friendly application to extract data from two different Sybase Databases and export the data into MSSQL and compare the two tables. After generate a report of the differences found.

The user should only provide the data for the two source databases and the SQL statement to extract the data.

Here is some more information:



1) Extract data from Sybase using a select statement from two different Sybase Databases i.e. TEST_1 and TEST_2 using SQL (select * from tblAccounting) and copy them into two tables (i.e. test_1_tblAccounting and test_2_tblAccounting) in a MSSQL Server Database. The tables will also need to be created in MSSQL on the fly as the select statements can be different.

2) once both of the MSSQL tables have been populated with the data, i would like to compare the results between the two tables. for example both tables should have the same invoice numbers, order no., description, amounts, etc. if they are not two things must happen

     a) insert only the invoice number in table that does not have the invoice number.
     b) after (a) create another reporting table with the rows that are different i.e. amount, orderid, etc. along with this data we will need to add another column with the test_1_tblAccounting or test_2_tblAccounting information.

This will allow us to compare both the rows from the different tables in one table.

Then i will be able to write a HTML page to display this data.

I hope the above helps.

thanks


Jitu Tivari
 
Old June 3rd, 2004, 09:11 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,101
Thanks: 0
Thanked 2 Times in 2 Posts
Default

There is no reason to get SQL server involved with this proccess at all. Your making this much harder than you need to.

Load two datasets into .NET. Compare the datasets. Update the datasets as required.. write them back to the Sybase databases.

Then, you can update a table in SQL or Sybase with a list of the non-matching records.





Hal Levy
Web Developer, PDI Inc.

NOT a Wiley/Wrox Employee





Similar Threads
Thread Thread Starter Forum Replies Last Post
creating tables within tables in access??? carswelljr Access 3 August 23rd, 2006 01:21 PM
Creating/Populating Recordsets in ADO dgulliver VB How-To 3 May 24th, 2006 03:31 AM
Help creating tables racin_vegas PHP How-To 1 January 19th, 2006 09:11 AM
Populating database tables mespejo Beginning PHP 9 November 30th, 2004 11:02 AM
sql & join tables & find a field in multiple table trangd Beginning PHP 2 January 29th, 2004 07:18 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.