473,386 Members | 1,609 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Linq to sql problem

Hi all I get this error
The conversion of a nvarchar data type to a datetime data type resulted in an out-of-range value

when using the below code. Any ideas please

var longtime = from d in context.DocketTBs
//where (DateTime.Now.ToString("dd-MM-yyyy HH:mm:ss")) - Convert.ToDateTime(c.Docket_DateRaised + ":00") > TimeSpan.FromMinutes(60)
where (DateTime.Now - Convert.ToDateTime(d.Docket_DateRaised + ":00") > TimeSpan.FromMinutes(2))
// where c.Docket_Status.Equals("Ea")

//DateTime.ParseExact

// && !(c.Docket_Status == "CL" || c.Docket_Status == "Ca")
select new {d.Docket_Number, d.Docket_DateRaised, d.Docket_Machine};
Oct 19 '11 #1
0 1138

Sign in to post your reply or Sign up for a free account.

Similar topics

28
by: Marc Gravell | last post by:
In Linq, you can apparently get a meaningful body from and expression's .ToString(); random question - does anybody know if linq also includes a parser? It just seemed it might be a handy way to...
22
by: paululvinius | last post by:
Hi! Testing som Linq-expressions and tried to measure performance and compare it to pre-Linq programming. The folloing two methods are functional equal but the non-Linq one is twice as fast....
6
by: Dmitry Perets | last post by:
Hello, I am trying to work with MS SQL Server 7 from the release version of Visual Studio 2008 + LINQ to SQL. And the problem is that the LINQ to SQL designer doesn't accept my tables saying...
3
by: Leo Seccia | last post by:
Hello everyone, I have a c# project with a sql server database. I have a number of lookup tables in my database which I successfully managed to import into my LINQ dataclasses. eg. Table:...
0
by: Lloyd Sheen | last post by:
I have an existing set of tables which I have put into a Linq to SQL class. Those tables I have had no problems with. I have created some new tables and when I add them to the a new Linq to SQL...
0
by: Lloyd Sheen | last post by:
In testing I am adding / removing items using linq. Steps: 1. Add new item using InsertOnSubmit and SubmitChanges with no problem. 2. Remove the item using DeleteOnSubmit and...
0
by: =?Utf-8?B?UmF5bmFsZA==?= | last post by:
Hi everybody, I have a problem on linq related field, look my simple example : <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <!DOCTYPE html...
4
by: =?Utf-8?B?RXJpYyBGYWxza2Vu?= | last post by:
We’re storing our main entity in an insert only table which stores the history of past revisions, but we’re facing problems with storing this history as LINQ will only update the entity, and...
7
by: shapper | last post by:
Hello, Is it possible to multiply all Prices in a List<Productby 1.1 using Linq? Product has a property named Price. Thanks, Miguel
3
by: =?Utf-8?B?SmFtZXMgUGFnZQ==?= | last post by:
Hi all Having a mental block with linq! I have a simple aspx page with a button and a label. When the button is clicked I want the label to display the result of a simple query: i.e. Select...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.