Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Following one of my previous question, is it possible to modify the connectionstring of a dataadapter at runtime.

What I want to do is to connect to a different database using the same dataadapter

 

Many thanx !

What I don't know keeps me excited...
  • Leaders
Posted
Dataadapters don't have connection strings but you can modify the connection string of a connection object at runtime. You can point the dataadapter whereever you want as far as I know, though for whatever reason I've never had a use-case for connecting one to two different data sources.
--tim
Posted

Thanx

BTW, is it just me or with the dataadapter and the datareader, I can do prettu much all the operations I need.

I mean, all the books I read pointed to the dataset object but I finally ended without using it.

Dataset is useful only when you want to store multiple tables or what ?

What I don't know keeps me excited...
  • *Gurus*
Posted

A DataSet can include multiple tables, as you mentioned, along with relations and key constraints, which are very useful if your database is correctly normalized. DataSets are also incredibly easy to pass between your application's different tiers, from function to function or across a serialized stream. DataReaders are limited to groupings of rows, either from a single table or two or more tables being joined together, and can't be passed around as a DataSet can be. Both the DataSet and the DataReader have their purposes, however the DataSet is used quite a bit more throughout the majority of .NET examples and documentation, primarily since it binds so easily with the DataGrid control.

 

My advice? Use the one that does what you need it to.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...