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
Give some salient points of difference between request processor and request dispatcher.
Which of the following .NET framework supports Web API?
How to make sure that contents of an updatepanel update only when a partial postback takes place (and not on a full postback)?
Why is mvc better than asp.net?
When you are running a component within ASP.NET, what process is it running within on Windows XP? Windows 2000? Windows 2003?
What is fulltrust?
What is the recommended approach for asp.net mvc to globally intercept exceptions? What other functionality can be implemented with the approach? : Asp.Net MVC
Why select Web API?
When you use Ajax controls in the ASP.NET application?
Where code pages are used?
Explain the steps needed to be performed in order to create an animation in xaml?
How do I open an ashx file in windows 7?
What is s2s tracking?
What is the concepts of globalization and localization in .net?
How many web.config files can I have in an application?