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

i want the asp.net technical questions and answeres

0 Answers  


What is marshalling ? Is it a part of asp.net ?

0 Answers   MCN Solutions,


How to add DateTime Control in normal DataGrid Server Control?

0 Answers  


Explain server-side scripting and client-side scripting.

0 Answers  


What are clr?cts?cls?

4 Answers   e4e, HCL, Microsoft, Tata Communications,






How many types of cookies are available in asp?

0 Answers  


can i use store procedure in disconnected mode? give me answer

2 Answers  


How do you use css in asp.net?

8 Answers   iBridge,


hi i have a problem regarding to datagrid in aspdotnet.i have a datagrid in my application.i have to place add,edit,delete buttons or links what ever it may be. now the problem is if i click on add button then the page has to redirected to another form called "xyz.aspx" and if i click on edit button the page has to redirected to another form called "abc.aspx".i am phasing the problem that if where ever i click on the datagrid the cursor goes to gv1_SelectedIndexChanged event.please tell me the solution about the code.

4 Answers   Lambent,


what is session,cokkies in asp.net??

5 Answers  


When would you set a control's AutoPostBack property to true?

1 Answers  


Why we use content place holder in asp.net?

0 Answers  


Categories