|
-
May 13th, 2013, 04:21 PM
#7
Re: How to get values from listview and display it to textbox using sql database ?
If you're using a TextBox, there's only one way you can display all the data without setting the MultiLine property to true for that control--use delimeters for each piece of data. So you would append to the Text with one value, add a comma, and next time around, add another bit of the data. Otherwise add to a collection and use String.Join() to avoid having to check for the last element or having to remove the last comma or whatever at the end...
Otherwise, you'll be writing each piece of data on a newline. When you just use the plain assignment operator, you are replacing the existing data in the textbox with another string value. So you're definitely not going to have all of the data there by the last time you assign a value to this property. Depending on how large the data is too, you may want to consider a StringBuilder before you abuse "+=".
I still don't get what you're expecting to happen though. You need to clarify that in more detail. I see in the image "Brand" and "Description", which would indicate to me that these are single values. So perhaps you are trying to loop through a data collection for a single value? I don't understand how you want a bunch of data to fit in those (single line?) textboxes... And especially for the overall size of those controls. There's not a lot of "view" space there...
~Ace
<<<------------
.NET Programming (2012 - 2018)
®Crestron - DMC-T Certified Programmer | Software Developer <<<------------
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|