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 / January 2006

Tip: Looking for answers? Try searching our database.

Trouble with DefaultValue on Typed DataSet

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Harry Keck - 03 Jan 2006 20:21 GMT
Using the Visual Studio designer, I can easily create a typed dataset. It is
possible to set default values for table columns by setting the default in
the designer.  I can do this easily for boolean and integer types, but if I
have a string field and I want to set the default to "", I can not find a way
to do this.  If I go into the auto generated cs file and make the change, it
gets wiped out if I ever make any other changes in the designer.  Is there a
way to set the DefaultValue of a string column to be empty string for typed
datasets created using the Visual Studio designer?  Thank you.
Cowboy (Gregory A. Beamer) - MVP - 05 Jan 2006 17:26 GMT
Think this through for a second. A strongly typed dataset is an XSD file (a
type of XML). How does it represent an empty string? How does it represent a
null value? Starting to see the issue?

As this is pure XML text, '' and NULL are equivalent. If you allow nulls,
setting a '' default is the same as no default. If you do not allow nulls,
you are saying "set the default to null (empty string)".

BTW, this is a limitation of XML, not .NET. You have to figure out another
creative way to solve this issue.

Signature

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************

> Using the Visual Studio designer, I can easily create a typed dataset. It is
> possible to set default values for table columns by setting the default in
[quoted text clipped - 4 lines]
> way to set the DefaultValue of a string column to be empty string for typed
> datasets created using the Visual Studio designer?  Thank you.

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.