Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What are dcl commands?

1005


What is dataadapter in ado.net?

920


What is the executescalar method?

1094


What are all components of ADO.Net data provider?

1058


What is a datareader object?

1095


Why is ADO.NET serialization slower than ADO ?

1043


How to connect and retrieve data from database using dataset

1043


Can you explain how to enable and disable connection pooling?

965


What are the connected and disconnected modes in ado.net?

909


What is the difference between data grid and data repeater?

1073


What are two important objects of ADO.Net?

1014


What is a serialized object?

1008


How to generate a single aggregate?

975


What are the important features of ado.net 2.0?

1071


What are the major challenges in accessing data from a database?

1019