Data Adapter and Databinding navigator
Hi,
I have this binding navigator control on a form. What I want to achieve is to have the functionality of delete, insert and update and when the user clicks the final button everything should be saved to the actual database not the Dataset, somehow it is not working.
It is my first day after 2 and half weeks of sickness and i can't really get my mind on it. Here is the code:
Dim varCheckAs Int16
Dim myDataSetAsNew DataSet
Dim myDataAdapterAsNew SqlClient.SqlDataAdapter
PrivateSub frmAddition_Load(ByVal senderAs System.Object,ByVal eAs System.EventArgs)HandlesMyBase.Load
'TODO: This line of code loads data into the 'PamsDataSet.tbl_city' table. You can move, or remove it, as needed.
Me.Tbl_cityTableAdapter.Fill(Me.PamsDataSet.tbl_city)
'TODO: This line of code loads data into the 'PamsDataSet.tbl_agent' table. You can move, or remove it, as needed.
Me.Tbl_agentTableAdapter.Fill(Me.PamsDataSet.tbl_agent)
'TODO: This line of code loads data into the 'PamsDataSet.tbl_rsl' table. You can move, or remove it, as needed.
Me.Tbl_rslTableAdapter.Fill(Me.PamsDataSet.tbl_rsl)
EndSub
PrivateSub BindingNavigatorDeleteItem_Click(ByVal senderAs System.Object,ByVal eAs System.EventArgs)Handles BindingNavigatorDeleteItem.Click
varCheck = MsgBox("This record will be deleted from the Database, Are you sure?", MsgBoxStyle.OkCancel,"Delete Confirmation Dialog")
If varCheck = 1Then
Dim CurRowAs pamsDataSet.tbl_rslRow
CurRow = PamsDataSet.tbl_rsl.Rows(1)
PamsDataSet.tbl_rsl.Removetbl_rslRow(CurRow)
EndIf
EndSub
PrivateSub BindingNavigatorAddNewItem_Click(ByVal senderAs System.Object,ByVal eAs System.EventArgs)Handles BindingNavigatorAddNewItem.Click
EndSub
PrivateSub ToolStripButton1_Click(ByVal senderAs System.Object,ByVal eAs System.EventArgs)Handles ToolStripButton1.Click
'MsgBox("You're saving your value, click yes")
'Tbl_rslTableAdapter = PamsDataSet.tbl_rsl.GetChanges()
'myDataAdapter.Update(Ntbl_rsl, "tbl_rsl")
EndSub
Any help would be great as i'm really exhausted.
Thanks

