Add Column to Database
Posted on 2014-04-01
I have a Visual Basic .Net Winforms project which has a database with a table and somehow it uses SQL Compact 3.5. The form has:
I want to add a column to the table in the database so I can store another piece of information.
I would like to deploy a new version of the program, and the program will update the user's existing *.sdf database file and add a new column to it.
Can't figure out how to do that from Visual Basic VB.Net
I have added the column to my DataSet1.xsd
and I added the column to Server Explorer > Data Connections > Tables > mytable > Columns
Program runs fine, uses default value for the new column, updates file *.sdf database file with other information. But the database file itself still doesn't have the new column added to it. That's the part I need to figure out a way to do.
Somehow I need to get my VB.Net program to issue a "SQL ALTER table ADD newcolumn" statement to add a column to the database file.