I have tried the example for BindingListView which is downloaded with this project, and work fine. But when I try to make a demo for my owned class, I experience error.
I have an object class that is DBML created for me. The class is corresponding to a table from database, Employee class. My coding like this:
So I try to simplify the code, and try again. The exception error still there:
BindingList<Employee> empBindingList = new BindingList<Employee>();
empBindingList.Add(new Employee());
BindingListView<Employee> blvEmployee =
new BindingListView<Employee>(empBindingList); // Exception again.
If I change the Employee class back to a Item class just like the demo, everythings goes well. So what is the problem of Employee class? The Employee class is created by DBML tool in Visual Studio 2008 with LINQ mechanism.
Please help. Thank you very much.
--
Best regards,
Diviner.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am getting the TargetInvocationException as well whenever I try to insert a DBML derived class following a fill of the class usng a linq query. Has anyone figured out why this results in a TargetInvocationException?
thank you,
John
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have tried the example for BindingListView which is downloaded with this project, and work fine. But when I try to make a demo for my owned class, I experience error.
I have an object class that is DBML created for me. The class is corresponding to a table from database, Employee class. My coding like this:
BindingList<Employee> empBindingList =
(BindingList<Employee>)db.Employees.GetNewBindingList();
BindingListView<Employee> blvEmployee =
new BindingListView<Employee>(empBindingList); // Exception here.
So I try to simplify the code, and try again. The exception error still there:
BindingList<Employee> empBindingList = new BindingList<Employee>();
empBindingList.Add(new Employee());
BindingListView<Employee> blvEmployee =
new BindingListView<Employee>(empBindingList); // Exception again.
If I change the Employee class back to a Item class just like the demo, everythings goes well. So what is the problem of Employee class? The Employee class is created by DBML tool in Visual Studio 2008 with LINQ mechanism.
Please help. Thank you very much.
--
Best regards,
Diviner.
Does BindingListView support the class generated by DBML?
I am getting the TargetInvocationException as well whenever I try to insert a DBML derived class following a fill of the class usng a linq query. Has anyone figured out why this results in a TargetInvocationException?
thank you,
John