James_Steven

I created an application and added a dataset from a MSSQL database using the wizard. I also added some custom queries to the tables. Now theres two reasons why i want this dataset to be recreated:

1) The dataset designer stopped working, whining something about query string - i did modify the settings file, but i'm fairly sure i changed the query string back to the exact same as before, but it's still isn't working. My application works fine and have no problem accessing the database so i don't understand why the IDE can't.

2) I have done some changes to the MSSQL database (added some table fields). I want all changes to be reflected in the Dataset i have in visual studio.

So i assume the easiest would be to just delete and readd the dataset with using same name. But the problem is that i want all my custom queries

Are there any simple way of just "recreating/refreshing" the dataset



Re: Visual C# IDE Recreate dataset, without loosing custom queries?

BabyFace Jay

Please try the following steps to see if your dataset is being refreshed:

  1. Open the Data Sources window.
  2. Left click on your dataset in the Data Source window.
  3. Click the Configure Dataset with Wizard icon on top of this window.
  4. A dialog box with two options 'Edit in Dataset Designer' and 'Continue with Wizard' might appear, click 'Continue with Wizard'.
  5. Next, you should be able to see the Tables and Views inside the database. Those fields with a tick would be the newly added fields. Check those that you want and click finish.

Your dataset should be refreshed by then.





Re: Visual C# IDE Recreate dataset, without loosing custom queries?

James_Steven

Thanks for your reply. That will probably fix problem number two, but i'm still having problem with editing dataset in designer.

Apperantly the problem is that i removed the automaticly generated connection string from the settings and created a new custom string in settings that my application uses. But the dataset designer in Visual Studio still wants to use the setting it generated, and i can't seem to find how to change it. I even tried to follow the steps you wrote, and at the start adding a new connection string, but it's still whining about the old string.

I even tried to edit all instances of my old connection string setting in ..dataset.Designer.cs, and replace them with the new setting, but when building the project it just changes them back to original!

Does anyone know how i can make the dataset use a different connection string





Re: Visual C# IDE Recreate dataset, without loosing custom queries?

BabyFace Jay

This thread might provide a solution.

http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=884128&SiteID=1





Re: Visual C# IDE Recreate dataset, without loosing custom queries?

James_Steven

It looks like they are talking about runtime query string. As mentioned, i have no problems with my dataset/database in my application - it's only Visual Studio's dataset designer that have a problem.




Re: Visual C# IDE Recreate dataset, without loosing custom queries?

James_Steven

No one else have any suggestions