In my .net 2.0 application I want to convert all the inline queries to sql stored procedures.
I have queries like
StringBuilder query = new StringBuilder();
**query.AppendLine("Select * from xxx Where 1 =1");**
if(Id != 0)
query.AppendLine("And Id = @Id");
if(Nemae != null)
query.AppendLine("And Name = @Name");
How could I write this in sql stored procedure?
Do I need to repeat?
Probably like this :