Sajan

Hi,

I have One Datatable it's called Emp....It's Contains 5 columns...

for example..

X X1 X2 X3 X4

1 2 3 4 5

1 2 4 5 4

1 2 3 4 4

1 2 3 4 5

i want fetch the Data from Emp....Which have no duplicate data..

the condition column is X3.......

ans :

1 2 3 4 5

1 2 4 5 4

Thanks & Regards,

S.Sajan



Re: Visual C# General how to fetch the data from DataTable

Barry Andrew

Hi,

You could use SELECT DISTINCT for this, check out books online or the following link for an example;
http://msdn2.microsoft.com/en-us/library/aa259187(sql.80).aspx




Re: Visual C# General how to fetch the data from DataTable

Sajan

Hi Barry Andrew,

Thanks for ur reply..

That is available in Sql server .. But i am asked in C#.net with asp.net

Thanks & Regards,

S.Sajan





Re: Visual C# General how to fetch the data from DataTable

Manivannan.D.Sekaran

can you pls validate the sample.. its not found rite (or I can't able to understand the logic behind that..)




Re: Visual C# General how to fetch the data from DataTable

Sajan

Hi Manivannan.D.Sekaran,

I have One Datatable its called Emp..It Contains many values. ref the following structure

X1 X2 ----Column name

1 2

2 3

1 2

2 3 -----Values

2 3

1 4

Before that this datatable is not Sqlserver table it server side Datatable(C#).ok

i want get the values form Emp.Result contains only unique values(not duplicated)

i want following output

X1 X2

1 2

2 3

1 4

Thanks & Regards,

S.Sajan





Re: Visual C# General how to fetch the data from DataTable

Arnie Rowland

Since you seem to be SURE that this is NOT a SQL Server question, I suggest that you post to one of the C# forums.