M
Mark
I see two ways to fill a dataset with the results of a stored procedure:
1. Create a SqlCommand object with the text ...
....
sqlConn.Open();
String strSql = "exec p_my_sproc @intParam = " + intParam.ToString() ;
SqlCommand sqlComm = new SqlCommand(strSql,sqlConn);
or
2. Create a SqlCommand object using SqlParameter class.
What is going on behind the scenes that would make option 2 more worthwhile?
Under what circumstances?
Thanks in advance!
Mark
1. Create a SqlCommand object with the text ...
....
sqlConn.Open();
String strSql = "exec p_my_sproc @intParam = " + intParam.ToString() ;
SqlCommand sqlComm = new SqlCommand(strSql,sqlConn);
or
2. Create a SqlCommand object using SqlParameter class.
What is going on behind the scenes that would make option 2 more worthwhile?
Under what circumstances?
Thanks in advance!
Mark