ADO.Net - how to get data from database and bind to the
controls -- write this small code
Answers were Sorted based on User's Feedback
Answer / alb.shah
Creating a Database Connection at Run Time
Create the data connection object.
Create a data adapter object.
Create a data set object.
Invoke methods on the adapter object to fill or update the
data set.
Use data binding or another technique to display the data
from the data set.
Is This Answer Correct ? | 5 Yes | 0 No |
Answer / kaarthikeyan
establish a connection and declare sqldataadapter,dataset
sda=new sqldataadapter("select the appropriate
table",connectionobj);
ds=new dataset();
sda.fill(ds);
gridview1.datasource=ds;
gridview1.databind();
Is This Answer Correct ? | 3 Yes | 0 No |
Answer / kinjal panchal
first of all write namespace in your page.
using Syste.data.sqlclient;
//code
sqlconnection cn=new sqlconnection();
cn.open();
sqlcommand cmm=new sqlcommand("write select query here",cn);
sqldataAdupter da=new sqldataAdupter(cmm);
datatable dt=new datatable();
da.fill(dt);
cn.close();
suppose u have gridview control then
gridview.datasource=dt;
gridview.databind();
Is This Answer Correct ? | 2 Yes | 0 No |
If you want to bind the columns manually within the asp:datagrid tags what kind of tags you have to add.
Does asp.net still recognize the global.asa file?
Explain server control extensibility with reference to asp.net 2.0 ?
Describe the role of inetinfo.exe, aspnet_isapi.dll andaspnet_wp.exe in the page loading process?
1 Answers Patni, Perot Systems, Sedna Technology,
Differences between session state and Application state?
1.can we add connection string in global.asax?????????? 2.what are the default files included when we create new web application????
How can you debug your.net application?
Tell About Web.config ?
Apart from IDE what are the enhancements in asp.net 2.0?
when u enter the data in one text box once u completed entering the text box data then one page has to be popuped and the text has to be displayed in the parent page
If there is submit button in a from tell us the sequence what happens if submit is clicked and in form action is specified as some other page ?
Difference between overriding and overloading?