Windows Develop Bookmark and Share   
 index > Windows Forms Sample Applications > PocketVision - Date problems
 

PocketVision - Date problems

Hi folks,

first up - EXCELLENT app - nice, so far, anyway. Especially the PPC version.

I've been trying to get it to work, and it appears that there is a problem passing dates (ie, when inserting tasks during a sync), as SQL CE doesn't like the format that DateTime.ToString() returns.

I have modified mine to do the following, and it works (still more places to change, but this allowed me to sync down properly):

In data\LocalStorage.cs, line 265:

public int StoreTasks(DataTable table)
{
...
}

Where it was 
row[Global.TaskFields.DateModified]
Change it to:
DateFormat(row[Global.TaskFields.DateModified])
(and also for other dates)

and add this:


private string DateFormat(object TheDate) 
        {
            if (TheDate == null) 
            {
                return null;
            }
            DateTime Date = (DateTime)TheDate;
            return Date.ToString("yyyy-MM-dd HH:mm:ss");
        }

this makes it work rather nicely.

:)

Nic.
MigrationUser 1  Monday, February 17, 2003 11:40 PM
I should also add that to fix the app properly, changing this whereever ExecuteNonQuery is called (and where it uses a date), makes updates etc into SqlCE work nicely :)

MigrationUser 1  Tuesday, February 18, 2003 12:06 AM
FYI: to those reading this thread -- Pocket TaskVision will be made universally available in March, after make the .NET Compact Framework redist universally available
MigrationUser 1  Wednesday, February 19, 2003 10:40 PM

You can use google to search for other answers

Custom Search

More Threads

• System.NullReferenceException
• Error when attempting to start terrarium for first time
• How to get the directory (folder) on which user has done right click
• User control problem
• Is it possible to set up multiple Taskserver Servers and Replicate?
• Dependant tasks? Subtasks?
• Changing Windows Forms Header Color
• Default Namespace Issue
• Direct SQL instead of webservice
• Extensive Debug environment in new Terrarium?