Ravi
Ravi

Reputation: 29

I need to pass stored procedure name dynamically to Linq-to-SQL, vb.net

How can I pass stored procedure name dynamically to Linq-to-SQL, vb.net and get the result into a datatable.

Thanks in advance.

Upvotes: 1

Views: 261

Answers (2)

DooDoo
DooDoo

Reputation: 13467

you can either use ExecuteQuery<T>(string Your Query).First build your string and then execute it and return T result and then iterate it to DataTable.

Upvotes: 0

SLaks
SLaks

Reputation: 887857

LINQ to SQL is all about compile-time type-safety and avoiding DataTables.

You should use classic ADO.Net, using a SqlDataAdapter.

Upvotes: 4

Related Questions