Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > way to avoid re-configuring all adapters in a project after adding field to table?

Reply
Thread Tools

way to avoid re-configuring all adapters in a project after adding field to table?

 
 
Bennett Haselton
Guest
Posts: n/a
 
      10-21-2004
It seems whenever I add a new field to a database table that's queried
by DataAdapters in my project, I get run-time errors because I don't
go back and re-generate all the DataAdapters to read the new field.

When I first generate the DataAdapter using the wizard, the list of
fields in the database table gets hard-coded into the SelectCommand:

SELECT ID, username, password_hash, email_address, datetime_created
FROM wbuser

and if I use that adapter to auto-generate a typed DataSet, that list
of fields will be entered into the typed DataSet as well as the
"wbuser" DataTable object. The problem occurs when I add another
field to a database table, and then on some other WebForm I create a
new DataAdapter for the "wbuser" table, and use it to re-generate the
"wbuser" DataTable in the typed DataSet. Now, that wbuser DataTable
in the typed DataSet is incompatible with all the old adapters that
used the old list of fields. If the newly added field in the table
doesn't allow nulls, for example, then if I try to use the old adapter
to fill the new DataTable, I'll get a run-time error, presumably
because it doesn't know what to put in the missing field.

So is there some magic way to make all the DataAdapters re-configure
themselves at once when I add a new field to a table?

-Bennett
 
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
Supply Telephone Voice Modular Adapters,Telephone Modular Couplers,Modular Duplex Jack,Triplex Adapters,Telephone extension Cord samul888@vip.163.com Cisco 1 11-13-2005 09:23 AM
Supply Telephone Voice Modular Adapters,Telephone Modular Couplers,Modular Duplex Jack,Triplex Adapters,Telephone extension Cord samul888@vip.163.com Computer Support 0 11-12-2005 06:22 AM
Supply Telephone Voice Modular Adapters,Telephone Modular Couplers,Modular Duplex Jack,Triplex Adapters,Telephone extension Cord samul888@vip.163.com VOIP 0 11-12-2005 06:22 AM
Supply Telephone Accessories,Modular Adapters Couplers,Duplex Jack,Triplex Adapters,ADSL Adapters,Plug With RJ12 Jacks samul888@vip.163.com Cisco 0 11-10-2005 07:47 AM



Advertisments