NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 32 33 34 35 36 … 93 Next »
Access DB and DateTime

 
  • 0 Vote(s) - 0 Average
Access DB and DateTime
idkpmiller
Offline

Posting Freak

Posts: 817
Threads: 141
Joined: May 2006
#1
2008-04-12, 04:18 AM
I am having loads of grief with writing Date and Time into an AccessDB always a mismatch, has anyone done this before with a piece of code?

Google turns up quite a few hits but all seem to be workarounds by changing the field to a text, for now so I can move on I have done this bit I need to sort in descending order this could have been achieved by a simple query now its a pain in the @ss

Thanks
Let the Games begin...Round 2!
GameZone v2.9.6 - PVRx2 1.4.7 compatible!

[Image: 1299379.png]
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,626
Threads: 767
Joined: Nov 2003
#2
2008-04-12, 05:14 AM
Are you taking about passing a datetime parameter into a command? If so, it doesnt like the millisecond part of the date time fields, so I usually ended up constructing a temporary date that didnt contain the milliseconds.

Code:
updateRecordingCommand.Parameters[0].Value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second);
updateRecordingCommand.Parameters[0].DbType = System.Data.DbType.DateTime;
idkpmiller
Offline

Posting Freak

Posts: 817
Threads: 141
Joined: May 2006
#3
2008-04-12, 10:54 AM
Hi sub,

I am actually trying to store the dateandtime a game is played in an access DB and that is what is causing the mismatch error report, its a .net to access issue really not a gbpvr thing, although its part of GameZone2.
Let the Games begin...Round 2!
GameZone v2.9.6 - PVRx2 1.4.7 compatible!

[Image: 1299379.png]
bgowland
Offline

Posting Freak

West Yorkshire, UK
Posts: 4,583
Threads: 384
Joined: Dec 2004
#4
2008-04-12, 05:40 PM
Post an example of your db code and where you're getting the type mismatch error and I'd be happy to look at it.

I know I've done this on a regular basis in the past (long time ago now) so I'll see if I can dig out my old source code.

Cheers,
Brian
Ommina
Offline

Senior Member

Posts: 330
Threads: 39
Joined: Feb 2006
#5
2008-04-13, 06:26 AM
I think sub was just using that as an example of how he passes a time to an ADO.NET command object. (At least, that's how I interpreted it.) So it should still be OK for you.

Another random thought: Access needed dates (in SQL) surrounded by # signs, not the single quote that other implementations use. Of course, that won't help at all if you're not passing the date inside some sort of SQL, but thought I'd throw it out there.
idkpmiller
Offline

Posting Freak

Posts: 817
Threads: 141
Joined: May 2006
#6
2008-04-14, 10:37 AM
Thanks for the suggestions guys and offers of help, I sat back thought about it and approached from a different angle which worked fime :-)

Cheers
Let the Games begin...Round 2!
GameZone v2.9.6 - PVRx2 1.4.7 compatible!

[Image: 1299379.png]
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  NextPVR 5: When is PIN Required for API Access? pkscout 3 2,629 2020-05-26, 04:45 AM
Last Post: sub
  API access to artwork and deleting recordings cncb 29 15,378 2016-11-06, 02:20 AM
Last Post: mvallevand
  Access 'Stay on top' setting from a plugin? McBainUK 5 2,343 2011-11-07, 04:43 PM
Last Post: sub
  Access ImportHDPVRChannelsForm mvallevand 62 14,264 2011-08-09, 03:37 AM
Last Post: mvallevand
  datetime format in GB-PVR zehd 14 4,501 2009-03-17, 04:12 AM
Last Post: zehd
  Access to Schedules inside standalone progs dero 1 1,367 2008-12-09, 12:03 PM
Last Post: dero
  Linking gbpvr.db3 to Access 2003: get readonly tables Khurram 5 3,887 2008-09-11, 08:35 AM
Last Post: Khurram
  Access to FSE switch idkpmiller 12 4,162 2008-07-05, 04:01 PM
Last Post: whurlston
  SilverLight Web Access uwfalcon 1 1,310 2008-03-16, 05:32 AM
Last Post: sub
  GB-PVR web access McBainUK 2 3,588 2008-03-14, 03:21 PM
Last Post: McBainUK

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode