SQLite ADO .NET: how to specify a default value for GUID?
As i previously discovered, SQLieParameter (parametrized query) can't be used for "create table" in SQLite ADO .NET. I need to create a table with GUID field and i want a default value to be all zeroes. But the following query:
create table test ( name text default 'no name', id guid default 0 )
Creates a table w开发者_运维知识库here adding an item and reading it again not reads a GUID (SQLiteDataReader.GetGuid() raises exception). Maybe anyone knows how to correctly define a default guid value for "create table" in SQLite ADO .NET?
One of these might work:
create table test ( name text default 'no name', id guid default ('00000000-0000-0000-0000-000000000000'))
create table test ( name text default 'no name', id guid default ('{00000000-0000-0000-0000-000000000000}'))
精彩评论