[Mono-bugs] [Bug 655504] New: InvalidOperationException in System.Data.DataSetExtensions
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Tue Nov 23 09:07:06 EST 2010
https://bugzilla.novell.com/show_bug.cgi?id=655504
https://bugzilla.novell.com/show_bug.cgi?id=655504#c0
Summary: InvalidOperationException in
System.Data.DataSetExtensions
Classification: Mono
Product: Mono: Runtime
Version: 2.8.x
Platform: Other
OS/Version: Ubuntu
Status: NEW
Severity: Normal
Priority: P5 - None
Component: generics
AssignedTo: mono-bugs at lists.ximian.com
ReportedBy: r.shubovich at gmail.com
QAContact: mono-bugs at lists.ximian.com
Found By: ---
Blocker: ---
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.2.12)
Gecko/20101026 Firefox/3.6.12 ( .NET CLR 3.5.30729; .NET4.0E)
It is normal that CopyToDataTable routine fires InvalidOperationException when
no data rows returned from data sourse ?
My aspx pages never fires this exception under native (microsoft) environment.
I change routine as below and have no problems now:
public static DataTable CopyToDataTable<T> (this IEnumerable<T>
source)
where T : DataRow
{
DataTable dt = new DataTable ();
IEnumerator<T> e = source.GetEnumerator ();
if (e.MoveNext ())
{
// throw new InvalidOperationException ("The
source contains no DataRows");
foreach (DataColumn col in e.Current.Table.Columns)
dt.Columns.Add (new DataColumn (col.ColumnName,
col.DataType, col.Expression, col.ColumnMapping));
CopyToDataTable<T> (source, dt,
LoadOption.PreserveChanges);
}
return dt;
}
Reproducible: Always
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
More information about the mono-bugs
mailing list