Click here to Skip to main content
15,894,017 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Everyone,


My task sending a message based on datarow value in c#.

i have table like this,

IHNo Warrant Folio
1 112 222
2 113 222
3 114 333
4 115 444
5 116 444

in this table i have to send message based on Folio value ,but in this duplicate folios are there ,i want to do looping based on folio number ,using datarow dr & dttable check the entire table if there exists same folio number ,second folio is same ,then "A" message send to 222 member ,then folioNO:333 is only one then other "B" message to 333 member ,then "C" message send to 444 member.

My question is "A","C" message send only one time but not two times.or will not send duplicate message

any one send me code ,i tried code but not working

Thanks...
Posted
Comments
Jameel VM 22-Aug-13 1:33am    
can u post the code you have tried?
CodeBlack 22-Aug-13 1:51am    
why "C" message send to 444 member ? couldnt it be "A" message send to 444 member ?

1 solution

Select distinct rows from the collection and then loop through it.the below code helps u to get the distinct rows
C#
DataView view = new DataView(datatable);
DataTable distinctValues = view.ToTable(true, "Folio");


Hope this helps
 
Share this answer
 

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