20-09-12, 05:58 PM
قم بكتابة متغير واسناد هذه الداله له
PHP كود :
Function getmaxid() As Integer
Dim con As New OleDbConnection("connection string")
Dim cmd As New OleDbCommand("Select max(ID) as maxid from Table", con)
If con.State = ConnectionState.Closed Then
con.Open()
End If
cmd.Connection = con
Dim result As Integer
If Not cmd.ExecuteScalar Is Nothing Then
result = CInt(cmd.ExecuteScalar)
Else
result = 0
End If
Return result
End Function

