views:

404

answers:

3

I am working on an ASP.NET page with a GridView and an ObjectDataSource.

I want to configure the ObjectDataSource against a class (decorated with DataObject()) in my business layer. A class amonst many others set up in a very similar fashion. I select the class and click Next to pick the function for the SelectMethod and it closes without warning and without any error.

I can set the TypeName for the ObjectDataSource and attach it to a GridView. I attempt to Refresh Schema and I get an error pop up.

Error invoking 'Refresh Schema'. Details: Exception has been thrown by the target of an invocation.

I can manual set up the ObjectDataSource, but I am inherently lazy and would prefer to use the GUI.

Why is it failing?

Everything builds just fine. I can manually hook everything up and the page works just fine. Yet it still fails when I go to configure the ObjectDataSource with the UI.

A: 

Not using any reserved words or anything in there are you? Perhaps in the Field names, or anything?

With such a vague error message it's tough to figure this one out.

Jeff Sheldon
No reserved words are used anywhere. Yes, the error message is vague. But it is slightly better than at first there was no error message and the dialog just closed unceremoniously.
BlackMael
A: 

Have you found a solution to this? I'm having the exact same issue.

** Restarting my machine did the trick...this definitely seems like a bug. **

Restarting Visual Studio seems to do the trick for me. I haven't had to resort to restarting my whole machine thankfully.
BlackMael
Restarting Visual Studio worked for me too.
Homer
A: 

I have the same error. It seems that the datasource does call the linq select method twice. On the second run the LoadOptions are already filled from the first call and this gives the problem. No solution yet.