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
Explain about the Class view window?
What's the ASP.Net Application life cycle?
Define static member?
What is a reflection?
What are the new login controls in asp.net 2.0?
What is AutoPostback?
How many types of sessions are there in asp net?
What tags do you need to add within the asp:datagrid tags to bind columns manually? Give an example.
Which .NET framework supports Web API?
How do cookies work? Give an example of their abuse.
What is bound controls
How can we create pie chart in asp.net?
What is in a session cookie?
Why do we need Sessions?
What is Bundling and Minification in MVC?