Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#2.0 ASP.NET
Please help me when we have same values in single column n we wanna retrieve that repeated value only once n wanna display in our check box.
Posted 27-May-12 23:10pm
Shantii306
Comments
willington.d at 28-May-12 4:28am
   
Can you please give more explanation or Example?
Sandeep Mewara at 28-May-12 4:51am
   
Not too clear. Elaborate please.
Prasad_Kulkarni at 28-May-12 5:05am
   
Need more explanation Shantii.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

use sql quary like "select distinct(id) from sample " and assign the retrived id to checkbox
ex:
da = New SqlDataAdapter("select distinct( name) from sample", con)
       ds = New DataSet()
       da.Fill(ds)
       CheckBox1.Text = ds.Tables(0).Rows(0)(0).ToString()
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Ya
 
You can use following Query
 
select distinct( columnname) from tableName
 
but if Records are more then 1 then how you display value in checkbox??
 
i think you want to do some other thing..
 
please clearify.?? if yes
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 230
1 PIEBALDconsult 150
2 DamithSL 125
3 BillWoodruff 108
4 Garth J Lancaster 90
0 OriginalGriff 5,790
1 DamithSL 4,601
2 Maciej Los 4,012
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,195


Advertise | Privacy | Mobile
Web01 | 2.8.141220.1 | Last Updated 28 May 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

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