0
String query = "Select * from " + tableName + "t where t.ID='" + fieldvalue + "'";
IEnumerable<Customer> results = db.ExecuteQuery<Customer>(query);
Class is your entity Class for returned result store
0 Hi
Senthilkumar,Sorry for not being clear here. My exact concern is how/what type of class should I use for casting result for dynamic query with LINQ. This is what I mean:
String query = "Select * from " + tableName + "t (nolock) where t.ID='" + fieldvalue + "'";var res = context.ExecuteQuery<
ClassName>(query).ToList();
What should I use as class.
0 Hi,
You can query like this.
Are you going to use the table is not constant? then
string query = "SELECT * FROM " + tableName + " where ID='" + fieldvalue + "'";
You know the table name
string query = "SELECT * FROM tableName WHERE ID='" + fieldvalue + "'";
If your id column is integer column then
string query = "SELECT * FROM " + tableName + " WHERE ID=" + fieldvalue;