Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I am trying to write a visual Query using c#. Main intension behin this is to generate queries from front end and execute them using EF. Here i have a problem. I have success to generate SQL Query including joins and it is working perfect with SQL Server console too.

When i am trying to pass to Entity frame work and trying to execute with ExecuteStoreQuery it is not showing any resutls.

Here i wanted to mention that i do not know which type i do get as a result or i do not know to which table use is trying to execute. tried 3 types commented below.

C#
EntityConnection conn = new EntityConnection(Connstring);

       conn.Open();
       PIAEntity context = new PIAEntity(conn);
       context.CommandTimeout = 6000;
       //var sequenceQueryResult = context.ExecuteStoreQuery(strQuery, null);
       //object lists = context.ExecuteStoreQuery<object>(strQuery);
       //List<PIAEntity> list = context.ExecuteStoreQuery<PIAEntity>(strQuery).ToList();
       dgvResults.DataSource = list;   


Kindly help.

Regards.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900