Hi Guys,
I wrote a function that returns the number in a particular field, my issue at the moment is how to update that field before i return the previous value i collected from the field. i am seeking any guidance available. Enclosed is the function i wrote.
Function GetTransactionNumber() As Int64
Try
GConn.ConnectionString = GConnstr
GConn.Open()
sqlcmd = New SqlCommand("Select Last_Transaction_Num from System_Table", GConn)
sqlreader = sqlcmd.ExecuteReader()
While sqlreader.Read
Return sqlreader.GetInt64(0)
End While
sqlreader.Close()
GConn.Close()
Catch ex As Exception
MsgBox(ex.Message)
End Try
'Return int64_TranNum
End Function