0

Like below quotes for serial no. for VB.net, do you have codes for ms access?
Anil Gamare
***********

Try This :

Public Sub GenerateNotaId()
        Dim myReader As SqlDataReader
        conn = GetConnect()
        conn.Open()
        Dim temp As String
        Try
            Dim sql As String = "SELECT MAX(IDNOTA) AS 'KODE' FROM Nota "
            Dim comm As SqlCommand = New SqlCommand(sql, conn)
            myReader = comm.ExecuteReader
            If myReader.HasRows Then
                While myReader.Read()
                    temp = myReader.Item("KODE") + 1
                End While
            End If
            myReader.Close()
        Catch ex As Exception

        End Try
        conn.Close()
        If temp = 0 Then
            txtNoNota.Text = 1
        Else
            txtNoNota.Text = String.Concat(temp)
        End If
End Sub

Generate will shown in txtNoNota

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by pritesh2010
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.