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: [email protected] ReportedBy: [email protected] QAContact: [email protected] 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. _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
