Why DataColumn.DefaultValue is null
-
I'm using OleDBCommand.ExecuteReader(CommandBehavior.KeyInfo) Now, in the result DataTable, columns that have default values set in database, appears with DefaultValue property equal DBNull.Value I tried everything; every CommandBehavior, dealing with SQl Server or MS Access, using DataAdapter instead of DataReader,... but no way :(((( Pleaaaaaaaase help
-
I'm using OleDBCommand.ExecuteReader(CommandBehavior.KeyInfo) Now, in the result DataTable, columns that have default values set in database, appears with DefaultValue property equal DBNull.Value I tried everything; every CommandBehavior, dealing with SQl Server or MS Access, using DataAdapter instead of DataReader,... but no way :(((( Pleaaaaaaaase help
Hi all, I got it use OleDbConnection.GetOleDbSchemaTable Method ... don't ask me whyyyyyy Microsoft does that anyway.. here is an example: DataTable SchemaTable = connection.GetOleDbSchemaTable( OleDbSchemaGuid.Columns, new object[] { null, null, "Employees", null }); you will find a column in "SchemaTable" datatable with name "Column_Default" Good Luck
-
I'm using OleDBCommand.ExecuteReader(CommandBehavior.KeyInfo) Now, in the result DataTable, columns that have default values set in database, appears with DefaultValue property equal DBNull.Value I tried everything; every CommandBehavior, dealing with SQl Server or MS Access, using DataAdapter instead of DataReader,... but no way :(((( Pleaaaaaaaase help
Now I have a new problem... The retrieved value for Default Value is not in a usable format, it is retrieved as it is stored in database for example: In SQL Server, nvarchar field's default value is stored as follow ('value') or (N'value') In MS Access, Text field's default value is stored as follow "value" Now, how can I get the value without quotes regardless of database type