I have set a condition that if this record is not in database then insert record otherwise update record.
.
.
.
MyScmd3 = New OleDbCommand("select count(*) from PL_Stat where CompanyID=" & Ins_Com & " and PeriodID=" & Ins_Per & " and eYear=" & Ins_Year & "", MyODbC)
MyAdap3 = New OleDbDataAdapter(MyScmd3)
MyDSet3.Clear()
MyAdap3.Fill(MyDSet3)
MyDViw3 = New DataView(MyDSet3.Tables(0))
MyODbC.Open()
If MyDViw3.Count = 0 Then
'MYDViw3 show value 1 even though there is no already same record which i want to save.
'It should show value 0.
.
.
.
.
.
.
.
MyScmd3 = New OleDbCommand("select count(*) from PL_Stat where CompanyID=" & Ins_Com & " and PeriodID=" & Ins_Per & " and eYear=" & Ins_Year & "", MyODbC)
MyAdap3 = New OleDbDataAdapter(MyScmd3)
MyDSet3.Clear()
MyAdap3.Fill(MyDSet3)
MyDViw3 = New DataView(MyDSet3.Tables(0))
MyODbC.Open()
If MyDViw3.Count = 0 Then
'MYDViw3 show value 1 even though there is no already same record which i want to save.
'It should show value 0.
.
.
.
.