Click here to Skip to main content
15,913,487 members
Home / Discussions / C#
   

C#

 
GeneralRe: Problems with TabControl & XP Visual Styles Pin
Heath Stewart26-Jan-03 11:36
protectorHeath Stewart26-Jan-03 11:36 
GeneralRe: Problems with TabControl & XP Visual Styles Pin
A.Wegierski26-Jan-03 19:15
A.Wegierski26-Jan-03 19:15 
GeneralRe: Problems with TabControl & XP Visual Styles Pin
A.Wegierski28-Jan-03 2:36
A.Wegierski28-Jan-03 2:36 
Questionif you could code one language for the rest of your life...what would it be ? Pin
jtmtv1825-Jan-03 17:44
jtmtv1825-Jan-03 17:44 
AnswerRe: if you could code one language for the rest of your life...what would it be ? Pin
leppie25-Jan-03 21:17
leppie25-Jan-03 21:17 
AnswerRe: if you could code one language for the rest of your life...what would it be ? Pin
Heath Stewart25-Jan-03 22:28
protectorHeath Stewart25-Jan-03 22:28 
AnswerRe: if you could code one language for the rest of your life...what would it be ? Pin
SimonS27-Jan-03 3:59
SimonS27-Jan-03 3:59 
Questioncreating an object? Pin
jinz25-Jan-03 11:27
jinz25-Jan-03 11:27 
AnswerRe: creating an object? Pin
Jeff J25-Jan-03 11:40
Jeff J25-Jan-03 11:40 
QuestionHow to get the index of a DataRow in a DataTable? Pin
lnong25-Jan-03 11:15
lnong25-Jan-03 11:15 
GeneralTreeNode checking Pin
Member 18598625-Jan-03 9:42
Member 18598625-Jan-03 9:42 
GeneralRe: TreeNode checking Pin
leppie25-Jan-03 10:52
leppie25-Jan-03 10:52 
GeneralRe: TreeNode checking Pin
Member 18598625-Jan-03 11:11
Member 18598625-Jan-03 11:11 
GeneralRe: TreeNode checking Pin
leppie25-Jan-03 11:35
leppie25-Jan-03 11:35 
GeneralRe: TreeNode checking Pin
Jeff J25-Jan-03 11:32
Jeff J25-Jan-03 11:32 
GeneralRe: TreeNode checking Pin
Member 18598625-Jan-03 11:51
Member 18598625-Jan-03 11:51 
Generalreflection Pin
jtmtv1825-Jan-03 6:21
jtmtv1825-Jan-03 6:21 
GeneralRe: reflection Pin
leppie25-Jan-03 6:43
leppie25-Jan-03 6:43 
Generalleppie read this...(or anyone) Pin
25-Jan-03 10:23
suss25-Jan-03 10:23 
GeneralRe: leppie read this...(or anyone) Pin
leppie25-Jan-03 22:34
leppie25-Jan-03 22:34 
GeneralRe: leppie read this...(or anyone) Pin
James T. Johnson26-Jan-03 6:11
James T. Johnson26-Jan-03 6:11 
GeneralRe: leppie read this...(or anyone) Pin
Paul Riley26-Jan-03 5:29
Paul Riley26-Jan-03 5:29 
GeneralDataRow problem Pin
Mr BallyDaHob25-Jan-03 5:54
Mr BallyDaHob25-Jan-03 5:54 
Hi all,
The function below is used to filter out messages in a DataSet depending on wheather they are between the two dates; "DateTime from" and "DateTime to".
The date of the message is the first column of each row.
(logDataSet is a global variable)

I'm having trouble with this line:
tempDS.Tables["Table"].Rows.Add(logDataSet.Tables["Table"].Rows[i]);
in the below code.
I get the following exception:
"System.ArgumentException
This Row already belongs to another table"

Also, I have tried creating an copy of the DataSet logDataSet (DataSet tempDS = logDataSet), but when I delete rows from the copy it seems to also delete these rows from the global DataSet logDataSet.

Does anyone have any ideas where I am going wrong?
Thanks,
Donal


<br />
// <summary><br />
/// Filters error messages in a data set by their date. But must not change the the original DataSet logDataSet<br />
/// </summary><br />
/// <param name="from">The date from which to filter</param><br />
/// <param name="to">The date to which to filter to</param><br />
/// <returns>A new filtered DataSet</returns><br />
private DataSet filterDates(DateTime from, DateTime to)<br />
{<br />
	//Algorithm for filtering out dates<br />
	DataSet tempDS = logDataSet.Clone();<br />
	for(int i=0;i < logDataSet.Tables["Table"].Rows.Count;i++)<br />
	{<br />
		DateTime fromTime = (DateTime)logDataSet.Tables["Table"].Rows[i][0];<br />
		DateTime toTime = (DateTime)logDataSet.Tables["Table"].Rows[i][0];<br />
		if( fromTime.Date >= from.Date &&  toTime.Date <= to.Date)<br />
		{<br />
			tempDS.Tables["Table"].Rows.Add(logDataSet.Tables["Table"].Rows[i]);<br />
		}<br />
	}<br />
	return tempDS;<br />
}

GeneralRe: DataRow problem Pin
leppie25-Jan-03 6:38
leppie25-Jan-03 6:38 
QuestionIntegrating Flex with C#??? Pin
anjana25-Jan-03 5:34
anjana25-Jan-03 5:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.