This issue applies only to the 3.5.1 version of Wordwriter.
The IEnumerable overload of SetRepeatBlock causes a compilation error when passed a DataReader because DataReader inherits from both IDataReader and IEnumerable. This causes the compiler to not know which overloaded method to link.
The following code will produces a backwards compatibility issue when built against WordWriter v3.5.1.
C#
WordTemplate doc = new WordTemplate();
SqlDataReader dr = /* Get Data Reader */
doc.SetRepeatBlock( dr, "TableRow" );
VB.NET
Dim doc as new WordTemplate()
Dim dr as SqlDataReader = ' Get Data Reader
doc.SetRepeatBlock( dr, "TableRow" )
This code will produce the compilation error:
The call is ambiguous between the following methods or properties: 'SoftArtisans.OfficeWriter.WordWriter.WordTemplate.SetRepeatBlock(System.Data.IDataReader, string)' and 'SoftArtisans.OfficeWriter.WordWriter.WordTemplate.SetRepeatBlock(System.Collections.IEnumerable, string)' |