Is there easier way to regenerate a dataset in VS.NET?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

Thanks for reviewing my question. I would like to know if there is an easier way to regenerate your dataset in VS.NET when your database schema changes. I am frequently add or remove fields in my database and then on the VS.NET C# windows form side, I delete the dataset, the dataadapeter and the sqlconnection. Deleting just the dataset doesn't work - generating it from the dataadapeter creates a dataset with the old schema. Is there an easier way than deleting those 3 objects?

Many Thanks to the Expert
Peter
 
Hi
What you are using here is what is known as typed dataset . the idea of
the typed dataset depend manly on knowing the realational structure of the
database beforehand ( at design time). this way you can simply refer to the
table by there name . If you are using that then by design you have to
change that at design every time you change your database schema.
Whoever , if you are using normal dataset ( typed is a subset , they
inherit form l dataset class ) you can simply use the InferXmlSchema()
function with load the schema of the dataset from an xml file . Although
this association happens at runtime, still you have to change that file
every time you change your database. Anther thing you can do however, is to
work with dataset without worrying about the schema, this can also be done
so it wouldn't matter what structure your database has.
hope that helps
Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC
 
Back
Top