Just tried installing this and it is correctly identifying my three temp sensors and OW Server, but I am having trouble with the writing to database. I get the following error:
I am trying to use Microsoft SQL Express 2012. I created the tblTemperature with the following (adapted from UJ's post here):
My database connection settings are as follows:
Type: Microsoft SQL 2008
Provider: SQLClient provider
Connection string: Data Source=localhost\X;Initial Catalog=Y;Trusted_Connection=yes
Any thoughts?
Thanks,
B
InsertIntoDB() Reports Error: [System.Data.SqlClient.SqlException: Arithmetic overflow error converting expression to data type datetime.The statement has been terminated. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlExcep tion exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(Tds ParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(Strin g methodName, Boolean async) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbA syncResult result, String methodName, Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at HSPI_ULTRA1WIRE2.Database.InsertIntoDB(String strDBTable, DateTime timeStamp, String deviceCode, Single deviceValue)], Failed on SQL: INSERT INTO tblTemperature ([ts], [code], [value]) VALUES (1355102744,'%3', 82.175).
CREATE TABLE [dbo].[tblTemperature] (
[ID] [int] IDENTITY (1, 1) NOT NULL ,
[ts] [datetime] NOT NULL ,
[code] [varchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[value] [numeric](10, 0) NOT NULL
) ON [PRIMARY]
GO
[ID] [int] IDENTITY (1, 1) NOT NULL ,
[ts] [datetime] NOT NULL ,
[code] [varchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[value] [numeric](10, 0) NOT NULL
) ON [PRIMARY]
GO
Type: Microsoft SQL 2008
Provider: SQLClient provider
Connection string: Data Source=localhost\X;Initial Catalog=Y;Trusted_Connection=yes
Any thoughts?
Thanks,
B
Comment