Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dataset
Message
General information
Forum:
ASP.NET
Category:
ADO.NET
Title:
Miscellaneous
Thread ID:
00866275
Message ID:
00867369
Views:
23
Cathi,

Thanks ... I should've taken the time to look at that before replying to Victoria. I totally forgot about the properties sheet for .xsd's because I never use it. I was half-right anyway. <g>

~~Bonnie



>Victoria and Bonnie,
>
>When you are creating a typed dataset, the default value will not be generated in the schema, you have to add it manually. So when you add a new row to that dataset, and exception is thrown.
>
>To add default values to the schema, open the xsd file of your dataset. (The xsd file is where you drag and drop the table to.) Click the column name which you want to set a default value to. In the properties windows, you'll see the "default" property. You can assign your default value there.
>
>>Victoria,
>>
>>>>You mean that I have to set the fields default values manually?<
>>
>>Yep. The DataTable.Column has a .DefaultValue property that you can set in code. I'm not sure whether or not a default can be set in the DataSet's .xsd or not. I'm guessing that you can't, considering that .NET doesn't generate anything in the .xsd from SQL. Anyone know for sure?
>>
>>~~Bonnie
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform