Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / January 2008

Tip: Looking for answers? Try searching our database.

use DataAdpater fill datatable couple times for many columns

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ryan Liu - 31 Jan 2008 07:43 GMT
Hi,

If I have a very big view in database, it covers 15 tables, each table has
1000 columns.

When I issue select * from view, the database will give error -- too many
columns.

Can I use a DataAdapter fill DataTable couple times? For example, I only
read 5000 columns from the view each time and I read 3 times. It has an id
column as primary key to help locate the row.

How to write a DataAdapter to fill DataTable 3 times? What is the most
efficient way to do this?

Thanks a lot!

~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.

 Ryan Liu
 Shanghai Fengpu Software Co. Ltd
 Shanghai , China

 http://www.PowerCATI.com  Powerful CATI!
 http://www.fpsoft.net.cn
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.
Alberto Poblacion - 31 Jan 2008 08:02 GMT
> If I have a very big view in database, it covers 15 tables, each table has
> 1000 columns.
[quoted text clipped - 8 lines]
> How to write a DataAdapter to fill DataTable 3 times? What is the most
> efficient way to do this?

  If you try to use a DataAdapter to fill the table three times, it will
attempt to add additional rows to the DataTable, rather than adding new
columns to the existing rows.
  Instead of the DataAdapter, use a DataReader. Loop through the rows
returned by the datareader and add their data into the additional columns in
the datatable. You will have to create the columns beforehand in the table
(you can also do this with a looping construct). These loops take more work
to program than just using a DataAdapter, but they are equally efficient,
since it is what the dataadapter does internally anyway.
Ryan Liu - 31 Jan 2008 16:03 GMT
>> If I have a very big view in database, it covers 15 tables, each table
>> has 1000 columns.
[quoted text clipped - 18 lines]
> more work to program than just using a DataAdapter, but they are equally
> efficient, since it is what the dataadapter does internally anyway.

Then what about I use a few DataAdapter fill  a few DataTalbe and then merge
DataTables?

Thanks!
Alberto Poblacion - 31 Jan 2008 19:18 GMT
> Then what about I use a few DataAdapter fill  a few DataTalbe and then
> merge DataTables?

   I have not tried it out, but from the documentation of the Merge method
it appears that it may work, as long as you use the overload of Merge that
takes a MissingSchemaAction parameter and you specify the value
MissingSchemaAction.Add.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.