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 / .NET Framework / ADO.NET / May 2005

Tip: Looking for answers? Try searching our database.

DataSet constraints

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Glenn Thimmes - 30 May 2005 16:57 GMT
Hello,

I am having a problem inserting into a dataset that is loaded from a view
that does joins with other tables and includes required fields from those
tables. For example, I might have a view that is an Orders view which does a
join to a Contact table and contains the contact's last name (required
field). Now, when I do an insert, I only want to insert the information
pertaining to the Order, which is then sent back to the business object and
processed with stored procedures.

The problem is, when I create a new row, add the order information, and try
to add the row into my table, I get an error saying that column 'Last' does
not allow nulls. This is not desirable. I would like to send only necessary
information, like the ContactID, back over the wire. The workaround I have
found for this issue is to manually certain fields to allow DBNulls. This
worked out ok for writing unit tests for my business object, but it is not
an option for production code.

I guess I would like a way to fill a dataset with the table/column schema,
but without any further schema/constraints. My smart client already has a
separate 'screen' schema that defines foreign key and required field
constraints.

Thanks for any suggestions!

-Glenn
Chad Z. Hower aka Kudzu - 31 May 2005 11:30 GMT
> I guess I would like a way to fill a dataset with the table/column
> schema, but without any further schema/constraints. My smart client
> already has a separate 'screen' schema that defines foreign key and
> required field constraints.

You can temporarily disable all the constraints during population.

--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
     "Programming is an art form that fights back"

Blog: http://blogs.atozed.com/kudzu

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.