how can i call output parameters from ado.net

Answer Posted / krishnarao

i have to write a one example

sqlconnection con=new sqlconnection(" u can write
Connection string here);
sqlcommand cmd=new sqlcommand();
cmd.ConnectionString=con;
cmd.CommandText="u can write stored procedure name here";
cmd.CommandType=CommandType.StoredProcedure;
SqlDataReader dr;
dr=cmd.ExecuteReader();//the stored procedure will be
executed here.the out put parameters will be stored into
datareader.
TextBox.Text1=dr.GetValue(0).ToString();//get the output
values here.
TextBox.Text2=dr.GetValue(1).ToString();//get the output
values here.

Is This Answer Correct ?    3 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why is this service branded with windows livetm?

777


Explain in what order a destructors is called.

778


How is the asp.net mvc architecture different from others? : asp.net mvc

677


Which is faster viewbag or viewdata?

737


What is the difference between the get method () and post method ()?

706


What is mvc in asp.net interview question? : Asp.Net MVC

691


Why Unload event of MasterPage Calls first in ASP.net ?

774


Describe the difference between inline and code behind - which is best in a?

783


Explain weak typing and strong typing.

750


What are Session states available and its Uses?

1932


What is the use of web.config file?

738


How can exception be handled with out the use of try catch?

736


Explain page output caching?

735


Which methods validate all the controls on a page?

742


What is difference between view state and session state?

658