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 state management technique?
Describe the application event handlers in ASP.NET?
what are configuration files?
Differentiate between client-side and server-side validations in web pages.
Where session variables are stored?
What is web router?
Is session stored in browser?
What is synchronous and Asynchronous post back ?
Why we go for mvc instead of asp.net? : Asp.Net MVC
Can I have a unique key as foreign key?
Difference between singleton and singlecall.
How will you load dynamic assembly? How will create assesblies at run time?
Explain the path instructions in xaml?
Describe a Windows Service and its lifecycle ?
Does web services support data reader like pom project?