Re: [sqlite] Preferred cast in C#

2014-07-15 Thread Edward Ned Harvey (sqlite)
> From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- > boun...@sqlite.org] On Behalf Of Simon Slavin > > Which does /not/ describe it as "The official SQLite database engine", which > is the point I was making. I used NuGet. http://www.nuget.org/packages/System.Data.SQLite.Core/ "The

Re: [sqlite] Preferred cast in C#

2014-07-15 Thread Simon Slavin
> On 15 Jul 2014, at 8:05pm, Drago, William @ MWG - NARDAEAST > wrote: > >> On 15 Jul 2014, at 6:42pm, Edward Ned Harvey (sqlite) >> wrote: >> >>> In C#, using the System.Data.Sqlite.Core package, which is described >>> as "The official SQLite

Re: [sqlite] Preferred cast in C#

2014-07-15 Thread Drago, William @ MWG - NARDAEAST
> -Original Message- > From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- > boun...@sqlite.org] On Behalf Of Simon Slavin > Sent: Tuesday, July 15, 2014 2:35 PM > To: General Discussion of SQLite Database > Subject: Re: [sqlite] Preferred cast in C# > > >

Re: [sqlite] Preferred cast in C#

2014-07-15 Thread Simon Slavin
On 15 Jul 2014, at 6:42pm, Edward Ned Harvey (sqlite) wrote: > In C#, using the System.Data.Sqlite.Core package, which is described as "The > official SQLite database engine" and published by "SQLite Development Team" That's Joe's code. You probably got that off of git

Re: [sqlite] Preferred cast in C#

2014-07-15 Thread RSmith
On 2014/07/15 19:42, Edward Ned Harvey (sqlite) wrote: From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- boun...@sqlite.org] On Behalf Of RSmith System.DBNull is not a native SQLite construct, it is probably one of the third party connectors. In C#, using the

Re: [sqlite] Preferred cast in C#

2014-07-15 Thread Edward Ned Harvey (sqlite)
> From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- > boun...@sqlite.org] On Behalf Of RSmith > > > System.DBNull is not a native SQLite construct, it is probably one of the > third > party connectors. In C#, using the System.Data.Sqlite.Core package, which is described as "The

Re: [sqlite] Preferred cast in C#

2014-07-15 Thread RSmith
On 2014/07/15 13:48, Edward Ned Harvey (sqlite) wrote: I would really love to have an easy way of putting a long? into the database, and then getting a long? back out. Maybe it exists and I'm just doing it the hard way right now... I guess what I'm really getting at is this: The 5 data types

Re: [sqlite] Preferred cast in C#

2014-07-15 Thread Edward Ned Harvey (sqlite)
> From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- > boun...@sqlite.org] On Behalf Of Edward Ned Harvey (sqlite) > > I would really love to have an easy way of putting a long? into the database, > and then getting a long? back out. Maybe it exists and I'm just doing it the > hard way

Re: [sqlite] Preferred cast in C#

2014-07-15 Thread Edward Ned Harvey (sqlite)
> From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- > boun...@sqlite.org] On Behalf Of Hick Gunter > > Why is the column nullable if you require a default value to be returned? The default value for long? or string or byte[] is null. Which makes perfect sense.

Re: [sqlite] Preferred cast in C#

2014-07-15 Thread Edward Ned Harvey (sqlite)
> From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- > boun...@sqlite.org] On Behalf Of Random Coder > > Could you not do something like this to handle the nullable types? > > T GetValue(string field) > { > object obj = reader[field]; > > if (obj is

Re: [sqlite] Preferred cast in C#

2014-07-15 Thread Edward Ned Harvey (sqlite)
> From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- > boun...@sqlite.org] On Behalf Of Joseph L. Casale > > > I would really love to have an easy way of putting a long? into the > > database, > and then getting a long? back out. > > What do you want to happen when the column is null

Re: [sqlite] Preferred cast in C#

2014-07-15 Thread Hick Gunter
Why is the column nullable if you require a default value to be returned? -Ursprüngliche Nachricht- Von: Random Coder [mailto:random.co...@gmail.com] Gesendet: Dienstag, 15. Juli 2014 03:50 An: General Discussion of SQLite Database Betreff: Re: [sqlite] Preferred cast in C# Could you

Re: [sqlite] Preferred cast in C#

2014-07-14 Thread Random Coder
Could you not do something like this to handle the nullable types? T GetValue(string field) { object obj = reader[field]; if (obj is System.DBNull) return default(T); else return (T)obj; } Assuming the type is nullable, it should do

Re: [sqlite] Preferred cast in C#

2014-07-14 Thread Joseph L. Casale
> I would really love to have an easy way of putting a long? into the database, > and then getting a long? back out. What do you want to happen when the column is null as in your string example? jlc ___ sqlite-users mailing list

[sqlite] Preferred cast in C#

2014-07-14 Thread Edward Ned Harvey (sqlite)
I understand there are only 5 data types in Sqlite, and that the column type isn't necessarily the type of object returned in a query. Is there a more seamless way to cast responses than this? I would really love to have an easy way of putting a long? into the database, and then getting a