Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 26th, 2004, 08:35 AM
Authorized User
 
Join Date: May 2004
Location: London, , United Kingdom.
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
Reply With Quote
  #2 (permalink)  
Old May 26th, 2004, 09:32 AM
Friend of Wrox
Points: 3,489, Level: 24
Points: 3,489, Level: 24 Points: 3,489, Level: 24 Points: 3,489, Level: 24
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Central, NJ, USA.
Posts: 1,102
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
Reply With Quote
  #3 (permalink)  
Old May 26th, 2004, 10:46 AM
Friend of Wrox
Points: 3,558, Level: 25
Points: 3,558, Level: 25 Points: 3,558, Level: 25 Points: 3,558, Level: 25
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: California, USA
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.
Reply With Quote
  #4 (permalink)  
Old June 2nd, 2004, 03:19 AM
Authorized User
 
Join Date: May 2004
Location: London, , United Kingdom.
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
Reply With Quote
  #5 (permalink)  
Old June 2nd, 2004, 03:20 AM
Authorized User
 
Join Date: May 2004
Location: London, , United Kingdom.
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
Reply With Quote
  #6 (permalink)  
Old June 2nd, 2004, 04:47 AM
Friend of Wrox
Points: 3,558, Level: 25
Points: 3,558, Level: 25 Points: 3,558, Level: 25 Points: 3,558, Level: 25
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: California, USA
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.
Reply With Quote
  #7 (permalink)  
Old June 2nd, 2004, 05:36 AM
Authorized User
 
Join Date: May 2004
Location: London, , United Kingdom.
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
Reply With Quote
  #8 (permalink)  
Old June 2nd, 2004, 08:51 AM
Friend of Wrox
Points: 3,489, Level: 24
Points: 3,489, Level: 24 Points: 3,489, Level: 24 Points: 3,489, Level: 24
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Central, NJ, USA.
Posts: 1,102
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
Reply With Quote
  #9 (permalink)  
Old June 3rd, 2004, 08:31 AM
Authorized User
 
Join Date: May 2004
Location: London, , United Kingdom.
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
Reply With Quote
  #10 (permalink)  
Old June 3rd, 2004, 09:11 AM
Friend of Wrox
Points: 3,489, Level: 24
Points: 3,489, Level: 24 Points: 3,489, Level: 24 Points: 3,489, Level: 24
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Central, NJ, USA.
Posts: 1,102
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 04:38 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.