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 type of code, client-side or server-side, is found in a code-behind file of a Web page?
What are session cookies?
Which property needs to be set for script manager control to extend the time before throwing time out expection if no response is received from the server?
How can you handle errors in Web API?
Will session work if cookies is disabled?
What is asp.net web application?
What is windows active directory authentication?
How to create multi language website in asp.net mvc? : Asp.Net MVC
What is the difference between a multi-layer and multi-tier applications?
What is the difference between CLICK and MOUSE DOWN Event ?
To get the values in two different controls to match which control you use it?
What do you understand by aggregate dependency?
What is active web pages?
Is it possible to write code in many languages in one asp.net project?
Why is string called immutable data type?