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
How many major types of connection objects in ADO.NET?
How to add a check box or a dropdown list to a column in a datagrid?
What is the difference in an abstract class and an interface?
Define data access layer?
What is disconnected data?
Explain how to create dynamic gridview?
Can you explain how to enable and disable connection pooling?
What is the difference between OLEDB Provider and SqlClient?
What is ado.net code?
What are the core objects of ADO.NET?
Which provider is used to connect ms access, oracle, etc…?
What is linq and entity framework?
What is the use of ADO.NET and XML web services?
What is the default Timeout for SqlCommand.CommandTimeout property?
What is concurrency? How will you avoid concurrency when dealing with dataset? (One user deleted one row after that another user through his dataset was trying to update same row. What will happen? How will you avoid the problem?)