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
Seshu B
NA
442
145.4k
How to get records by passing multiple column names in MVC5
Jun 19 2017 1:51 AM
Hi all..
by passing single column name binding records but i want to get records by passing multiple column names dynamically using entity framework.
please provide soultion regarding this
I have tried like this...
public List<string> GetRecords(List<string> Columns,string tablename)
{
using (var Context = new MCPEntities())
{
string columnnames = string.Join(",", Columns);
string Query = "SELECT " + columnnames + " FROM " + tablename + " ";
var Records = Context.Database.SqlQuery<string>(Query).ToList();
return Records.ToList();
}
}
Reply
Answers (
5
)
CRUD in MVC kendogrid using custom commands
Silverlight:DataGrid-Exception - Index must be within bounds