tags:

views:

100

answers:

1

Hello.

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 where 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?

+2  A: 

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}'))

P a u l
Thanks, both works.
Eye of Hell