Click here to Skip to main content
11,480,031 members (68,477 online)
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 235
1 Sergey Alexandrovich Kryukov 215
2 Richard MacCutchan 100
3 F-ES Sitecore 75
4 DamithSL 65
0 Sergey Alexandrovich Kryukov 7,890
1 OriginalGriff 7,556
2 Sascha Lefèvre 3,064
3 Maciej Los 2,491
4 Richard Deeming 2,335


Advertise | Privacy | Mobile
Web03 | 2.8.150520.1 | Last Updated 28 May 2012
Copyright © CodeProject, 1999-2015
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