Click here to Skip to main content
14,332,103 members
Rate this:
Please Sign up or sign in to vote.
See more:
hi...

i have the following code which retrives all duplicate values into my dropdownlist(ddl) but i want the distinct values
 if (dtTmp.Rows.Count > 0)
               {
                   if (dtTmp.Columns.Contains(tc.Text))
                   {
                       ddl.DataSource = dtTmp.DefaultView.
                       ddl.DataTextField = tc.Text;
                       ddl.DataValueField = tc.Text;
                       ddl.DataBind();
                   }
}

dtTmp is my datatable where i get the datafrom stored procedure pls tell we how to get distinct values to my dropdown
Posted
Updated 10-Jun-12 21:06pm
v2
Rate this:
Please Sign up or sign in to vote.

Solution 2

Can you please have a look at this [link]
   
Comments
VJ Reddy 11-Jun-12 4:11am
   
Good reference. 5!
Rate this:
Please Sign up or sign in to vote.

Solution 1

select distinct * from datatablename

use the above sql query to get distinct valus from database
   
Comments
Member 8983639 11-Jun-12 2:50am
   
i already had my datatable which was retrived from oracle storedprocedure now i need to get distinct values from the datatble and bind to dropdowlist......:(

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100