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 method do you use to enforce garbage collection in .net?
Explain global assembly cache.
What’s difference between “optimistic” and “pessimistic” locking?
What are the differences between clr & cts?
How can you use a custom controls in ASP.NET application?
In which event of the page life cycle, is the viewstate available?
Can you explain why it is useful to use mvc instead of webforms? : asp.net mvc
Tell me how asp.net mvc differs from asp.net web forms? : asp.net mvc
What does clearing cache?
For which does this Codebehind="MyCode.aspx.cs" is relevent to ?
Explain difference betn dataset and recordset?
What is HTTPModule and HTTPcontext? What is the use of each?
How you will handle session when deploying application in more than a server?
What parameters can you pass in the url of the api? Can get and post use the same url?
How you can manage the state of application at the server side in ASP.NET?