V
venkat g via .NET 247
(Type your message here)
--------------------------------
From: venkat g
as soon as i click save button in should save the data and form must be refresh
ihave written as
me.refresh
my coding is as follows
If (txtget.Text = "Add") Then
ObjCon.Open()
objAdapt = New OleDbDataAdapter("select * from DB_KEYINFO", ObjCon)
objAdapt.Fill(ds)
ObjDtview = ds.Tables(0).DefaultView
ObjDtview.RowFilter = " [Keyno] = '" & CInt(txtKeyno.Text) & " '"
If (ObjDtview.Count > 0) Then
MsgBox("The Record Is Alreday Exists")
Me.Refresh()
ObjCon.Close()
Else
'ObjCon.Open()
ObjCmd.Connection = ObjCon
ObjCmd.CommandType = CommandType.Text
ObjCmd.CommandText = "Insert into DB_KEYINFO Values( '" & txtname.Text & "'," & txtpsno.Text & ",'" & txtdepartment.Text & "','" & cmbfloor.SelectedItem.text & "'," & txtKeyno.Text & ")"
ObjCmd.ExecuteNonQuery()
MsgBox("Records Saved successfully")
ObjCon.Close()
End If
--------------------------------
From: venkat g
as soon as i click save button in should save the data and form must be refresh
ihave written as
me.refresh
my coding is as follows
If (txtget.Text = "Add") Then
ObjCon.Open()
objAdapt = New OleDbDataAdapter("select * from DB_KEYINFO", ObjCon)
objAdapt.Fill(ds)
ObjDtview = ds.Tables(0).DefaultView
ObjDtview.RowFilter = " [Keyno] = '" & CInt(txtKeyno.Text) & " '"
If (ObjDtview.Count > 0) Then
MsgBox("The Record Is Alreday Exists")
Me.Refresh()
ObjCon.Close()
Else
'ObjCon.Open()
ObjCmd.Connection = ObjCon
ObjCmd.CommandType = CommandType.Text
ObjCmd.CommandText = "Insert into DB_KEYINFO Values( '" & txtname.Text & "'," & txtpsno.Text & ",'" & txtdepartment.Text & "','" & cmbfloor.SelectedItem.text & "'," & txtKeyno.Text & ")"
ObjCmd.ExecuteNonQuery()
MsgBox("Records Saved successfully")
ObjCon.Close()
End If