This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi all, May be a silly question but... does the SQLite provider for Lightspeed support a Guid ID? Tried a couple of options for the data type:
Any other type I should try to make it work, or is a Guid Id not yet supported?
Cheers, Paul
|
|
|
Using a text type in the database (e.g. CHAR(36)) should work. LightSpeed should handle the conversion between the database string and the .NET Guid type. If you're seeing "invalid GUID format" errors, it may mean that the column already contains strings which are not correct GUID representations -- check the data that's already in there. |
|
|
Thank you; you're absolutely right Ivan - there is some "garbage" in the ID column coming from somewhere which is stopping the CHAR(36) aka TEXT from working. This is actually a unit testing database thus the rubbish could be coming from my hand written SQL (let's be honest - probably coming from). Back to the debugger I must go... Thanks for the speedy response; much appreciated! |
|
|
For the record; when using CHAR(36) or TEXT: it was an issue with the System.Data.SQLite library. That doesn't really support DbType.Guid parameters going to TEXT; it tries to store it as binary which of course causes issue. You can fix by specifying in the connection string BinaryGUID=No Obvious now; but thanks for pointing me in the right direction! |
|