Click here to Skip to main content
15,896,557 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi...

i have the following code which retrives all duplicate values into my dropdownlist(ddl) but i want the distinct values
C#
 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

Can you please have a look at this [link]
 
Share this answer
 
Comments
VJ Reddy 11-Jun-12 4:11am    
Good reference. 5!
select distinct * from datatablename

use the above sql query to get distinct valus from database
 
Share this answer
 
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, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900