Hello Everyone,
I have run into a little problem while trying to obtain the maxval from an OLEDB database column. I have invoked maxval(ID) and it says system out of range exception.
Error Details:
Line 79: Try
Line 80: While dr.Read()
Line 81: maxval = dr("ID")
Line 82:
Line 83: End While
I have no Idead what I am doing wrong. Please help. Here's my code:
Protected Sub Button4_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button4.Click
Dim dr As OleDbDataReader
Dim maxval As Integer
Dim CurrentID As Integer
Dim myConn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|EasyMenuDb.mdb")
Dim mycomm1 As New OleDbCommand("SELECT MAX(ID) FROM emsample", myConn)
...
Go to the complete details ...