update the dataset designer

muro

Active member
Joined
Apr 30, 2018
Messages
26
Programming Experience
3-5
One more question dear friends. When updating my table in the sql, how can i update it in the dataset designer without having to delete the table and add it again, because all my queries get removed too and i have to recreate them all again. It is a lot of work when i have bigger tables with more Queries. And another big problem is, that i have to go to each form delete the bindingsource and add it again.
Unbenannt-1.jpg
 
Last edited by a moderator:

muro

Active member
Joined
Apr 30, 2018
Messages
26
Programming Experience
3-5
Yes i am doing the update in the Date Source window but nothing happens. I have to delete the table and run the update again then everything is updated. It seems like Microsoft does not care much about the Dataset designer, nothing changed for a few years now.
 

jmcilhinney

C# Forum Moderator
Staff member
Joined
Apr 23, 2011
Messages
2,351
Location
Sydney, Australia
Programming Experience
10+
Yes i am doing the update in the Date Source window but nothing happens. I have to delete the table and run the update again then everything is updated.
I don't know what to tell you. It has always worked for me. As is always the case, when something doesn't work, you should isolate just that in a test project and see whether it works there, to determine whether the issue is with your project or that specific functionality. Try a new project with a simple database with one table and one column. If that works, try a copy of your current database. Don;t just sit on your hands. There's plenty that you can do for yourself.
It seems like Microsoft does not care much about the Dataset designer, nothing changed for a few years now.
That's mainly because Entity Framework is the data access technology that Microsoft would like to see everyone use. That said, what exactly do you think should change?
 

muro

Active member
Joined
Apr 30, 2018
Messages
26
Programming Experience
3-5
Thats strange. I have literally tried everything over the years, when working with DataSet and Tableadapters but i can´t find a proper way to update the tables on my Dataset designer, to fit the sql tables. Only by removing the table from the DataSource and running the Update wizzard it works for me. Of course then all queries are also removed and i have to go to each Form and remove the old bindingsource/tableadapter and add it again.
Thank you. By changes i mean when changing the datatype of a coloumn. When adding a new coloumn to the table and running the update in the dataset it works fine.
 
Last edited:

JohnH

C# Forum Moderator
Staff member
Joined
Apr 23, 2011
Messages
534
Location
Norway
Programming Experience
10+
When you open data source wizard after database has changed only the previous fields is selected, you have to reselect all fields. This is how it looks in VS 2019:
partially.png

By changes i mean when changing the datatype of a coloumn.
I see that problem also, a solution is to deselect that field first and then add it back.
 
Last edited:

jmcilhinney

C# Forum Moderator
Staff member
Joined
Apr 23, 2011
Messages
2,351
Location
Sydney, Australia
Programming Experience
10+
When you open data source wizard after database has changed only the previous fields is selected, you have to reselect all fields. This is how it looks in VS 2019:
View attachment 592

I see that problem also, a solution is to deselect that field first and then add it back.
It's so long since I used a typed DataSet in anger and I don;t recall that being the case, even now that you say so. I can accept that that is almost certainly the fault of my memory though.
 

muro

Active member
Joined
Apr 30, 2018
Messages
26
Programming Experience
3-5
Thanks friends. It works when deselecting and selecting the column again, but unfourtonately the row is added at very end of the table in the Dataset. I think there is no way around it, to go to the Dataset designer and search for specific code to change the coloumn order.
 
Last edited:

jmcilhinney

C# Forum Moderator
Staff member
Joined
Apr 23, 2011
Messages
2,351
Location
Sydney, Australia
Programming Experience
10+
Did you try dragging and dropping that column in the designer? It is a designer, after all. I'm not 100% sure that that would work but it's the first thing I'd try. Apart from that, does the order in the DataTablereally matter anyway? You can still display them in any order you want.
 

muro

Active member
Joined
Apr 30, 2018
Messages
26
Programming Experience
3-5
Unfortounately the drag drop doesn not work. You are right it does not matter but i just wanted it to be similar to the sql table.
 
Top Bottom