One Listbox showing all cities. If you select one city in
list box the information related to that particular city
should be displayed in Datagrid . How do you do that?
Answer Posted / sathish
protected void ddlcity_SelectedIndexChanged(object sender,
EventArgs e)
{
sqlConnection con= new sqlConnection(" ");
string str="select * from table where city ='" +
ddlcity.SelectItem.Text ="'";
sqlDataAdapter da= new slqDataAdapter(str,con)
dataset ds = new dataset;
da.fill(ds,"City");
dgview.datasource=ds.tables["City"];
dgview.dataBind();
}
| Is This Answer Correct ? | 8 Yes | 1 No |
Post New Answer View All Answers
What are the two Layouts supported by a Web form in ASP.NET?
List down the sequence of methods called during the page load.
Define common type system?
How to store checkbox value in database in asp.net mvc? : Asp.Net MVC
What is the difference between custom web user control and a custom web server control?
How to find last error which occurred in Asp.net ?
When we use cookie less session? Explain its working?
Is asp.net and .net same?
Explain how does asp page work?
What is the difference between stored procedure vs function?
Define the term Scavenging in Caching?
What are the file extensions for razor views?
What is inproc and outproc?
Is session server side or client side?
What is preprocessor in .net?