Monorchism
New member
- Joined
- Jun 19, 2024
- Messages
- 1
- Programming Experience
- Beginner
Hi, I have a simple issue and hope someone can help.
My code is
I have checked that the database, table and field name exists.
When run I get the following message:
My code is
VB.NET:
Imports System.Data.OleDb
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim conn As New OleDbConnection
conn.ConnectionString = ("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\inetpub\private\mull.mdb")
conn.Open()
Dim strsql As String
strsql = "select * from INDV"
Dim cmd As New OleDbCommand(strsql, conn)
Dim myreader As OleDbDataReader
myreader = cmd.ExecuteReader
myreader.Read()
TextBox1.Text = myreader("indv_no")
End Sub
End Class
I have checked that the database, table and field name exists.
When run I get the following message:
System.IndexOutOfRangeException: 'indv_no'