Groups | Blog | Home
all groups > dotnet ado.net > february 2004 >

dotnet ado.net : Refreshing a referenced dataset


David D. McCrory
2/16/2004 5:10:13 PM
I have a typed dataset that was created from a referenced dataset. I have
made changes to the XSD file and want to propegate the changes to my typed
dataset. I have tried deleting the typed dataset and then adding it back,
but it still has the old structure. Can someone help me with this?

Miha Markic [MVP C#]
2/17/2004 8:51:58 AM
Hi David,

Did you try right click on xsd file in solution explorer and select Run
Custom Tool?
Also, the changes are propagated when you save xsd file.
If this isn't working, check what is the Custom Tool for the selected xsd
file - it should be MSDataSetGenerator.

--
Miha Markic [MVP C#] - RightHand .NET consulting & software development
miha at rthand com
www.rthand.com

[quoted text, click to view]

David D. McCrory
2/17/2004 7:35:16 PM
I tried running the Custom Tool for the XSD file, which is
MSDataSetGenerator, and did not get any results...the Build Action property
is set to Content. Should it be set to something else??


[quoted text, click to view]

Miha Markic [MVP C#]
2/18/2004 8:42:24 AM
Hi David,

Set "Show All files" in solution explorer (icon in solution explorer's
toolbar) so you'll be able to see the code produced.
XSD leaf in solution explorer should turn into a node. Under this node
should be a file with same name and extension cs (if project is c#).
Check its content.
Just for test, you might delete its content (not the file itself) and run
custom tool again to see if it produces anything.

--
Miha Markic [MVP C#] - RightHand .NET consulting & software development
miha at rthand com
www.rthand.com

[quoted text, click to view]

David D. McCrory
2/18/2004 9:34:01 AM
Everything looks ok in the *.cs file....the "GetUserLogin" table that is
shown below, from the dsUserData.cs file, is the one that is not showing up
in the referenced DataSet....Even if I delete the DataSet and re-create
it...the table below is not a part of the DataSet....could it be cached
somewhere else??

protected dsUserData(SerializationInfo info, StreamingContext context) {
string strSchema = ((string)(info.GetValue("XmlSchema", typeof(string))));
if ((strSchema != null)) {
DataSet ds = new DataSet();
ds.ReadXmlSchema(new XmlTextReader(new System.IO.StringReader(strSchema)));
if ((ds.Tables["GetUserAddress"] != null)) {
this.Tables.Add(new GetUserAddressDataTable(ds.Tables["GetUserAddress"]));
}
if ((ds.Tables["GetUserInfo"] != null)) {
this.Tables.Add(new GetUserInfoDataTable(ds.Tables["GetUserInfo"]));
}
if ((ds.Tables["GetUserLogin"] != null))
{
<----------------This table is not in the referenced DataSet.
this.Tables.Add(new GetUserLoginDataTable(ds.Tables["GetUserLogin"]));
}




[quoted text, click to view]

David D. McCrory
2/18/2004 9:42:18 AM
Thanks for the help Miha....

I finally got this resolved. I had to delete and re-install my references to
the projects that contained the XSD. I don't know if this is what should
happen or if the references should update automatically. I tried rebuilding
the solution several times and it never worked until I deleted and
re-installed the references.

Any light on this subject would be appreciated. I know how to correct the
issue, but I don't understand why...


[quoted text, click to view]

AddThis Social Bookmark Button