Hi,
I used to work with ADO connecting to my SQL server and to activate a stored procedure ('Temp_SP') that expect few params i have done the following:
#######
.......
str= "exec Temp_SP Param1_Val,Param2_val"
//executing the SP...
oConn.Execute SQLQuery, , adExecuteNoRecords
########
Now I'm using C# under .Net platform.
How can I do the same without using AddParameter as follows:
###########
SqlStoredProcedure sp = new SqlStoredProcedure(SP_Name,
Connection.SqlConnection);
sp.AddParameter("@Filestr", SqlDbType.VarChar, 256,
ParameterDirection.Input, FilePath.ToString() );
sp.ExecuteNonQuery ();
############
If I have many parameters It will be easier for me to add all the parameters in a string instead of Adding parameters as I have done above. Can it be done?
Thanks
I used to work with ADO connecting to my SQL server and to activate a stored procedure ('Temp_SP') that expect few params i have done the following:
#######
.......
str= "exec Temp_SP Param1_Val,Param2_val"
//executing the SP...
oConn.Execute SQLQuery, , adExecuteNoRecords
########
Now I'm using C# under .Net platform.
How can I do the same without using AddParameter as follows:
###########
SqlStoredProcedure sp = new SqlStoredProcedure(SP_Name,
Connection.SqlConnection);
sp.AddParameter("@Filestr", SqlDbType.VarChar, 256,
ParameterDirection.Input, FilePath.ToString() );
sp.ExecuteNonQuery ();
############
If I have many parameters It will be easier for me to add all the parameters in a string instead of Adding parameters as I have done above. Can it be done?
Thanks