Advertisement

09.11.2008 at 03:28PM PDT, ID: 23724869
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.4

WinForms - DB Date Adjusting To Local Time

Asked by prochko in SQL Server 2005, C# Programming Language, Microsoft Development

Tags: , , , ,

I have a .NET 2.0 C# application that displays a datagrid.  One of the columns is a date field.  The application is working fine.  I just installed it on a workstation in the Pacific time zone and all of the dates are be adjusted to local time (e.g. it is appearing on the grid as 2/15/2008 9:00PM).  From my machine (eastern time zone) the date shows as 2/16/2008.

Is there a setting I can use in the C# code that will turn-off the time adjustment.  I do not want to make any changes on the local workstation since that will not be acceptable to the workstation owner.

Is there a way I can store the date in SQL Server that would prevent it.  DateOfService and DateOfBirth is currently a DateTime field and it is updated in this stored procedure:

ALTER PROCEDURE [dbo].[sp_UpdateDocumentInfoForMT]
      @jobID      int,
      @documentID      int,
      @templateID    int,
      @qaTypeID    int,
      @docStatus int,
      @firstname     nvarchar(255),
      @middlename    nvarchar(255),
      @lastname        nvarchar(255),
      @dateofservice  datetime,
      @dateofbirth  datetime,
      @mrn       nvarchar(255),
      @account   nvarchar(255),
      @room      nvarchar(255),
      @site  nvarchar(255),
      @gender  int,
      @ampm     int,
      @empty      bit,
      @inaudible bit,
     @noname bit,
     @addendum bit,
     @truncated  bit,
     @missing  bit,
     @inaudibleCnt  int,
    @addressTo nvarchar(2000),
    @addressCC  nvarchar(2000),
     @comments  ntext

AS

BEGIN

      UPDATE documents SET
 templateID              = @templateID,
qaTypeID              = @qaTypeID,
cdp_ptfirst       = @firstname,
cdp_ptmiddle      = @middlename,
cdp_ptlast        = @lastname,
cdp_dos           = @dateofservice,
cdp_ptdob         = @dateofbirth,
cdp_ptmrn         = @mrn,
cdp_ptacct        = @account,
cdp_site        = @site,
cdp_ptroom        = @room,
cdp_ptgender      = @gender,
cdp_ampm          = @ampm,
cdp_qtyinaudibles = @inaudibleCnt,
addressTo         = @addressTo,
addressCC         = @addressCC,
comments          = @comments,
documentStatus   = @docStatus
WHERE (documentid = @documentid)

      UPDATE jobs SET
isblank       = @empty,
isinaudible   = @inaudible,
isnoname      = @noname,
isaddendum    = @addendum,
istruncated   = @truncated,
ismissinginfo = @missing,
inaudibles    = @inaudibleCnt
 WHERE (jobid = @jobid)
ENDStart Free Trial
[+][-]09.11.2008 at 08:57PM PDT, ID: 22457057

View this solution now by starting your 14-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: SQL Server 2005, C# Programming Language, Microsoft Development
Tags: Microsoft, SQL Server & .NET WinForms, SQL Server 2005; .NET 2.0, C#, IE
Sign Up Now!
Solution Provided By: ragi0017
Participating Experts: 1
Solution Grade: B
 
 
 
Loading Advertisement...
20081112-EE-VQP-43 / EE_QW_2_20070628