Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Editing a Record
Message
De
18/03/2005 20:04:35
 
 
À
18/03/2005 04:47:53
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Divers
Thread ID:
00997113
Message ID:
00997524
Vues:
10
This message has been marked as a message which has helped to the initial question of the thread.
Martin,

You need to look at using .xsd for your DataSets. Try doing a DataSet.WriteXmlSchema("MyDataSet.xsd") to see what the .xsd files look like. Add the .xsd file to your project and use them as your DataSet. Your schema will always be defined. I've probably not explained this very well, but maybe you can check out the "Creating XML Schemas and DataSets" in the VS help.

~~Bonnie




>Kevin,
>
>I found out what was causing the problem. Somewhere on the earlier part of the program I have the following code:
>
>If Not ds.Tables.Contains("Users") Then daUsers.FillSchema(ds,
> SchemaType.Source, "Users")
>
>Reason for this code is to populate the data set with a schema of the table so that I can make references to it without having to fill it.
>
>No why would I want to do that? I have a routine which I use to fill the data set. This is the same routine called when I want to refresh the data. When I refresh the data I have to CLEAR the data table in the data set before filling it otherwise... I'll have a problem with the data.
>
>Now because I need to refresh the data table before I fill it in, I need to have the data table present so that when the program runs for the first time and the data set is empty... I'd have a table to refer to. However, by issuing the command FillSchema, it sort of made the rows read-only. I mean I can add and delete rows, but I definitely can not update existing rows.
>
>For now I'd instead of trying to create a schema on the data set, I'd probably be better of checking if it is contained in the data set before clearing it.
>
>But if you know of a way I could still create a schema (not manually defining each field ofcours) and be able to perform any action on it, that would be great! I'm sure I'll need it later when I try to create relationships before filling in the data set.
>
>Thanx! a lot 8 )
>
>Martin
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform