0
votes

I am asking a similar question, but in a different way. In my test/dev environment, I have a new VS2012 C# .NET 3.5 solution / project web application that hits my local SQL Server 2012 Express instance on my test/dev pc.

The new project is a rewrite of an old project, and the old project was written in VS2008 hitting our production SQL Server 2008 Express instance.

I have copied in the Typed DataSet files (.xsd, .xss, .xsx, .xsc, .Designer.cs, etc) from the old VS2008 project into the new VS2012 project.

I can use these Typed DataSets to interact with my local test db (retrieve, save, update, etc), but need to update them to make them aware of newly created columns in one of the test db tables.

How do I go about doing this? I have read that one way is to double click the .xsd, then right click on a table and click "Configure...". That menu item is disabled. I have created a new Data Connection in Server Explorer to the test db, but that isn't helping as I think there is a disconnect between the Typed DataSets and the db...

One more thing, I also needed to copy from the old project to the new these DataConnection files (.cs and .resx) in order to use the Typed DataSets.

Thx

1
I'm assuming the 2008 project was a web project as well? How about copying the WHOLE 2008 project, opening with the new Visual studio, which forces an upgrade, then strip out the things you don't need? I did this from 2008 to 2013 and I could configure the datasets in my new project. - Jeremy
That may be worth a try. Will get back to you... - Kershaw
so how much of a re-write are you doing? If you are redoing the data access layer, why not move away from typed datasets, and move to something a bit more modern? - Jeremy
I agree, switching to entity framework or something else would be preferable. But, as it often goes, it would take too long and the client wants this yesterday. - Kershaw
I'm afraid you'll have to slog through this one. I don't think typed datasets were used alot to begin with, and now with upgrading woes, there may not be alot of folks out there able to help. You'll have to spend the time to figure it out, or redo a bunch of stuff. It's up to you to determine how much time you spend before considring it a lost effort. - Jeremy

1 Answers

0
votes

I did find resolution last night and today. And that was to manually add the columns into the DataTables themselves on the Typed DataSet surface! Simply right click, add column, give it the same name as the newly added column in the db table, and in properties set the datatype and default value. I also needed to make updates to the DataConnection.cs class adding SqlParameters for the new columns. Also, the sql statements for the select, insert, update, delete operations are kept in a DataConnection.resx file, and I needed to add the new columns in update and select statements.

I will say that, although this implementation of db interaction works, I don't think I would ever use it in a new project.