Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't drag stored procedure onto dbml designer

I'm trying to do a simple call to a database stored procedure from a C# application.

I'm following a guide like, e.g., this one or this one.

Both of these have the same basic steps.

  1. Add a LINQ to SQL .dbml item to my project
  2. Connect to a database in Server Explorer
  3. Drag a stored procedure from the Server Explorer onto my .dbml designer window

But step 3 doesn't work. I have my stored procedure and my designer window, but I can't drag the sproc. I don't get a plus sign, or a "not allowed" sign. It's just a non-dragable object.

I can't find another way to add my sproc to the .dbml file. And I can't find anyone else who has had this problem. Every source simply says to drag it over.

What could I be doing wrong here?

Screenshot:

enter image description here

like image 785
Kris Harper Avatar asked Apr 30 '12 14:04

Kris Harper


2 Answers

Turns out the solution was that I had the wrong version of a .dll for Visual Studio.

I noticed I was getting exceptions when performing actions in the Server Explorer. Googling the exceptions led to this question which points to this dll

C:\Program Files (x86)\Common Files\microsoft shared\Visual Database Tools\dsref80.dll

as the issue.

I replaced it with the corresponding copy from one of my teammates and it now works fine.

like image 57
Kris Harper Avatar answered Oct 17 '22 01:10

Kris Harper


I had also installed VS 11 Beta and the designer was working fine until I uninstalled it. I had to delete the DLL manually at the above location and repair the installation by finding Visual Studio 2010 in Programs and Features and selecting Uninstall/Change and then Repair. The installer will replace the DLL file that was deleted with the correct version.

like image 3
gophfy Avatar answered Oct 16 '22 23:10

gophfy