I’ve got a few datatables in an Microsoft SQL database. I get those with an dataadapter and put them into a dataset. After this I want to change a few of the values, like some I want to change to: “Na/Na”. Now the problem in this is, that the normal Type of this column is INT. So it gives me an error.
Is there a way in which I can make sure all the columns get STRING as their type? Or can I make sure the schema of the datatables doesn’t get used, I know I could make all the columns myself in C# and then get the values by an query, but this would be WAY to much work.
You could try cloning the
DataTableand altering the data types of each column, as suggested in this post. (Scroll about half way down for the answer).The other alternative is to change (or create a) stored procedure that gets your data and make that pass back the correct “Na/Na” type values you want.