Thursday 13 December 2007

Cannot chnage DataType of a column once it has data.

Well, someone else has mistakenly set a field on a Dataset to a string. Thought it would be simple to change to int, but the visual tools don't seem to allow it. You will find you cannot do this in the designer. The way around it is to insert a new column with any name you like. Then delete the column you want to rename, then rename the new column you added. Make sure you refresh the SQL as well, as deleting the column removes the column source from the command object select commands.

Also, have you notice the issue with the .Designer.cs file go missing from your project. I find that when I change the connection modifier on one of my table adapters, the .Designer.cs file disappears upon saver. If I then go an make a few more connection modifier changes to 2 more table adapters and then save, it reappears. The data design tools have been buggy as long as I can remember them, even from beta. Time to move to and ORM mapper I think.

No comments: