Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Newbie question: Fill dataset will ALL tables from database

Reply
Thread Tools

Newbie question: Fill dataset will ALL tables from database

 
 
Pierre van Rooyen
Guest
Posts: n/a
 
      05-20-2004
I am a C# developer in ADO.NET and need assistance with a – I assume –
simple question:

How do I get all the data from a database in a dataset? I want to be
able to open any kind of ODBC database and thus do not have any
knowledge of the names of the tables or fields contained in the
database. I could after a day of searching on the Internet not find
ONE example where you don't have to specify which tables you want your
dataset to be populated with.

Thanks in advance
 
Reply With Quote
 
 
 
 
=?Utf-8?B?TWFyaw==?=
Guest
Posts: n/a
 
      05-20-2004
select * from all_tables is the correct Oracle syntax, I'm not sure if this will work on SQL Server or Access.

Keep in mind that multiple DataTable's are not designed to hold a whole database. There is absolutly no logical reason why you should have to put a whole database in a DataSet.You should change your approach, you'll be loading potentially millions of records into memory. Besides, ADO is designed to hold no more than 500 records, I'm not sure if it will hold much more than that

Good luc
Mark
 
Reply With Quote
 
 
 
 
--CELKO--
Guest
Posts: n/a
 
      05-21-2004
>> I want to be able to open any kind of ODBC database and thus do
not have any knowledge of the names of the tables or fields [sic]
contained in the database. <<

You can get to the schema information tables and read them, since they
have standardized names and structures, then you use them to discover
the stuff in the database. It is insanely complicated. The best
answer is that you actually should know what you are doing before you
do it.
 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      05-21-2004
Hi Piere,

You should write a SQL statement to investigate all the tables in your
database.
and execute that with a command.executeQuery

And than make a select for every table.

There is not a SQL statement.
Select * from * as far as I know.
However my knowledge of SQL is fair, because I hate it.

Than I think you can even do when you set the names in a table
\\\
For i as integer = 0 to myTalblenameArray.length - 1
dataadatper.fill(dataset, myTablenameArray(i))
next
///
I hope this helps?

Cor



 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DataBase DataBase DataBase DataBase scott93727@gmail.com Computer Information 0 09-26-2012 09:40 AM
Gridview. Fill dataset with various tables shapper ASP .Net 1 09-19-2007 08:17 AM
How to get database metadata information (i.e. existing tables and columns in tables) Chris Brat Python 5 08-22-2006 05:25 PM
Fill Dataset with two tables Laura K ASP .Net 6 03-03-2006 05:53 AM
Newbie Question: fill a dataset with results from web service call Todd ASP .Net Web Services 4 01-09-2004 05:57 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57