toanhoi bui

toanhoi bui

  • NA
  • 70
  • 207.1k

Remove data into a datagridview

Feb 21 2011 9:45 AM
 Hello, everybody .I have a question about database.Can you help me ,please.I have a datagridview which contain three cell are Name,ID,Time
Name | ID   | Time
Toan | 123 | 7:00:01
Tien  | 122 | 7:00:02
Tuan |124  |7:00:03
Toan |123  |7:00:05
Tuan |124  |7:00:07
  I want to use C# and Sql to remove the first row Toan | 123 | 7:00:01 and Tuan |124  |7:00:07 because two rows have same data and if Name is same ,I will delete a row which has old time (Toan | 123 | 7:00:01
 and Toan | 123 | 7:00:05 the program will delete Toan | 123 | 7:00:01
)
After ,I will have a datagridview :
Name | ID   | Time
Tien  | 122 | 7:00:02
Toan |123  |7:00:05
Tuan |124  |7:00:07

 I am using C# to program but I don't write this code.Can you help me,please.Thanks you very much



Answers (2)