Click here to Skip to main content
15,886,724 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Public Sub insert(ByVal cls As clsregistration)
Try
cnn = New ol.OleDbConnection
cnn.ConnectionString = New clsconnection().getcnnstring
cnn.Open()
cmd = New ol.OleDbCommand
cmd.Connection = cnn
cmd.CommandText = "insert into registration_n values(" & _
"" & cls.eno & "," & _
"'" & cls.fname & "'," & _
"'" & cls.lname & "'," & _
"'" & FormatDateTime(cls.addmission_date, DateFormat.ShortDate) & "'," & _
"'" & FormatDateTime(cls.dob, DateFormat.ShortDate) & "'," & _
"'" & cls.religion & "'," & _
"'" & cls.gender & "'," & _
"'" & cls.class1 & "'," & _
"'" & cls.section & "'," & _
"'" & cls.semester & "'," & _
"'" & cls.session & "'," & _
"'" & cls.father_name & "'," & _
"'" & cls.father_occupatio & "'," & _
"'" & cls.address & "'," & _
"" & cls.phno & "," & _
"" & cls.mobile & "," & _
"'" & cls.email & "'," & _
"" & cls.discount & "," & _
"" & cls.adm_fee & "," & _
"" & cls.dev_fee & "," & _
"" & cls.security_fee & "," & _
"'" & cls.dayHostel & "',"
cmd.ExecuteNonQuery()
MsgBox("Record saved successfully ", MsgBoxStyle.Information)
cnn.Close()
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Public Sub fill_session(ByVa
Posted

1 solution

Public Sub insert(ByVal cls As clsregistration)
       Try
           cnn = New ol.OleDbConnection
           cnn.ConnectionString = New clsconnection().getcnnstring
           cnn.Open()
           cmd = New ol.OleDbCommand
           cmd.Connection = cnn
           cmd.CommandText = "insert into registration_n values(" & _
           "" & cls.eno & "," & _
           "'" & cls.fname & "'," & _
           "'" & cls.lname & "'," & _
           "'" & FormatDateTime(cls.addmission_date, DateFormat.ShortDate) & "'," & _
           "'" & FormatDateTime(cls.dob, DateFormat.ShortDate) & "'," & _
           "'" & cls.religion & "'," & _
           "'" & cls.gender & "'," & _
           "'" & cls.class1 & "'," & _
           "'" & cls.section & "'," & _
           "'" & cls.semester & "'," & _
           "'" & cls.session & "'," & _
           "'" & cls.father_name & "'," & _
           "'" & cls.father_occupatio & "'," & _
           "'" & cls.address & "'," & _
           "" & cls.phno & "," & _
           "" & cls.mobile & "," & _
           "'" & cls.email & "'," & _
           "" & cls.discount & "," & _
           "" & cls.adm_fee & "," & _
           "" & cls.dev_fee & "," & _
           "" & cls.security_fee & "," & _
           "'" & cls.dayHostel & "' )"
           cmd.ExecuteNonQuery()
           MsgBox("Record saved successfully ", MsgBoxStyle.Information)
           cnn.Close()
       Catch ex As Exception
           MsgBox(ex.Message)
       End Try
   End Sub
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900