C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » ASP.NET »

Solve error in syntax


Posted Date: 27 Sep 2008      Posted By: chetan bhatt      Member Level: Silver     Points: 1   Responses: 5





ddl_min.SelectedIndex = index;

-------------------------
above syntax give error---
Cannot implicitly convert type 'string' to 'int'
---------------------





Responses

Author: Digvijay Singh    27 Sep 2008Member Level: BronzeRating: 1 out of 5     Points: 1

Hi
Index means int value,you can declare index as int,but no problem
you can use this
ddl_min.SelectedIndex = int.parse(index.Tostring();



Author: puneet    27 Sep 2008Member Level: BronzeRating: 1 out of 5     Points: 1

ddl_min.SelectedIndex = index.ToString();


Author: puneet    27 Sep 2008Member Level: BronzeRating: 1 out of 5     Points: 1

ddl_min.SelectedIndex = Convert.ToInt32(index);
sorry for last wrong reply !
Consider it only !



Author: Mithun    29 Sep 2008Member Level: SilverRating: 2 out of 52 out of 5     Points: 2

Wat is the datatype of 'index'.
DropDownList.SelectedIndex is int property.

if 'index' is string then use
Convert.ToInt32(index)



Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.


Next : Solve error in syntax
Previous : Solve error in syntax
Return to Discussion Forum
Post New Message
Category: ASP.NET

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use