hi,
Private Sub AutoNumberNo()
try
Dim strsql As String
strsql = "SELECT MAX(Serial_No)+1 FROM Cutting"
Dim com As New SqlCommand(strsql, objconnection)
txtsrno.Text = com.ExecuteScalar() ' result will appear in textbox txtsrno
Catch sqlex As SqlException
MessageBox.Show(sqlex.Message)
End Try
End sub
i try this code but i get following error
1) casting from DBnull to string not possible , when database is empty.
2) serial number increasing from zero, but i want serial number from one
3) serial number not shown in text box.
i am waiting for ur reply........................
prasad satam
mumbai