how to exeute stored procedure with partmeter in asp.net 1.1(

  • Home
  • Blog
  • how to exeute stored procedure with partmeter in asp.net 1.1(

Following are the stored procedure that will get transaction data from database
and fill it in to the sql adapter and data set. it has four parameter.

SqlAdpt=new SqlDataAdapter(“sp_getTransactionData”,this.Con);

SqlAdpt.SelectCommand.CommandType=

System.Data. CommandType.StoredProcedure;

SqlAdpt.SelectCommand.Parameters.Add(new SqlParameter(“@boid”,System.Data.SqlDbType.NVarChar,16) );

SqlAdpt.SelectCommand.Parameters[“@boid”].Value=

boid.Trim().ToString();

SqlAdpt.SelectCommand.Parameters.Add(new SqlParameter(“@firstdate”,System.Data.SqlDbType.SmallDateTime,4));

SqlAdpt.SelectCommand.Parameters[“@firstdate”].Value=

firstdate.Trim().ToString();

SqlAdpt.SelectCommand.Parameters.Add(new SqlParameter(“@lastdate”,System.Data.SqlDbType.SmallDateTime,4));

SqlAdpt.SelectCommand.Parameters[“@lastdate”].Value=

lastdate.Trim().ToString();

SqlAdpt.Fill(dt,table);

SqlApdt=SQL Data Adpater

dt=Sql Dataset

Happy Programming