Hello,
>> > strSql = " Select * " ;
>> > strSql += " From table1 " ;
>> > strSql += " Where qty = " + amt ;
>> > strSql += " AND color = ' " + color1 + " ' " ;
>> > strSql += " OR material = ' " + silk + " ' " ;
Unrelated to this specific issue, but you may want to consider using
parameters :
http://msdn.microsoft.com/en-us/library/yy6y35y8.aspx
Not listed but IMO one of the key benefit is that values embedded in the SQL
string could cause problems if not well done i..e :
- you have to replace ' with '' in strings
- you have to use a date format that match your server language (or better
use a format such as YYYMMDD that works regardless of the server settings)
- to take extra care if your code runs in a country that doesn't use . as a
decimal separator (else you'll get 2,5 rather than 2.5 in your SQL
statement).
With parameters you'll just work with the actual data type...
--
Patrice