V
Vince
I load a datagrid with the following routine:
Private Sub loadDataGrid()
Dim strSql As String = Globals.RECV_TRANS
Dim cn As SqlCeConnection
cn = New SqlCeConnection( connString )
Dim sqlDA As SqlCeDataAdapter
Dim sqlDS As New DataSet
sqlDA = New SqlCeDataAdapter(strSql, cn)
sqlDA.Fill(sqlDS, "Receipts")
recvGrid.DataSource = sqlDS.Tables("Receipts")
setColumnNames()
recvGrid.Refresh()
End Sub
Then I select a row, and click a delete button on my
form. I go ahead and do the delete from my SQL CE
database. Now I want to reload the datagrid with the new
data. But I can't call the above function, I always get
an Argument Exception.
My Delete routine:
Private Sub Button1_Click_1(ByVal sender As
System.Object, ByVal e As System.EventArgs)
Handles btnDelete.Click
If (MsgBox("Delete Record?", MsgBoxStyle.YesNo)
= MsgBoxResult.No) Then
Exit Sub
End If
If (DeleteRow() = False) Then
MsgBox("Delete Failed")
Exit Sub
End If
loadDataGrid()
End Sub
What am I doing wrong?
Thanks
-Vince
Private Sub loadDataGrid()
Dim strSql As String = Globals.RECV_TRANS
Dim cn As SqlCeConnection
cn = New SqlCeConnection( connString )
Dim sqlDA As SqlCeDataAdapter
Dim sqlDS As New DataSet
sqlDA = New SqlCeDataAdapter(strSql, cn)
sqlDA.Fill(sqlDS, "Receipts")
recvGrid.DataSource = sqlDS.Tables("Receipts")
setColumnNames()
recvGrid.Refresh()
End Sub
Then I select a row, and click a delete button on my
form. I go ahead and do the delete from my SQL CE
database. Now I want to reload the datagrid with the new
data. But I can't call the above function, I always get
an Argument Exception.
My Delete routine:
Private Sub Button1_Click_1(ByVal sender As
System.Object, ByVal e As System.EventArgs)
Handles btnDelete.Click
If (MsgBox("Delete Record?", MsgBoxStyle.YesNo)
= MsgBoxResult.No) Then
Exit Sub
End If
If (DeleteRow() = False) Then
MsgBox("Delete Failed")
Exit Sub
End If
loadDataGrid()
End Sub
What am I doing wrong?
Thanks
-Vince