Saludos,
Intento ejecutar una consulta con asp.net en una base de datos de mysql y con el conector MyODBC-3.51 pero me da un error
La consulta es la siguiente:
"SELECT sum(respuestas_tema) as suma FROM temas WHERE id_foro=" & id_foro
no se por que pero no me reconoce el sum, si lo cambio por MAX,MIN,COUNT va bien, pero con SUM no
El error es el siguiente:
Foro Ultimo Mensaje Temas Mensajes
Probando
System.ArgumentException: Tipo SQL desconocido - 0. at System.Data.Odbc.TypeMap.FromSqlType(SQL_TYPE sqltype) at System.Data.Odbc.OdbcDataReader.GetSqlType(Int32 i) at System.Data.Odbc.OdbcDataReader.GetFieldType(Int32 i) at System.Data.Common.SchemaMapping.SetupSchemaWithou tKeyInfo(MissingMappingAction mappingAction, MissingSchemaAction schemaAction, Boolean gettingData, DataColumn parentChapterColumn, Object chapterValue) at System.Data.Common.SchemaMapping.SetupSchema(Schem aType schemaType, String sourceTableName, Boolean gettingData, DataColumn parentChapterColumn, Object parentChapterValue) at System.Data.Common.DbDataAdapter.FillSchemaMapping (Object data, String srcTable, IDataReader dataReader, Int32 schemaCount, DataColumn parentChapterColumn, Object parentChapterValue) at System.Data.Common.DbDataAdapter.FillSchemaMapping Try(Object data, String srcTable, IDataReader dataReader, Int32 schemaCount, DataColumn parentChapterColumn, Object parentChapterValue) at System.Data.Common.DbDataAdapter.FillFromReader(Ob ject data, String srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords, DataColumn parentChapterColumn, Object parentChapterValue) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) at System.Data.Common.DbDataAdapter.FillFromCommand(O bject data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) at nosolodjs._default1.Sumar_respuestas(Int32 id_foro) in C:\Inetpub\wwwroot\nosolodjs\foros\default.aspx.vb :line 247 Probando
Probando foros
Moderadores:No hay moderadores en este foro Saludos
por Garcy 14 0
System.ArgumentException: Tipo SQL desconocido - 0. at System.Data.Odbc.TypeMap.FromSqlType(SQL_TYPE sqltype) at System.Data.Odbc.OdbcDataReader.GetSqlType(Int32 i) at System.Data.Odbc.OdbcDataReader.GetFieldType(Int32 i) at System.Data.Common.SchemaMapping.SetupSchemaWithou tKeyInfo(MissingMappingAction mappingAction, MissingSchemaAction schemaAction, Boolean gettingData, DataColumn parentChapterColumn, Object chapterValue) at System.Data.Common.SchemaMapping.SetupSchema(Schem aType schemaType, String sourceTableName, Boolean gettingData, DataColumn parentChapterColumn, Object parentChapterValue) at System.Data.Common.DbDataAdapter.FillSchemaMapping (Object data, String srcTable, IDataReader dataReader, Int32 schemaCount, DataColumn parentChapterColumn, Object parentChapterValue) at System.Data.Common.DbDataAdapter.FillSchemaMapping Try(Object data, String srcTable, IDataReader dataReader, Int32 schemaCount, DataColumn parentChapterColumn, Object parentChapterValue) at System.Data.Common.DbDataAdapter.FillFromReader(Ob ject data, String srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords, DataColumn parentChapterColumn, Object parentChapterValue) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) at System.Data.Common.DbDataAdapter.FillFromCommand(O bject data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) at nosolodjs._default1.Sumar_respuestas(Int32 id_foro) in C:\Inetpub\wwwroot\nosolodjs\foros\default.aspx.vb :line 247