Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Linq to SQL
04-24-2012, 08:54 AM
Post: #1
Not Solved Linq to SQL
i need to build a Linq to Sql connection but it should call a Stored procedure which is at the SQL server. How?

presently i'm using Datacontext is it feasible way to execute a sql command and could you pls provide some samples.


04-24-2012, 09:43 AM
Post: #2
Not Solved RE: Linq to SQL
hi, here is the solution for calling store procedure in Linq

[Image: 2604595733.png]
04-24-2012, 10:02 AM
Post: #3
Not Solved RE: Linq to SQL
thanks for your reply...
actually my question is i need to access data by executing storedprocedure as i questioned earlier in tha chat.
here is my part of my snippet.... but i didn't understand DataContext so i'm just referring now...

private const string SP_GET_ALL_CATEGORY = "SP_GET_ALL_CATEGORY"; // my stored procedure which is in SQL server. not in DBML/ edmx....

public static void GetCategory()
using (DataContext dc = new DataContext(connectionString))
// here i need to pass parameter and execute the SP.... how?
could you please give me reply....


Possibly Related Threads...
Thread: Author Replies Views: Last Post
  How linq is faster than sql queries xpert 1 1,500 12-22-2012 05:19 PM
Last Post: magnum_2007

User(s) browsing this thread: 1 Guest(s)