Hi BrandonStewart-4522,
Follow the steps below, you will find that "this window is not supported for the selected project." in Winforms(VB) .NET5.
1.Open the Data Sources window, on the View menu, select Other Windows > Data Sources.
It means that the wizard is not supported yet. So you need to connect to the database manually.
I made a test and can access the local Microsoft Access database successfully.
First add data connection in Server Explorer which on View menu.
Then use the following code example to load records from Access Database to Datagridview.
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim con As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\danielzh\Desktop\test.accdb")
Try
con.Open()
If con.State = ConnectionState.Open Then
MsgBox("Connected")
Else
MsgBox("Not Connected!")
End If
Catch ex As Exception
MsgBox(ex.Message)
Finally
con.Close()
End Try
Try
Dim sql As String
Dim cmd As New OleDb.OleDbCommand
Dim dt As New DataTable
Dim da As New OleDb.OleDbDataAdapter
con.Open()
sql = "Select * from Table1"
cmd.Connection = con
cmd.CommandText = sql
da.SelectCommand = cmd
da.Fill(dt)
DataGridView1.DataSource = dt
Catch ex As Exception
MsgBox(ex.Message)
Finally
con.Close()
End Try
End Sub
Best Regards,
Daniel Zhang
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentationto enable e-mail notifications if you want to receive the related email notification for this thread.