shelly121
18-02-2005, 12:16
'SAVE BUTTON
Private Sub ButSAVE_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bntSave.Click
RS = New ADODB.Recordset()
RS.Open("select * from client order by Name", CN, 1, 2)
RS.AddNew()
txtFirstName.Text = CStr(RS.Fields("Name").Value)
hey ppl!! ive got the above code for my save button, in a vb.net application which is linked to microsoft access database, however when i open.play the form it works fine except for when i press "save" it comes up with the following error:
An unhandled exception of type 'System.InvalidCastException' occurred in microsoft.visualbasic.dll
Additional information: Cast from type 'DBNull' to type 'String' is not valid.
sum1 please help, be grateful for any ideas/help!!!
Private Sub ButSAVE_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bntSave.Click
RS = New ADODB.Recordset()
RS.Open("select * from client order by Name", CN, 1, 2)
RS.AddNew()
txtFirstName.Text = CStr(RS.Fields("Name").Value)
hey ppl!! ive got the above code for my save button, in a vb.net application which is linked to microsoft access database, however when i open.play the form it works fine except for when i press "save" it comes up with the following error:
An unhandled exception of type 'System.InvalidCastException' occurred in microsoft.visualbasic.dll
Additional information: Cast from type 'DBNull' to type 'String' is not valid.
sum1 please help, be grateful for any ideas/help!!!