SCM

[#1011330] Specified cast is not valid Exception is select

View Trackers | Support Requests | Download .csv | Monitor

Date:
2013-04-29 10:46
Priority:
3
State:
Open
Submitted by:
mm razavi (razavi)
Assigned to:
Nobody (None)
Category:
None
Group:
None
Resolution:
None
 
Summary:
Specified cast is not valid Exception is select

Detailed description

Hi

i have a table and simply perform a select query on it:


CREATE TABLE devices
(
"ID" serial NOT NULL,
name character varying(30),
title character varying(50),
"lastSeenTime" timestamp with time zone,
"createTime" timestamp with time zone NOT NULL DEFAULT now(),
description character varying(200),
"IpAddress" character varying(15) NOT NULL,
"MacAddress" character varying(17),
location character varying(50),
"lastUpdate" timestamp with time zone NOT NULL DEFAULT now(),
CONSTRAINT "PK_devices" PRIMARY KEY ("ID")
)
WITH (
OIDS=FALSE
);
ALTER TABLE devices
OWNER TO postgres;


Select Query:
SELECT "ID", name, title, "lastSeenTime", "createTime", description, "IpAddress", "MacAddress", location FROM devices WHERE "IpAddress" LIKE '192.168.120.187'


StackTrace:
at NpgsqlTypes.NpgsqlTimeStampTZ.op_Explicit(NpgsqlTimeStampTZ timestamp) in C:\projects\Npgsql2\src\NpgsqlTypes\DateDatatypes.cs:line 6831
at NpgsqlTypes.NpgsqlTypesHelper.<TypeInfoList>b__e(Object timestamptz) in C:\projects\Npgsql2\src\NpgsqlTypes\NpgsqlTypesHelper.cs:line 603
at NpgsqlTypes.NpgsqlBackendTypeInfo.ConvertToFrameworkType(Object providerValue) in C:\projects\Npgsql2\src\NpgsqlTypes\NpgsqlTypesHelper.cs:line 879
at Npgsql.ForwardsOnlyDataReader.GetValue(Int32 Index) in C:\projects\Npgsql2\src\Npgsql\NpgsqlDataReader.cs:line 1404
at Npgsql.NpgsqlDataReader.LoadValues(Object[] values, ValueLoader getValue) in C:\projects\Npgsql2\src\Npgsql\NpgsqlDataReader.cs:line 382
at Npgsql.NpgsqlDataReader.GetValues(Object[] Values) in C:\projects\Npgsql2\src\Npgsql\NpgsqlDataReader.cs:line 358
at System.Data.ProviderBase.DataReaderContainer.CommonLanguageSubsetDataReader.GetValues(Object[] values)
at System.Data.ProviderBase.SchemaMapping.LoadDataRow()
at System.Data.Common.DataAdapter.FillLoadDataRow(SchemaMapping mapping)
at System.Data.Common.DataAdapter.FillFromReader(DataSet dataset, DataTable datatable, String srcTable, DataReaderContainer dataReader, Int32 startRecord, Int32 maxRecords, DataColumn parentChapterColumn, Object parentChapterValue)
at System.Data.Common.DataAdapter.Fill(DataSet dataSet, String srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords)
at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, 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 MyApp.Data.DAL.DataAccessLayer.RunQuery(String Query, String tableName) in d:\Developments\Dev\\DAL\DAL.cs:line 232

Followup

No Followups Have Been Posted

Attached Files:

Changes:

No Changes Have Been Made to This Item

Powered By FusionForge