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 are dataproviders?
How would you connect to a database by using .NET?
Which parameter of ConnectionString is used to specify the name of the database?
How can we perform transactions in .net?
Some important instruction regarding ADO.NET connection string ?
How to find the given query is optimised one or not?
What is ole access?
What are the core objects of ADO.NET?
Explain how to find the given query is optimised one or not?
What you mean by filtering of data?
What is dataset object? Explain the various objects in dataset.
What are the objects of ado.net?
What does adodb stand for?
What are the pre-requisites for connection pooling?
What is sql connection in ado.net?