I have figured out how to add a column to an existing database in VB code by using a SQL statement like this:
Code:Dim mycmd As New SqlCommand("ALTER TABLE myTable ADD NewCol int", conMain) conMain.Open() : mycmd.ExecuteNonQuery() : conMain.Close()
But shouldn't I be able to do it via VB code? There is an add column function:
It appears to add the column to the database in memory but I can't get it to update the actual database. I've tried various update commands but nothing works.Code:mydataset.Tables(0).Columns.Add("NewCol", GetType(Integer))


Reply With Quote
