sql-servervisual-studio-2010linq-to-sqlstored-procedures

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


Solution

  • 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.