.NET 读取Mysql遇到的错误,急急急!!!!
血战31天 2007-09-27 05:52:39 源代码:
Dim adap As New Odbc.OdbcDataAdapter
adap.SelectCommand = comd
adap.Fill(MyDataSet, "dddd") '这一行有错误
运行环境:
vs.net 2005
ODBC Mysql 3.51 连接 Mysql 4.0
Winxp Sp2
错误信息:
System.ArgumentException: 未知 SQL 类型 - 0。
在 System.Data.Odbc.TypeMap.FromSqlType(SQL_TYPE sqltype)
在 System.Data.Odbc.OdbcDataReader.GetSqlType(Int32 i)
在 System.Data.Odbc.OdbcDataReader.GetFieldType(Int32 i)
在 System.Data.ProviderBase.DataReaderContainer.CommonLanguageSubsetDataReader.GetFieldType(Int32 ordinal)
在 System.Data.ProviderBase.SchemaMapping.SetupSchemaWithoutKeyInfo(MissingMappingAction mappingAction, MissingSchemaAction schemaAction, Boolean gettingData, DataColumn parentChapterColumn, Object chapterValue)
在 System.Data.ProviderBase.SchemaMapping..ctor(DataAdapter adapter, DataSet dataset, DataTable datatable, DataReaderContainer dataReader, Boolean keyInfo, SchemaType schemaType, String sourceTableName, Boolean gettingData, DataColumn parentChapterColumn, Object parentChapterValue)
在 System.Data.Common.DataAdapter.FillMapping(DataSet dataset, DataTable datatable, String srcTable, DataReaderContainer dataReader, Int32 schemaCount, DataColumn parentChapterColumn, Object parentChapterValue)
在 System.Data.Common.DataAdapter.FillFromReader(DataSet dataset, DataTable datatable, String srcTable, DataReaderContainer dataReader, Int32 startRecord, Int32 maxRecords, DataColumn parentChapterColumn, Object parentChapterValue)
在 System.Data.Common.DataAdapter.Fill(DataSet dataSet, String srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords)
在 System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
在 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
在 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable)
我的问题:
.net2.0中能不能使用mysql?
将mysql中的数据读到dataset中时,字段类型有没有需要注意的?