What is sequence of code in retrieving data from database?

Answers were Sorted based on User's Feedback



What is sequence of code in retrieving data from database?..

Answer / seshu

SQLConnection conn = new
SQLConnection("DataSource=;InitialCatalog=;User Id=;Password=");
SQLCommand cmd=new SQLCommand("select * from tablename",conn);
DataAdapter da=new DataAdapter(cmd);
Dataset ds=new Dataset();
da.fill(ds,"tablename");

Is This Answer Correct ?    8 Yes 0 No

What is sequence of code in retrieving data from database?..

Answer / chandra

system.data.oledb

dim oledb as new oledbconnection
oledbconnection1.open()
dim com as new oledbcommand("select empname from emp where
empid=100".oledbconnection)
dim dr as oledbdatareader=com.executereader()
if dr.read() then
textbox1.text=dr(0)
end if

Is This Answer Correct ?    4 Yes 0 No

What is sequence of code in retrieving data from database?..

Answer / srujana

using data.sqlclient;

sqlconnection cn;

cn=new sqlconnectin("user id=sa;database=pubs;data
source=server");
cn.open();

Is This Answer Correct ?    2 Yes 2 No

Post New Answer

More ASP.NET Interview Questions

How do sessions work?

0 Answers  


what is webservices ? and what is web server ?

1 Answers   Wipro,


What are client activated objects?

0 Answers  


ASP.NET Web Service

1 Answers  


What are the different Key TreeView Properties in Asp.net 2.0?

1 Answers   TCS,






main difference between asp.net2.0,asp.net1.1,asp.net1.0

15 Answers   Inflexion, Infosys, iSoft, Microsoft, Prakruthi,


In which module you have worked in your .net project explain?

1 Answers   TechSolution,


How to kill session?

18 Answers   Protech,


Define repository pattern in asp.net mvc? : asp.net mvc

0 Answers  


In order to bind the data from a data source to the Repeater control what property is set and what method must you call in your code,?

0 Answers   Siebel,


Is it possible to write code in many languages in one asp.net project?

0 Answers  


What is the difference between Server.Transfer and Response.Redirect? Why would you choose one over the other?

26 Answers   Syntax Softtech,


Categories