LINQ to SQL calling stored procedure that uses dynamic SQL -


I am trying to connect to the SQL stored procedure using LINQ. It works very well for stored procedures that have static SQL queries.

I want to connect to a stored procedure that has dynamic SQL I

It has a exec statement at the end of the stored procedure.

  exec (@srchQuery)   

When I do this it does not work because it is dynamic SQL

If I < Code> print @srchQuery and copies that stored procedure and uses that static SQL in the stored procedure, so this is not a problem. Analyze the SQL Direct SELECT statement from LINQ to project it as the result of executing it

The type of model for which is the stored procedure. Because you are using a dynamic statement using EXEC , it can not determine which type of model has been generated.

The simple answer will not be to use a stored procedure, and instead use SQL to generate SQL from LINQ, or use a dynamic built content within your stored procedure.

You are creating the SQL statement, it should mean that you have a strong case for it. What can you accomplish without a stored procedure always follow the simplicity. Ask yourself, do you use a dynamically generated statement for a stored procedure

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -