لمن اقو بمحاولة اظهار اكبر رقم من قاعدة البيانت يظهر هذا الخطاء اذا كانت قاعدة البيانات فاضية No data exists for the row/column.
كيف اقدر اتفادى هذا الخطا يعني بدل ما يوقف البرنامج تطلع رساله تخبر ان قاعدة البيانات فاضية
Dim MyDataReader As OleDbDataReader
SQL = "Select Max(TxtNum) as MaxNum From Pieces"
Try
If MyCon.State = ConnectionState.Closed Then MyCon.Open()
Dim Mycmd As New OleDbCommand(SQL, MyCon)
MyDataReader = Mycmd.ExecuteReader()
TxtNum.Text = Val(MyDataReader.Item("MaxNum"))
MyDataReader.Close()
Catch ex As OleDb.OleDbException
MsgBox(ex.Message, MsgBoxStyle.Critical Or MsgBoxStyle.MsgBoxRight Or MsgBoxStyle.MsgBoxRtlReading, "خطاء غير معروف")
Finally
MyCon.Close()
End Try