Bound Datagrid dumb question
Ok, now am I assuming too much with a bound grid. I would expect that when I populate a dataset with an OleDbDataAdapter, then bind it to a datagrid that whenever the database is updated, the application datagrid would reflect the change automatically. Initally, I get the information just fine, however if I add a table while my application is open, the grid does not update. Is there an attribute I need to set? Thanks for your help. Here is my code:
Sub loadMsgGrid()
Dim Message_TABLE_NAME As String = "MessageTable"
'Database conection
Dim cn As New OleDb.OleDbConnection(gc_connect)
CN.Open()
'DataAdapter
Dim DA As New OleDb.OleDbDataAdapter _
("Select id, message,status,filename from Messagetable", CN)
AddHandler DA.RowUpdated, New OleDbRowUpdatedEventHandler(AddressOf DA_RowUpdated)
'Dataset
Dim DS As New DataSet()
' Populate the DataSet with the information from the MessageTable table.
DA.Fill(DS, Message_TABLE_NAME)
DS.Tables(Message_TABLE_NAME).Columns("ID").ColumnMapping = MappingType.Hidden
DS.Tables(Message_TABLE_NAME).Columns("message").ColumnMapping = MappingType.Hidden
' Bind the DataGrid to the Message table in the DataSet. This
' will cause the Message information to display.
MsgGrid.DataSource = DS.Tables(Message_TABLE_NAME)
CN.Close()
End Sub