Call a stored procedure from ado.net and pass parameter to it ?
Answer Posted / vagdevi
By using the SQLHelper of Microsoft,
in Business Layer import Microsoft.ApplicationBlocks.Data
and then,
Create properties for the parameters as userid,password
Declare a parameter array of Type SqlParameter as,
SqlParameter[] p=new SqlParameter[2];
p[0]=new SqlParameter("@userid",userid");
p[0].DbType=DbType.String;
p[0].Direction=ParameterDirection.Input;
p[1]=new SqlParameter("@password",password");
p[1].DbType=DbType.String;
p[1].Direction=ParameterDirection.Input;
SqlHelper.ExecuteNonQuery
(ConnetionString,CommandType.StoredProcedure,"StoredProcedur
eName", p);
That's it and call this method in your Presentation Layer
| Is This Answer Correct ? | 8 Yes | 2 No |
Post New Answer View All Answers
What is data reader in ado.net?
How to create dynamic gridview?
What are the ado.net components?
What is the role of clr?
Do we use stored procedure in ADO.Net?
What is the use of ADO.NET and XML web services?
What is ado in agriculture?
What is data view and variable view?
What are basic methods of dataadapter?
What is ado.net tutorial?
What are the major challenges in accessing data from a database?
What are advantages of microsoft-provided data provider classes in ado.net?
How will you differentiate between ADO (ActiveX Data Object) and RDO (Remote Data Objects)?
Explain why edit is not possible in repeater?
Which is the feature of ado.net?