I have a data base using access which has one column as jobno and which is empty. I want that when my form load (vb.net 2005) it generate a number which then appears in a textbox.
Below are my codes please i cant complete it help me.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim sql As String
Dim strjobno As String = TextBox18.Text
Dim Cn As OleDb.OleDbConnection
Dim myCom As OleDb.OleDbCommand
Cn = New OleDb.OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Hardware.mdb")
Cn.Open()
sql = "select MAX(jobno) from repair"
myCom = New OleDb.OleDbCommand(sql, Cn)
Cn.Close()
If strjobno Is DBNull.Value Then
Dim intjobno As Integer = Convert.ToInt32(strjobno)
strjobno = 1
Else
strjobno = +1
End If
MyTextBox18.Text =
End Sub