DataTable rows
-
Hi All, I have a datatable with som rows. for example : activity date time a 01-01-07 12:00 b 01-01-08 13:00 c 01-01-07 12:00 As you can see, activity a and c have the same date and time. Now i have to filter those rows from the datatable and set them into a textbox. So how can i compare all rows with eachother and if they have the same date and time, then show them in a textbox???? Thanx.
-
Hi All, I have a datatable with som rows. for example : activity date time a 01-01-07 12:00 b 01-01-08 13:00 c 01-01-07 12:00 As you can see, activity a and c have the same date and time. Now i have to filter those rows from the datatable and set them into a textbox. So how can i compare all rows with eachother and if they have the same date and time, then show them in a textbox???? Thanx.
In the RowCreated event of GridView match each row from datatable to that of the time in the new created row. if it matches show it in textbox else leave it as it is. Take care that the activity is not matching.
-
In the RowCreated event of GridView match each row from datatable to that of the time in the new created row. if it matches show it in textbox else leave it as it is. Take care that the activity is not matching.
Hi Anoop, Thanx for reply...wich gridview??? i don't use a gridview. it is a datatable from sqlserver table.
-
Hi All, I have a datatable with som rows. for example : activity date time a 01-01-07 12:00 b 01-01-08 13:00 c 01-01-07 12:00 As you can see, activity a and c have the same date and time. Now i have to filter those rows from the datatable and set them into a textbox. So how can i compare all rows with eachother and if they have the same date and time, then show them in a textbox???? Thanx.
Hi, Something like this might do it for ya... DataRow[] _dataRow1; DataRow[] _dataRow2; foreach(DataRow dr1 in whateverYouCalledThis.Rows) { _dataRow1 = dsYourDataSet.Tables[0].Select(“date”); foreach(DataRow dr2 in _dataRow) { _dataRow2 = dsYourDataSet.Tables[0].Select(“time”); } this.txtDate = _dataRow2[0]["date"].ToString(); this.txtTime = _dataRow2[0]["time"].ToString(); } I'm sure there are better ways to do this :) ~j