sql - Best Way to Read Lisbox Array -


I am using a SQL query to retrieve data and write in a list box. However, sometimes an item may have more than one value "Patient Disclosure" value: "Encounter"

or

Data: "Patient disclosure" value: "Order"

In the list box, the line item will only show "patient disclosure" but the values ​​I have have been written in the array. However, I do not want two of the same line item to appear. The "order" value should look only one, there are many values ​​in it, how can I do it?

  while the reader Read (2)} 'if the reader (2) = "order" (with the new values), read () Dim Myethum as the new list (Myitems) Myitem.Add (with new values) Then 'List' box 1 Items.ed (Maiteum Teore) 'Other' listbox 1 ITEM Add (reader (0)) 'End if listBox1.Items.AddRange (Myitem.ToArray) when finished    

You can end the duplicate with

  listBox1.Items.AddRange (" Myitem.Distinct "). ToArray ())   

However, I'm not sure what you are asking me is that instead of creating a data, instead of working directly with the data reader, Creating a category that holds the data, give it more descriptive names than myitems as you've already done. As developers, we are continuously working with many types of "items".

  public class patient // or whatever item should be represented. String public override function to string as string public property value as string public property value () as string return string. Format ("description = {0}, value = {1}", description, value) and function and class  / pre> 

If you type patient object to ListBox to display items, then ListBox will automatically use ToString .

You can also override similar and GetHashCode to affect the way that two objects are compared. To do this, the specific method will use these two methods:

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -