473,396 Members | 1,998 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,396 software developers and data experts.

How to handle A DateTime Linq to SQL error.

110 100+
Using Linq to SQL I have added a table to my project that will store data for Name, Phone, Email, and Birthday. If the date entered falls outside of 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM it spits out an error but I can't seem to figure out how to use a try catch on it. I'm not sure what exception this technically is.
Nov 26 '10 #1
1 2143
Fuzz13
110 100+
Turns out it was in fact listed as what type of error in the unhandled exception, I just didn't understand it required more then "SQLTypeException". Caught the error with this:
Expand|Select|Wrap|Line Numbers
  1. catch (System.Data.SqlTypes.SqlTypeException)
  2.  
Dec 9 '10 #2

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

Similar topics

4
by: shyner | last post by:
Hi Everyone, I've been battling this for two days with no luck. I'm using SQL Server 2000. Here's the mystery: I've got a stored procedure that takes a single varchar parameter to determine...
4
by: Saso Zagoranski | last post by:
Hi! I have created an SqlCommand object and I have set some parameters to it... One of the parameters is of the DateTime type; here is the code: sqlCommand.Parameters.Value =...
4
by: juli | last post by:
Good afternoon! I have an error while trying to convert to DateTime ,here is the code and the error: ArrayList al = new ArrayList(); temp_str=Line.Split(' '); al.Add(temp_str); //...
2
by: Grey | last post by:
I use the DateTime format to change the date format, i.e. string a = "21/02/2004"; Convert.ToDateTime(a).ToString("MMMM dd, yyyy"); These two lines work well in my VS.NET development machine. But...
11
by: Tim | last post by:
Hi, I am trying to do something simple. Convert a string date to datetime but it is not working and is giving me a baffling error! System.Convert.ToDateTime("Jan 30, 2006")...
1
by: suslikovich | last post by:
Hi all, I am getting this error when insert values from one table to another in the first table the values are varchar (10). In the second they are datetime. The format of the data is mm/dd/yyyy...
0
by: malvagia | last post by:
I currently have a login page for a web app that raises a Twisted UnauthorizedLogin Error if the username or password is wrong. I am trying to add to this a check to see if the account is enabled...
4
by: Supremelink | last post by:
Hi all, I have a problem with linq in a webservice. While executing a simple query like: var result = from customer in dbConn.Customers select customer; I get this error message: "Cannot...
1
by: =?Utf-8?B?YXZucmFv?= | last post by:
We have a web service that gets data in xml format. In that Xml data, we parse few date fields that are in this format <data datefield="12/26/2008" timefield="16:33:45" ...> we parse it into a...
1
pbala
by: pbala | last post by:
ConnectionString = "....." QueryString = "SELECT * FROM SomeTable" Dim myConnection As New MySql.Data.MySqlClient.MySqlConnection(ConnectionString) Dim myCommand As New...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.