quincunxian 0 Newbie Poster

Context:
I am trying to Query a MS SQL CE database for the properties of table columns.
I can get a list of tables from the Schema and from that, the column names.

Issue:
I can retrieve properties for some column elements but some do not return a correct value.
The specific thing I am trying to resolve is the nvarchar(n) length and a way
to determine the difference between an nText data type and a nvarchar data type.
the method below always returns "string" for both types. (column.DataType.Name)

Sample Code:

Dim column As DataColumn
 For Each column In DB.SQLDataTable.Columns ' Where SQLDataTable is the selected table.
   A = column.ColumnName '( This Works )
   B = column.DataType.Name '( This works )
   C = column.MaxLength '( this always returns -1 regardless of column data type )
   D = column.Unique '( this always returns False even for primary key auto inc types)
   E = column.AutoIncrementSeed '( this always returns 0 ) ( actual is 1 )
   F = column.AutoIncrementStep '( this always returns 1 ) ( default used)
   G = column.DefaultValue '( This always returns {empty})
   H = column.AllowDBNull '( This always returns False )
 Next

Elsewhere in the application I can add/change/delete records without issue
I am using the native Database Explorer/Editor for VB.net 2010 Express to create the tables.
The display in the database explorer shows the correct parameter settings for each column.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.