string Sample=@"
Select * from Table1 where Id =[MY Id]
and Column2=[MY Column2 Value]
";
This is SqlCommand CommandText I will replace all string that start with [ and end with ]
before use command
How Can I find parameter name beetwen [ and ] ?
Do I have to use string.IndexOf (Sample,'[‘) ets. or Is there another void to make easy?
In addition to the possibility of using
SqlParameter, you can defineand then obtain the command as
where
id1andid2are your parameters.