Hi Amodio,
I have downloaded your project. After I read your code, I found some problems with it. Here is the detail.
1. You have not load data for the DataSet (DBDataSet). According to your logical, I think you should add the following code after Dim DS As New DBDataSet and before Dim Fonte = From el In DS.Anagrafiche _
Select el.Cognome
Dim adapter As ProvaLinq.DBDataSetTableAdapters.AnagraficheTableAdapter = New ProvaLinq.DBDataSetTableAdapters.AnagraficheTableAdapter()
adapter.Fill(DS.Anagrafiche)
2. Bind DataGridView.DataSource to Fonte.AsDataView() instead of Fonte
The whole solution code looks like this.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim DS As New DBDataSet
Dim adapter As ProvaLinq.DBDataSetTableAdapters.AnagraficheTableAdapter = New ProvaLinq.DBDataSetTableAdapters.AnagraficheTableAdapter()
adapter.Fill(DS.Anagrafiche) Dim Fonte = From el In DS.Anagrafiche _
Select el
Me.AnagraficheDataGridView.DataSource =
Fonte.AsDataView() End Sub
Since I don’t have the same database environment to test the code, so please test it and tell me if it works.
Sincerely,
Kira Qian
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the
All-In-One Code Framework!