Asp.Net News
Free Tech Magazines
Asp.Net Web Hosting
Suggest Us
Link to Us
Feeds Subscription
Questions & Answers
Tips & Tricks
  for Gridview
Posted by RAVI KHARVI on  5/9/2008 6:45:17 AM Category: Asp.Net 2.0
Add to my favorites
Email to friend
my intention is i want to fill the data set with different tables from a database using different adapters. the tablenames filled in dataset has to be added into dropdownlist items.
when ever a tablename selected from dropdownlist the correspondin information should display in gridview.if there is any modifications the table has to update the changes made by user n need to bind gridview. please anyone could help me .plzzz its urgent

Post Your Reply Post New Question

 Viewer's Reply
hi this is raju from rjy
Answered By boda.raju on 5/13/2008 2:04:56 PM
hi , first ur selected tables in dropdownlist dynamically(ie, through properties) then write
code under dropdownlist

string tab = DropDownList1.SelectedItem .ToString();
SqlConnection cn = new SqlConnection("Data Source=AMSOL-601;Initial Catalog=bn.raju;User ID=sa");
SqlDataAdapter da = new SqlDataAdapter("select *from " + tab + "", cn);
DataSet ds = new DataSet();
da.Fill(ds, "exa");
GridView1.DataSource = ds;
Post Your Reply If you still have problem, post it again under this reply for better response.

Sponsored by
Programmers Heaven C# School Book - Free 338 Page eBook
No Nonsense XML Web Development With PHP - Free 146 Page Preview!
Backup and Recovery Best Practices for Microsoft SQL Server 2005