TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Vishwakant Tripathi
1k
721
839.7k
How to get data and columns from linq dynamically
Sep 2 2013 3:02 AM
Hi,
I have a problem with linq in my scenario, where table name comes dynamically and i need to fetch all columns and records from that table. for example..
public void GetData(string tableName,int id)
{
DataClasses1DataContext _db = new DataClasses1DataContext();
var qry = from o in _db.Organizations where o.OrganizationId==id select o;
//but here, I cannot pass Organizations table directly as It is dynamic
}
So how can I give table name dynamically in context, and how to get columns also for that table.
Please give me some idea.
Thanks
Reply
Answers (
2
)
Convert Sql query to Linq
Do not geting all from both table in linq to sql reporting ?