Commit Graph
30 Commits
Author SHA1 Message Date
Gert Driesen b8ff346173 * DbCommandBuilder.cs: Return a zero-length string when QuotePrefix or
QuoteSuffix are not set (or are set to null). Changing QuotePrefix or
QuoteSuffix after a command has been generated should result in an
InvalidOperationException.
* DbConnectionStringBuilder.cs: Added support for ODBC rules. Major
rewrite fixing many compatibility issues, and improving support for
connectionstring formats/characters.
* System.Data_test.dll.sources: Added OdbcCommandBuilderTest.cs,
OdbcConnectionStringBuilderTest.cs and DbCommandBuilderTest.cs.
* libodbc.cs: Add IdentifierQuoteChar to OdbcInfo.
* OdbcCommandBuilder.cs: Return a zero-length string when QuotePrefix
or QuoteSuffix are not set (or are set to null). Changing QuotePrefix
or QuoteSuffix after a command has been generated should result in an
InvalidOperationException. Implemented support for obtaining
character(s) for quoting identifiers from specified connection.
Modified generated SQL to match MS.
* OdbcConnectionStringBuilder.cs: Improved special casing of Driver
and Dsn keywords. Re-use implemenation of DbConnectionStringBuilder.
Improved argument checks to match MS.
* DbCommandBuilderTest.cs: Added tests for QuotePrefix and
QuoteSuffix.
* DbConnectionStringBuilderTest.cs: Added tests for both odbc and
non-odbc rules.
* OdbcCommandBuilderTest.cs: Added tests for QuotePrefix and
QuoteSuffix. Added tests for QuoteIdentifier (some still marked
NotWorking).
* OdbcConnectionStringBuilderTest.cs: Moved from ProviderTests.
Added and improved tests.

svn path=/trunk/mcs/; revision=122225
2008-12-30 03:41:45 +00:00
Gert Driesen a19e1c5f47 * libodbc.cs: Always use unicode version of ODBC functions. Fixes part
of bug #372823.
* OdbcTypeMap.cs: Fixed mapping for NChar, NText and NVarChar.
* OdbcDataReader.cs (GetColumn): Use Unicode encoding to decode
column name buffer.
(GetDataTypeName): Use SQLColAttribute to determine type name of
column.
(GetValue): Fixed retrieving value of nchar column. When retrieving
variable length unicode value, use Unicode encoding to decode buffer
and remove trailing null characters. Fixes bug #364430.

svn path=/trunk/mcs/; revision=98771
2008-03-21 21:00:55 +00:00
Gert Driesen 0f1a343ecd * OdbcTransaction.cs: Use OdbcIsolationLevel enum value instead of
magic numbers. For Snapshot isolation level, the attribute
SQL_COPT_SS_TXN_ISOLATION must be used instead. When isolation level
is Unspecified, then do not modify the isolation level at all and
lazy initlization the IsolationLevel property. Modified exceptions
for invalid / not supported isolation levels to match MS.
* libodbc.cs: Added attribute for changing SQL Server specific
connection option. Added enum for ODBC isolation level options.
Added SQLGetConnectAttr method.

svn path=/trunk/mcs/; revision=87827
2007-10-19 13:36:40 +00:00
Gert Driesen d9395404ce * libodbc.cs: Spaces to tabs. Code formatting.
* OdbcConnection.cs: Spaces to tabs. Code formatting.
* OdbcTransaction.cs: Code formatting.

svn path=/trunk/mcs/; revision=87815
2007-10-19 09:06:25 +00:00
Nagappan Alagappan cc7d5ea7c9 2007-09-25 Nagappan A <[email protected]>
* OdbcParameter.cs (ResetOdbcType, ResetDbType): Implemented
	missing methods. 2.0 attribute fixes.

	* OdbcInfoMessageEventArgs.cs (Message, Errors, ToString):
	Implemented missing properties and methods. 2.0 attribute fixes.

	* OdbcConnection.cs (InfoMessage): Added public event and relevant
	private APIs. 2.0 attribute fixes.

	* OdbcConnectionStringBuilder.cs: 2.0 attribute fixes.

	* OdbcParameterCollection.cs (GetParameter, SetParameter):
	Implemented missing 2.0 APIs and 2.0 attribute fixes.

	* OdbcDataReader.cs (finalize): 2.0 compatibility fixes.

	* OdbcPermission.cs (Add): 2.0 compatibility fixes.

	* OdbcCommandBuilder.cs: 2.0 attribute fixes.

	* OdbcRowUpdatingEventArgs.cs (BaseCommand): Added 2.0 property.

	* OdbcCommand.cs: 2.0 attribute fixes.

	* OdbcException.cs: 2.0 attribute fixes.


svn path=/trunk/mcs/; revision=86300
2007-09-25 07:15:03 +00:00
Nagappan Alagappan fdffb9c8c5 2007-07-31 Nagappan A <[email protected]>
* OdbcCommandBuilder.cs: Removed bogus TODO.
	  Fixed 2.0 missing attributes

	* libodbc.cs: Added new libodbc global constant SQL_NTS.

	* OdbcCommand.cs (ExecSQL): Thanks to [email protected] (amc) for
	  providing the patch, Fixes bug # 82191. ODBC command UTF8
	  error. SQL failed with UTF8 symbols in query.
	  Removed bogus TODO.
	  Fixed 2.0 missing attributes


svn path=/trunk/mcs/; revision=83051
2007-07-31 07:17:44 +00:00
Nagappan Alagappan 759558aaf9 2007-05-04 Nagappan A <[email protected]>
* libodbc.cs: Wrong ODBC API definitions (using ints instead of
	shorts) - Fixes bug 81306. Thanks to [email protected] and
	[email protected].

	* OdbcDataReader.cs: Wrong ODBC API definitions (using ints
	instead of shorts) - Fixes bug 81306. Thanks to
	[email protected] and [email protected].


svn path=/trunk/mcs/; revision=76657
2007-05-04 04:25:27 +00:00
Nagappan Alagappan b43e30daeb 2007-02-09 Nagappan A <[email protected]>
* OdbcDataReader.cs, libodbc.cs, OdbcParameterCollection.cs,
	  OdbcConnectionStringBuilder.cs, OdbcFactory.cs, OdbcInfoMessageEventArgs.cs,
	  OdbcMetaDataCollectionNames.cs, OdbcMetaDataColumnNames.cs: Reverted the patches.


svn path=/trunk/mcs/; revision=73243
2007-02-21 10:28:03 +00:00
Nagappan Alagappan f4eba8efe6 2007-02-02 Amit Biswas <[email protected]>
* OdbcInfoMessageEventArgs.cs (ToString): Implemented new method.

	* OdbcParameterCollection.cs (AddRange, Insert, AddWithValue)
	(Remove, Contains, CopyTo): Implemented missing .NET 2.0 methods.

	* OdbcMetaDataCollectionNames.cs: Added new class for .NET 2.0
	profile.

	* OdbcMetaDataCollectionNames.cs (Equals): Implemented overloads
	methods.

2007-02-02  Nidhi Rawal  <[email protected]>

	* libodbc.cs: Imported a dll file for char datatype.
	
	* OdbcDataReader.cs (GetChar): Implemented the method and wrote
	a switch case for char data type in GetValue method..
	(GetDecimal): Implemented the method.
	
	* OdbcConnectionStringBuilder.cs: Written the new class.

	* OdbcMetaDataColumnNames.cs: Written the new class.

	* OdbcFactory.cs (CreateConnectionStringBuilder): Implemented the method.

	* OdbcParameterCollection.cs (IndexOf): Implemented the method.


svn path=/trunk/mcs/; revision=73235
2007-02-21 07:52:20 +00:00
Senganal T 3afc3ef39e 2006-05-09 Senganal T <[email protected]>
* System.Data.Odbc/OdbcConnection.cs : Implemented ChangeDatabase Method
	* System.Data.Odbc/libodbc.cs : Added value for CurrentCatalog in OdbcConnectionAttribute 


svn path=/trunk/mcs/; revision=60432
2006-05-09 09:12:09 +00:00
Sureshkumar T 7e8897e50b 2005-10-08 Sureshkumar T <[email protected]>
* System.Data.dll.sources: added
	System.Data.Odbc/NativeBuffer.cs. native buffer pointer.

In System.Data.Odbc:

	* OdbcParameter.cs: re-implemented the native buffer handling and
	odbc type handling.

	* OdbcCommand.cs (BindParameters): Copy the parameter Value after
	binding.

	* NativeBuffer.cs: A native buffer class to hold pointer to native
	memory.

	* OdbcTypeMap.cs (OdbcTypeMap): structure to hold different odbc
	types and the default mapping.

	* OdbcTypeConverter.cs: Simplified mapping between different odbc
	types using switch-case.

	* libodbc.cs (SQLBindParameter): use only one entry point and use
	IntPtr instead of ref.


svn path=/trunk/mcs/; revision=51463
2005-10-08 10:08:20 +00:00
Sureshkumar T 8db91ad270 * OdbcDataReader.cs: GetSchemaTable (): set values for the column
attributes using SQLColAttribute. If SQLPrimaryKeys does not
	yeild, try SQLStatistics. Optimized primary key logic.

	* libodbc.cs: Added api SQLStatistics and constants.


svn path=/trunk/mcs/; revision=48167
2005-08-09 13:57:41 +00:00
Sureshkumar T d7571f6a6e 2005-04-05 Sureshkumar T <[email protected]>
* OdbcParameter.cs: SqlBindParameter requires the last parameter
	to be a ref.
	* libodbc.cs: API change for above.


svn path=/trunk/mcs/; revision=42553
2005-04-05 09:25:59 +00:00
Sureshkumar T fbf1f2c678 2005-03-22 Sureshkumar T <[email protected]>
Appsamy <[email protected]>

	* libodbc.cs (System.Data.Odbc): Added enum FieldIdentifier. Added
	library functions SQLPrimaryKeys, SQLBindCol and SQLColAttribute.

	* OdbcDataReader.cs: Implemented GetPrimaryKeys to get the primary
	keys associated with resultset using SQLPrimaryKeys.


svn path=/trunk/mcs/; revision=42071
2005-03-22 09:19:13 +00:00
Sureshkumar T b3148ef3a3 In .:
2005-03-10  Sureshkumar T  <[email protected]>

	* System.Data.dll.sources: Added
	System.Data.Odbc/OdbcTypeConverter.

In System.Data.Odbc:
2005-03-10  Sureshkumar T  <[email protected]>

	* OdbcType.cs: Added enums for SQL_TYPE & SQL_C_TYPE.
	
	* libodbc.cs: Accept SQL_C_TYPE for driver
	parameters. SQLBindParameter takes two parameters SQL_TYPE and
	SQL_C_TYPE. This caused the whole lot of changes done in this
	revision.
	
	* OdbcParameter.cs: Set default values of OdbcType & DbType. Pass
	mapped SQL_TYPE and SQL_C_TYPE to SQLBindParameter. Increase
	buffer size by 2 for additional ' chars.
	
	* OdbcTypeConverter.cs: Added class to convert between OdbcType,
	SQL_TYPE, SQL_C_TYPE.
	
	* OdbcColumn.cs: Added private members for SQL_TYPE and
	SQL_C_TYPE. conversion from/to odbctype to/from SQL_TYPE is done
	through OdbcTypeConverter class.
	
	* OdbcDataReader.cs: use OdbcColumn's SQL_C_TYPE member. It keeps
	track of default mapping between odbctype, SQL_TYPE and
	SQL_C_TYPE. Move dataTableSchema.AcceptChanges inside if condition
	to avoid null reference exception.


svn path=/trunk/mcs/; revision=41640
2005-03-10 09:13:45 +00:00
Sureshkumar T c577c68901 2005-02-04 Sureshkumar T <[email protected]>
Appasamy <[email protected]>

	* OdbcConnection.cs: Implemented properties database, datasource,
	serverversion and driver.
	* libodbc.cs: Added type OdbcInfo and native call SQLGetInfo.


svn path=/trunk/mcs/; revision=40134
2005-02-04 14:23:19 +00:00
Sureshkumar T 0d1e0487e4 2005-01-19 Sureshkumar T <[email protected]>
* OdbcType.cs: Change enum values for compatiability with MS.NET.
	* libodbc.cs: Change enum values for compatiability with
	MS.NET. Change calls into driver with native type.
	* OdbcDataReader.cs: Change enum values for compatiability with
	MS.NET. Change calls from/into driver with native type.


svn path=/trunk/mcs/; revision=39140
2005-01-19 09:05:15 +00:00
Sureshkumar T cc54e322fa 2005-01-13 Sureshkumar T <[email protected]>
* OdbcDataReader.cs: Implement NextResultSet for multiple result
	set queries. 
	
	* OdbcDataReader.cs: build column schema once creating reader and
	then for each Next result set. Thanks to
	[email protected] (Sebastien Robitaille) for
	pointing out this optimization (bugzilla #70530).

	* libodbc.cs: Added library calls SQLFreeStmt and SQLMoreResults
	for mutiple resultsets.


svn path=/trunk/mcs/; revision=38868
2005-01-13 12:40:08 +00:00
Sureshkumar T 2489990fda 2005-01-07 Sureshkumar T <[email protected]>
* OdbcDataReader.cs: Pass OdbcCType.SignedBigInt for accessing big
	int columns.

	* OdbcType.cs: Added a new enum for Odbc C DataTypes. This should
	essentially be passed to drivers, since the public OdbcType types
	differs from types expected in drivers in some cases.

	* libodbc.cs : Added a ODBC method which takes OdbcCType
	enumeration for SQLGetData for BigInt fields.

	fixes bug #65342.


svn path=/trunk/mcs/; revision=38485
2005-01-07 11:23:03 +00:00
Duncan Mak 41bba174eb 2004-12-28 Duncan Mak <[email protected]>
* libodbc.cs: Change all the DllImport attributes to point to
	"odbc32.dll" instead of "odbc32", because /etc/mono/config lists
	"odbc32.dll" (all other entries in the file have the .dll suffix
	as well, for consistency's sake, let's rename it here.)

	This fixes #70727.
	

svn path=/trunk/mcs/; revision=38151
2004-12-29 04:19:23 +00:00
Sureshkumar T 19abd41ef6 2004-06-23 Sureshkumar T ([email protected])
* OdbcConnection.cs: Fix: Moved env allocation to Open method.
                             Disconnection & freeing handles are done in Close
                             method to avoid simultaneous connections.
        * libodbc.cs       : Added constants for odbc version.

svn path=/trunk/mcs/; revision=30161
2004-06-23 05:19:59 +00:00
Sachin Kumar ec81df777c Add license and copyright to all source files in System.Data
svn path=/trunk/mcs/; revision=29688
2004-06-16 13:52:11 +00:00
Sureshkumar T 1193274a28 2004-06-16 Sureshkumar T ([email protected])
* OdbcDataReader.cs: Added GetValue support for Sql Binary type to return byte array.
                             Implemented GetBytes method.
        * libodbc.cs       : Added enums, constants & imports for above fix.

svn path=/trunk/mcs/; revision=29664
2004-06-16 06:23:05 +00:00
Miguel de Icaza 90dc9080fe Casting error bug fix: Applied patches from [email protected] (Jeff Seifert), that fix #49561
svn path=/trunk/mcs/; revision=19212
2003-10-20 18:36:36 +00:00
Daniel Morgan 052b38690e 2002-11-01 Daniel Morgan <[email protected]>
* OdbcDataReader.cs: - uncommented code, but
	I put a FIXME: according to Brian,
    this does not work on MS .NET
    however, we need it for Mono
    for now. schemaRow.AcceptChanges(),
    - implement IEnumerable.GetEnumerator()

    * libodbc.cs: changed the DllImport from "odbc32.dll"
    to "odbc32"

svn path=/trunk/mcs/; revision=8739
2002-11-02 01:02:32 +00:00
Brian Ritchie 71d38f2a35 - Transaction Isolation Level is supported
- Fixed TinyInt mapping (Thanks Daniel for finding the bug!)
- ExecuteScalar is supported
- Support CloseConnection CommandBehavior for ExecuteReader
- Implemented full error handling support: OdbcException, OdbcError, OdbcErrorCollection
- Parameter support for all data types (needs further optimization)

svn path=/trunk/mcs/; revision=8429
2002-10-20 19:19:50 +00:00
Brian Ritchie 145480dbde Modified SQLDescribeCol to work around bug in pinvoke...when doing a ref on a typed enum
svn path=/trunk/mcs/; revision=8304
2002-10-16 04:12:35 +00:00
Brian Ritchie d0579aba6b Changed odbc32 to odbc32.dll to support dllmapping in mono
svn path=/trunk/mcs/; revision=8236
2002-10-14 05:28:50 +00:00
Brian Ritchie f8721edf94 Brian Ritchie
- Added OdbcTransaction Object and moved transaction logic out of connection and into new object.
- Support for DSN-less connection strings
- Fixed OdbcType enum to have correct values
- General cleanup on all objects
- Implemented Cancel in OdbcCommand
- Added DBNull support
- Updated OdbcType enum with values from header files.
- Modified column description code to happen dynamically as a column is accessed
  instead of describing all columns when the query opens
- Works with SqlSharp

Known Issues:
- Transaction Isolation Level isn't handled
- A number of data types are returned as strings instead of native types
- Parameter support is weak -- only supports int types
- ExecuteReader: CommandBehavior isn't implemented
- ExecuteScalar not implemented
- Need better error handling

svn path=/trunk/mcs/; revision=8233
2002-10-14 04:57:06 +00:00
Rodrigo Moya 2ce1d9ef66 2002-10-09 Rodrigo Moya <[email protected]>
* list: added System.Data.Odbc files.

2002-10-09  Brian Ritchie <[email protected]>

	* System.Data.Odbc/*: added first version of ODBC managed provider.

svn path=/trunk/mcs/; revision=8103
2002-10-09 17:15:22 +00:00