Subscribe to Subscribers
Talk to Webmaster Tony John


Forums » .NET » Windows »

Not getting the value of listbox value when i used for loop


Posted Date: 23 Nov 2009      Posted By:: sarayu     Member Level: Gold    Member Rank: 1310     Points: 1   Responses: 2



HI all,

Here i am working with windows application, i am using list box and saving the multiple list box selected items in to data base. this time i am writing the code like below but its not giving the value of list box

for (int j = 0; j < lstsubProduct.Items.Count; j++)
{
string subp = lstsubProduct.Items[j].ToString()

}

for the string supp its giving the value like System.Data.DataRowView instead of original value.

Please help me....

thank you..




Responses

#445954    Author: Mohan      Member Level: Gold      Member Rank: 101     Date: 23/Nov/2009   Rating: 2 out of 52 out of 5     Points: 2

try this

for (int j = 0; j < lstsubProduct.Items.Count; j++)
{
string subp = lstsubProduct.Items[j].value.ToString()

}

Regards

Mohan Kumar.D



 
#445973    Author: MuhiReks      Member Level: Gold      Member Rank: 76     Date: 23/Nov/2009   Rating: 2 out of 52 out of 5     Points: 2

try this way

string subp;
for (int j = 0; j < lstsubProduct.Items.Count; j++)
{

if( lstSubProduct.Selected=true)
{
subp += lstsubProduct.Items.Items[j].ToString()
}

}


hope this help!

thnx
Muhil



 
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 : Want updates of IMAPI version 2 for Windows XP Service pack 2.
Previous : Creating nodes dynamically...
Return to Discussion Forum
Post New Message
Category:

Related Messages



Follow us on Twitter: https://twitter.com/dotnetspider

Active Members
TodayLast 7 Daysmore...

Awards & Gifts
Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India
2005 - 2012 All Rights Reserved.
.NET and other trademarks mentioned in this site belong to Microsoft and other respective trademark owners.
Articles, tutorials and all other content offered here is for educational purpose only.
We are not associated with Microsoft or its partners.