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
3. What goals do you have in your career?
What is true about application service provider?
To display data in a Repeater control which template you provide?
Which control has default post back is enabled(true)?
What is data grid view in asp.net?
Can I recieve both html markup for page and code in the asp.net web page's source code portion in the web browser?
Describe the difference between inline and code behind - which is best in?
What is difference between session and application in asp net?
Is a dll file an executable?
What are the asp.net security controls?
How can we prevent browser from caching an aspx page?
Out of ASP or ASP.NET which one is stateless?
What is preprocessor in .net and type, where it use?
Just by seeing the signature of the bean how can you specify whether it is a stateful or stateless session bean?
What is side-by-side execution? Can two applications, one using a private assembly and other using a shared assembly, be stated as side-by-side executables?