[Mono-devel-list] [PATCH] bug in System.Data.Common.DbDataAdapter.Fill(DataSet dataset, DataTable srcTable, IDataReader dataReader, int startRecord, int maxRecords)
eran
erand at mainsoft.com
Mon Sep 22 07:29:30 EDT 2003
Hi,
This is a bug I found in System.Data.Common.DbDataAdapter.Fill(DataSet
dataset, DataTable srcTable, IDataReader dataReader, int startRecord,
int maxRecords).
Steps to reproduce the problem:
Create a SqlDataAdapter. Add a select command to the adapter ("SELECT
ID, NAME from table1")
Create a DataSet. Add a table that has exactly the same schema as the
select command in the adapter (column ID with int DataType, column NAME
with string DataType).
Add a TableMapping to the adapter - adapter.TableMappings.AddRange(new
System.Data.Common.DataTableMapping[] {new
System.Data.Common.DataTableMapping("Table", "table1", new
System.Data.Common.DataColumnMapping[] {new
System.Data.Common.DataColumnMapping("ID", "ID"), new
System.Data.Common.DataColumnMapping("NAME", "NAME")})});
Fill the DataSet (adapter.Fill(DataSet)).
Actual Result:
NullReferenceException is thrown.
Expected Result:
The existing DataTable should be filled with the data from the database.
Enclosed is a small test and a patch.
Thanks
Eran Domb
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20030922/d1fb8d5a/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DbDataAdapter.cs.diff
Type: application/octet-stream
Size: 1229 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20030922/d1fb8d5a/attachment.obj
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: TestCase.cs
Url: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20030922/d1fb8d5a/attachment.pl
More information about the Mono-devel-list
mailing list