Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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



One Listbox showing all cities. If you select one city in list box the information related to that ..

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

One Listbox showing all cities. If you select one city in list box the information related to that ..

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

One Listbox showing all cities. If you select one city in list box the information related to that ..

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

Post New Answer

More ASP.NET Interview Questions

Which adapter should you use, if you want to get the data from an access database?

0 Answers  


when the threads are used in dot net.

2 Answers  


How do I force the dispose method to be called automatically, as clients can forget to call dispose method?

0 Answers  


How ViewstateMac works?

0 Answers   CGI,


Where do the cookie state and session state information be stored?

0 Answers  


Is asp.net outdated?

0 Answers  


Explain the difference between dataset and datareader.

0 Answers  


How long do session variables last?

0 Answers  


How can u debug your .net application?

0 Answers  


Define static function?

0 Answers  


Have you used microsoft dataaccess blocks and Exception blocks?

1 Answers   Microsoft,


extensibility in asp.net2.0

0 Answers  


Categories