Results 1 to 4 of 4

Thread: Database changes not shown in dataset.xsd correctly

  1. #1
    .NET Framework
    .NET 4.0
    Join Date
    Apr 2018
    Posts
    8
    Rep Power
    0

    Database changes not shown in dataset.xsd correctly

    Dear friends,

    when i change things in my sql database, for example i add a new column, delete one, change datatype of a column and stuff like that and then update my dataset with the wizard the changes are not shown correctly. Some things are updated correctly some not and only if i delete the datatable from the dataset.xsd and add it again (with the datasource update wizard) it is shown correctly. The problem is i have added so many queries on my datatable in the dataset xsd , and then i need to write them all manualy again since they are also deleted with the table. so how to update the dataset.xsd and apply all new changes from database, correctly, so it matches the table in the database?

    I tested entitiy framework and the changes from the db are shown correctly in the enitity model, but i dont want to use entitiy since there are alof of things i don´t know.

  2. #2
    .NET Framework
    .NET 4.5
    Join Date
    Apr 2011
    Posts
    1,979
    Rep Power
    154
    Your question is far too vague. It basically reads "I do something and it doesn't work, how do I fix it". One thing I can tell you is that anything you delete from the database will not be automatically deleted from the DataSet because the IDE doesn't want to delete something that you added manually and it can't distinguish the two. If you made lots of changes at the same time then maybe that caused some confusion but, with such a vague description, we can only speculate. Rerunning the wizard from the Data Sources window SHOULD update the DataSet correctly so that's all we can really direct you to do without a better description of what was actually done and what actually happened.

    If you are making lots of changes then perhaps updating the DataSet in stages as you go might guard against issues like this but, again, that's only speculation. Maybe you could restore a backup so you're back to your old state and then try again in stages.

  3. #3
    .NET Framework
    .NET 4.0
    Join Date
    Apr 2018
    Posts
    8
    Rep Power
    0
    Thank you sir. It is just that the dataset.xsd doesn´t show the database correctly. new columns or new tables in the database are detected and added to the table in the dataset.xsd correctly, but not when i change the datatype of a column or for eaxmple when i change the nvchar(10) to nvchar(50). i have rebuild the project many times and used the update wizard of the datasource, nothing happening.

    i guess the only way to solve this, is to delete the table from the dataset.xsd and run the update wizard again, then everything is fine and correct.

  4. #4
    .NET Framework
    .NET 4.5
    Join Date
    Apr 2011
    Posts
    1,979
    Rep Power
    154
    Quote Originally Posted by muro View Post
    i guess the only way to solve this, is to delete the table from the dataset.xsd and run the update wizard again, then everything is fine and correct.
    Or delete the column from the table and then run the wizard again. You just said that new columns are added correctly so that should just be treated as a new column. The alternative would be to simply change the data type in the DataSet yourself. Much less work than adding in multiple custom queries again.

    As I said, the wizard won't remove deleted tables and columns automatically because it can't distinguish between what was added automatically and then deleted from the database and what you added manually. I'm guessing that changes in data type are treated the same way.

Similar Threads

  1. Create Dataset from Dataset
    By ssabc in forum LINQ
    Replies: 12
    Last Post: 06-29-2018, 5:28 PM
  2. Question Why are programmatically added controls not shown?
    By Kaskorian in forum Windows Forms
    Replies: 0
    Last Post: 05-30-2018, 6:48 PM
  3. The Designer could not be shown (error CS0234 I think)
    By Hitoruna in forum C# General Discussion
    Replies: 5
    Last Post: 12-07-2017, 10:07 PM
  4. Connection to the database with dataset
    By ammar.dev in forum Database General Discussion
    Replies: 4
    Last Post: 09-21-2015, 10:44 AM
  5. Searching a database/dataset
    By DoJa in forum Database General Discussion
    Replies: 5
    Last Post: 10-16-2014, 9:30 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •