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 is impersonation in ASP.NET?

7 Answers   Accenture, Merrill Lynch, Wipro,


What is .net framework and what are the main components of it?

1 Answers  


What is CLS?

5 Answers   IBM, PrimeLine, TCS,


Is asp.net mvc front end or backend? : Asp.Net MVC

1 Answers  


Name two properties common in every validation control?

1 Answers  


Do you know using sql cache invalidation?

1 Answers  


what is assembly?

4 Answers   Microsoft,


How to retrieve the information from datatable citywise in c#?

2 Answers   HCL,


what is view state and its use

10 Answers   DELL, Efextra, HCL,


What is the main differences between asp and asp.net?

1 Answers  


About CLR, reflection and assemblies?

1 Answers   Microsoft,


Can I have a unique key as foreign key?

1 Answers  


Categories