G
Guest
Greetings,
Developing some code that will do a specialized database regen. We use the following to extract the schema
as it currently stands.
Dim sqlText As String = "SELECT * FROM " & tblname
Dim da As New SqlDataAdapter(sqlText, cnx)
Dim dt As New DataTable(" & dblquotes & tblname & dblquotes & ")
da.FillSchema(dt, SchemaType.Source)
we then loop through the columns using something like:
Dim col As DataColumn
dim vDefault as object
For Each col In dt.Columns
vDefault = col.defaultvalue
Next col
We don't get anything from the col.default value, when we can see that the actual SQL Server table that this
was pulled from has default values for a number of items.
What gives?
Developing some code that will do a specialized database regen. We use the following to extract the schema
as it currently stands.
Dim sqlText As String = "SELECT * FROM " & tblname
Dim da As New SqlDataAdapter(sqlText, cnx)
Dim dt As New DataTable(" & dblquotes & tblname & dblquotes & ")
da.FillSchema(dt, SchemaType.Source)
we then loop through the columns using something like:
Dim col As DataColumn
dim vDefault as object
For Each col In dt.Columns
vDefault = col.defaultvalue
Next col
We don't get anything from the col.default value, when we can see that the actual SQL Server table that this
was pulled from has default values for a number of items.
What gives?