Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dataset
Message
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Titre:
Divers
Thread ID:
00866275
Message ID:
00867367
Vues:
22
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
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform