Click here to Skip to main content
15,899,474 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionAJAX/ SQL/MasterPage Web.config Pin
Planker11-Feb-07 16:57
Planker11-Feb-07 16:57 
Questionweb.config Pin
Rahithi11-Feb-07 16:30
Rahithi11-Feb-07 16:30 
AnswerRe: web.config Pin
Sylvester george11-Feb-07 19:04
Sylvester george11-Feb-07 19:04 
QuestionDatagrid - Select all javascript question Pin
kpkr11-Feb-07 16:22
kpkr11-Feb-07 16:22 
QuestionImage With WebService Pin
AnhTin11-Feb-07 15:47
AnhTin11-Feb-07 15:47 
AnswerRe: Image With WebService Pin
Sandeep Akhare12-Feb-07 1:57
Sandeep Akhare12-Feb-07 1:57 
QuestionSystem.Windows.Forms Database Framework and ASP.NET Pin
Lindsay_Mathieson11-Feb-07 15:17
Lindsay_Mathieson11-Feb-07 15:17 
QuestionArithmetic Overflow etc...Error for datetime in gridview Pin
BORN...again!11-Feb-07 14:22
BORN...again!11-Feb-07 14:22 
Smiles to all,

We are moving from Datagrid to gridview in one of the applications
and the gridview is linked to a datasource with Select Command as below ...

SELECT DriverNo, RegNo, DriverName,projectcode,Convert(datetime,startdate,103) as StartDate, Convert(Datetime,enddate,103) as EndDate, OdoReading, currentdriver FROM DriverDetails where regno=@regno

and Update Command as ...

UPDATE DriverDetails SET DriverName = @drivername, StartDate = @startdate, EndDate = @enddate, OdoReading = @odoreading, projectcode = @projectcode, currentdriver = @currentdriver WHERE (DriverNo = @driverno)

My dates (startdate & enddate) are in the dd/mm/yyyy format(I'm in Australia) and I already have more than 500 records created with date stored in above format.

The gridview populates fine but when I try to update the values I get the following error:

Arithmetic overflow error converting expression to data type datetime.
The statement has been terminated.

I know it is the date format but don't how to fix it in the update command. if I type the date as
20/01/2006(dd/mm/yyyy) it fails but if I type the date as 01/20/2006(mm/dd/yyyy) it works. But the users want it as dd/mm/yyyy plus it is impossible to change date formats for previous records.

There is no code-behind. I am doing update on UpdateCommand of my datasource so please suggest how to modify the update command to convert dates.

Thanks.

Aartee.
...HE is watching Us All!

QuestionHow to Sharpen Image? Pin
achimera11-Feb-07 13:57
achimera11-Feb-07 13:57 
AnswerRe: How to Sharpen Image? Pin
Rahithi11-Feb-07 17:40
Rahithi11-Feb-07 17:40 
GeneralRe: How to Sharpen Image? Pin
achimera11-Feb-07 20:45
achimera11-Feb-07 20:45 
GeneralRe: How to Sharpen Image? Pin
Rahithi16-Feb-07 6:56
Rahithi16-Feb-07 6:56 
QuestionMaintain focus between postbacks Pin
Ulf Andersson11-Feb-07 11:01
Ulf Andersson11-Feb-07 11:01 
QuestionASP.NET and Flash Pin
nour12311-Feb-07 6:44
nour12311-Feb-07 6:44 
QuestionCalendar1 Pin
Blue_Boy11-Feb-07 4:08
Blue_Boy11-Feb-07 4:08 
QuestionHyperLink in GridView Pin
Mohammed Elkholy11-Feb-07 1:19
Mohammed Elkholy11-Feb-07 1:19 
AnswerRe: HyperLink in GridView Pin
BORN...again!11-Feb-07 13:35
BORN...again!11-Feb-07 13:35 
GeneralRe: HyperLink in GridView Pin
Mohammed Elkholy11-Feb-07 20:31
Mohammed Elkholy11-Feb-07 20:31 
QuestionView State "32 bit encoded" Pin
DavidsMaguire11-Feb-07 0:14
DavidsMaguire11-Feb-07 0:14 
AnswerRe: View State "32 bit encoded" Pin
Colin Angus Mackay11-Feb-07 0:29
Colin Angus Mackay11-Feb-07 0:29 
GeneralRe: View State "32 bit encoded" Pin
DavidsMaguire11-Feb-07 0:45
DavidsMaguire11-Feb-07 0:45 
GeneralRe: View State "32 bit encoded" Pin
Colin Angus Mackay11-Feb-07 3:38
Colin Angus Mackay11-Feb-07 3:38 
GeneralRe: View State "32 bit encoded" Pin
Guffa11-Feb-07 14:24
Guffa11-Feb-07 14:24 
GeneralRe: View State "32 bit encoded" Pin
DavidsMaguire11-Feb-07 22:00
DavidsMaguire11-Feb-07 22:00 
GeneralRe: View State "32 bit encoded" Pin
Colin Angus Mackay12-Feb-07 1:57
Colin Angus Mackay12-Feb-07 1:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.