ADO.Net - how to get data from database and bind to the
controls -- write this small code
Answer Posted / 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 |
Post New Answer View All Answers
Which dll handles the request of .aspx page?
What is http post and http get?
Do you know using sql cache invalidation?
How to use ipostback?
Explain the use of dataadapter.
Why do I get error message "could not load type" whenever I browse to my asp.net web site?
Can anyone please tell me that the question posted on this website are Sufficient for the interview with 2+ year experience in .net
Explain exception handling in .net.
What is the difference between the get method () and post method ()?
Explain in what order a destructors is called.
How could you modify xaml content from javascript?
Why select Web API?
What is inheritance and an how it be used, example with an example?
They mostly asked difference between versions of technologies
How will you do Redo and Undo in a TextControl?