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

What object is used to encapsulate a rowset? a) DataSet b) DataAdapter c) DataRowSet d) DataTable

2 Answers   Syntax Softtech,


Compare and contrast between inline and code behind - which one is best?

2 Answers   Siebel,


what is aspcompat? what it does?

1 Answers  


What is viewstate? In which event of the page life cycle, is the viewstate available?

0 Answers  


What is the name of the process the browser uses to find the address of a web server? a) DMZ b) DNS c) Active Directory d) Database lookup

1 Answers   Syntax Softtech,






How does the XmlSerializer work? What ACL permissions does a process using it require?

2 Answers  


How do you bind array to gridview? Will it works?

4 Answers   HP,


We Only Know The Total Number Of Feet In The Farmyard. Write A Program that will compute the total number of rabbits and chickens in the farmyard. Assume number of feet in the farmyard are 40. how many rabbits and chickens are?

0 Answers  


Define page output caching?

0 Answers  


How to write unmanaged code and how to identify whether the code is managed / unmanaged ?

2 Answers   Accenture, BirlaSoft, Cogtest,


What is asp according to you?

0 Answers  


Why asp.net is better than php?

0 Answers  


Categories