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 is the difference between sealed vs static class?
What are client activated objects and server activated objects?
What is the page life cycle in asp.net?
How to display Alert in ASP.NET
How you will manage the state of ASP.NET controls?
how to write html code with ssl
Error : The operation couldn’t be performed because ole db provider sqlncli10 for linked server was unable to begin a distributed transaction.00000110 oledb provider for linked server returned message the partner transaction manager has disabled its support for remote/network transactions. I can able to execute the stored procedure in sql server but when i run the web page getting error like above. I did all the configuration. what is the solution?
What is microsoft windows sharepoint services?
Explain about asp.net 2.0 themes?
What is globalization and localization in asp net?
what is silver light when will we use silver light,
What can we do with asp.net?
Explain the difference between server control and html control.
What are the different web pages?
where can i gather the materials for MCP certification