Brant Snow
asked on
c# external sql server queries
We have a C# application, for some reasons i wont go into we are unable to use Entity Framework.
That being said I still prefer to have parameterized sql statements external from my application code, especially the large ones. For most small CRUD based options I have just written a simple class to map the objects etc.
What would be the best way to externalize the sql queries but still allow some dynamic parameters, Ill provide a simple example here
StringBuilder x = new StringBuilder();
x.AppendFormat("select * from Customers where CustomerId = {0}", this.CustomerId);
That being said I still prefer to have parameterized sql statements external from my application code, especially the large ones. For most small CRUD based options I have just written a simple class to map the objects etc.
What would be the best way to externalize the sql queries but still allow some dynamic parameters, Ill provide a simple example here
StringBuilder x = new StringBuilder();
x.AppendFormat("select * from Customers where CustomerId = {0}", this.CustomerId);
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.