Below is a code extract from an ASP.Net application.
The code basically reads data from the “name” field in
the “members” table and prints them onto the webpage.
Using the assumptions provided, fill in the 4 blanks below
so that the code will run correctly.
‘Assumptions:
‘conn_str is a variable that holds the connection string to
the database
‘Objects dbcomm and dbread are already declared earlier
dbcomm = New OleDbCommand("SELECT name FROM members",
conn_str)
dbread = dbcomm._______________
_____________________
response.write(_______________)
_____________________
dbread.Close()

Answer Posted / wriju b

dbcomm = New OleDbCommand("SELECT name FROM members",
conn_str)
dbread = dbcomm.ExecuteReader()
while(dbread.Read())
response.write(dbread.GetString(1)))
dbread.NextResult()
dbread.Close()

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between session.abandon() vs clear()?

768


How do we assign page-specific attributes?

863


Write the different features of a Thread and a Process?

898


How can u deifne the benefits and limitation of using Viewstate for state management?

940


What is data cache in sql server?

851


If there are multiple update panels on the page say upd1 and upd2. There is a button placed in upd1. How can you stop upd2 to update when button placed in upd1 is clicked?

797


What is manifest in .net framework?

797


What is the difference between application state and session state in asp net?

791


Explain how do you deploy your asp.net application?

704


What is a user session?

719


Explain the code Access Security (CAS) in .net Framework?

993


Differentiate between structure and class.

791


List down the sequence of methods called during the page load.

740


What are the cookies types in asp.net?

777


Explain server control extensibility with reference to asp.net 2.0 ?

766