Dim cmd As New Data.SqlServerCe.SqlCeCommand
cmd.CommandText = "SELECT MAX(nr_spray) from spray_db"
cmd.Connection = form1.ssceconn
Dim rdr As Data.SqlServerCe.SqlCeDataReader
rdr = cmd.ExecuteReader
Primary_row_nr = rdr.Item("nr_spray").ToString
i am trying to select the highest row in that, and getting out, what the nr was, but it says IndexOutOfRangeException.
what is wrong?