Assign valuefield and textfield to listbox
<p>Hi Friends
 i develop a webpage in that i need to add value field and text field to listbox item 
i tried the following code ,  but it's not working , Please help me to solve the issue . 
Thanks in advance</p>

<pre><code> string[] category = new string[100];
            char[] delimeter = { '~' };
            category = Convert.ToString(dtable.Rows[0].ItemArray[5]).Split(delimeter);

            for (int h = 0; h &lt; category.Length; h++)
            {
                ListItem lstitem = lstCategory.Items.FindByText(category[h]);
                if (lstitem != null)
                {
                    lstSelCategory.DataTextField = category[h];
                    lstSelCategory.DataValueField = lstitem.Value;
                }
            }
            lstSelCategory.DataBind();
        }
</code></pre>
