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?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / sathish
On select change event of the list box use the following code.
Dim con as new sqlconn("connectionstring")
con.open()
dim da as sqlda("select * from table where cityname=" &
listbox1.selecteditem)
dim ds as new dataset
da.fill(ds)
| Is This Answer Correct ? | 5 Yes | 1 No |
Answer / yogaraj i
protected void ddlcity_SelectedIndexChanged(object sender,
EventArgs e)
{
if (ddlcity.SelectedValue == "Any of the city name")
{
DataSet ds = GetUserInfo();
GridviewCitycity.DataSource = ds;
GridviewCity.DataBind();
}
}
| Is This Answer Correct ? | 2 Yes | 4 No |
What is meant by web application?
on modify statement, executeNonQuery returns zero rows affected even though there has been modification carried out sucessfully in the table.. can anyone tell me is this possible??? if yes, how..???
Explain Apache web servers ? How can you get ASP.NET running in Apache web servers - why should you do this?
Which authentication uses a combination of windows and iis authentication?
What is caching? What are different ways of caching in asp.net?
what is use to destroy an object? illustrate.
What is Web Gardening? How would using it affect a design ?
Webconfig file is cofiguration of server or browser?
Explain the asp.net mvc request life cycle? : asp.net mvc
How many types of session in asp.net2.0
28 Answers ABC, DOT, First Europa, HCL, iRely, TCS,
What?s the difference between Response.Write() and Response.Output.Write()?
2 Answers Siebel, Visual Soft,
Can we use the java script code in .Net Code behind?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)