PC Review


Reply
Thread Tools Rate Thread

ADO.NET & ODBC.NET : Bugs???

 
 
Mythran
Guest
Posts: n/a
 
      16th Jul 2003
Consider the following code, test and try it out:

Dim Conn As OdbcConnection
Dim Reader As OdbcDataReader
Dim Cmd As OdbcCommand
Dim Adapter As OdbcDataAdapter
Dim Table As System.Data.DataTable

'
' Create all of the objects to use.
Conn = New OdbcConnection()
Cmd = New OdbcCommand()
Adapter = New OdbcDataAdapter()
Data = New System.Data.DataSet()

'
' The connection object.
Conn.ConnectionString = "DSN=dbTest"
Conn.Open()

'
' The command object.
Cmd.Connection = Conn
Cmd.CommandType = CommandType.Text
Cmd.CommandText = "SELECT * FROM [Test]"

'
' Get the table's schema.

Reader = Cmd.ExecuteReader(CommandBehavior.SchemaOnly)
Table = Reader.GetSchemaTable()
Reader.Close()

'
' Set the data source for the data grid.
dgInfo.DataSource = Table

'
' Close and destroy all of the data access objects.
Conn.Close()
Table = Nothing
Reader = Nothing
Cmd = Nothing
Conn = Nothing



Now, what I have done is set up a few columns in this microsoft access database.
These columns are mapped as follows:

AutoNumberfield - AutoNumber - Primary key has been set on this field.
Textfield - Text
Memofield - Memo
Numberfield - Number
DateTimefield - Date/Time
Currencyfield - Currency
YesNofield - Yes/No
OLEObjectfield - OLE Object
Hyperlinkfield - Hyperlink
Decimalfield - Number - Field Size property set to Byte.


Now, when the code above runs on this table, the schema returned is not complete
or invalid altogether (maybe just incomplete).

The AutoNumberfield column should show in the IsKey property as True (or checked)
but it doesn't. I noticed this problem for SQL Server primary key's as well, the
primary keys are not checked in IsKey at all! How can I determine if the
specified field is or is part of the primary key for the specified table?

The Hyperlinkfield returns the exact same information as the memo field. How can
I tell these apart? I have checked the ExtendedProperties property while running
some tests using a data adapter and dataset but the extendedproperties are NEVER
set so I can't query those to find out.

The Decimalfield and Currencyfield both return the same datatype (Numeric) and
the Numberfield returns the property datatype (Integer). But notice that the
Decimalfield is in fact a Number while the field size has been set to Byte (or
decimal). Why does this return Number? How can I tell these two apart (Number
with Field Size set to something)?

Ok, enough questions already

Thanks in advance...

Mythran


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ubuntu has bugs.... Lots of bugs more than 50,000+ documented measekite Da Monkey Windows Vista General Discussion 7 29th Apr 2009 08:15 AM
Vista pro - bugs... bugs... bugs... =?Utf-8?B?S2FtaWwgRHVyc3Vu?= Windows Vista Performance 3 22nd May 2007 07:10 AM
I meant RC2 Build 5744 is the last build unless ms find more bugs before the RTM build and gold version there only make another build if there more bugs and not ready for RTM Drew Windows Vista General Discussion 4 12th Oct 2006 02:17 PM
Reducing (Oracle) ODBC bugs as much as possible? Sten Westerback Microsoft Windows 2000 Developer 0 10th Jun 2004 07:12 AM
ADO.NET & ODBC.NET : Bugs??? Mythran Microsoft ADO .NET 3 18th Jul 2003 06:35 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:30 AM.