Thursday, June 29, 2006

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
Share:

1 comment:

  1. get some more interview questions on asp.net here:

    http://www.interviewhelper.org

    ReplyDelete

Your feedback is very important to me. Please provide your feedback via putting comments.

About Me
My Photo

Full Stack Developer,Blogger,Microsoft Mvp, Mentor, Life long learner, 10+ Years of Experience for JavaScript, web and Microsoft technologies. ASP.NET MVC,Web Forms,C#,AngularJs,Golang
Mvp profile
Subscribe to my blog

Enter your email address:

Follow us on facebook
Blog Archive
Total Pageviews