Share

Manage DB schema using XSD

Tracker: Bugs

5 SqlDataSchemaAdapter.GetTypeFor fails to recognise text type - ID: 1193974
Last Update: Settings changed ( uritsukidoji )

When an xsd is constructed by XMLSpy (and possibly
other tools), a text type is represented (under certain
options) as xs:string with a maxlen of 2147483647.
GetForType does not catch this, and when the syntax
string is executed, an error occurs since varchars are not
supposed to be over 8000.

Recommend changing (in SqlDataSchemaAdapter,
protected override string GetTypeFor(DataColumn
column) ):

if ((column.DataType == typeof (String)) &&
((column.MaxLength < 0))

to:

if ((column.DataType == typeof (String)) &&
((column.MaxLength < 0) || (column.MaxLength >8000)) )

this will ensure that the type text will catch anything over
8000.

Please see attached file, line 121


R Moore ( scporich ) - 2005-05-02 18:38

5

Open

None

Wiebe Tijsma

None

None

Public


Comments




Log in to comment.

No follow-up comments have been posted.

Attached File ( 1 )

Filename Description Download
SqlDataSchemaAdapter.cs SqlDataSchemaAdapter.cs with proposed changes Download

Changes ( 2 )

Field Old Value Date By
assigned_to nobody 2005-12-01 09:22 uritsukidoji
File Added 132674: SqlDataSchemaAdapter.cs 2005-05-02 18:38 scporich