Selecting from view with System.Data.SQLite throws

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Selecting from view with System.Data.SQLite throws

Joseph L. Casale
I am using System.Data.SQLite.Core 1.0.104 in vs2017 with .NET 4.6.2
and trying to select from a view. The query is valid and does return data
manually, however the reader throws an index out of range exception
when accessing the first row result.

Anything atypical needed when querying a view?

Thanks,
jlc
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Selecting from view with System.Data.SQLite throws

Joe Mistachkin-3

What is the declared data type for the column?  Also, what are the raw values for the first row?  You may want to use the SQLite command line tool to query the database for them.

Sent from my iPhone
https://urn.to/r/mistachkin

> On Apr 8, 2017, at 12:55 PM, Joseph L. Casale <[hidden email]> wrote:
>
> I am using System.Data.SQLite.Core 1.0.104 in vs2017 with .NET 4.6.2
> and trying to select from a view. The query is valid and does return data
> manually, however the reader throws an index out of range exception
> when accessing the first row result.
>
> Anything atypical needed when querying a view?
>
> Thanks,
> jlc
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Selecting from view with System.Data.SQLite throws

Joseph L. Casale
From: sqlite-users [mailto:[hidden email]] On
Behalf Of Joe Mistachkin
Sent: Saturday, April 8, 2017 1:18 PM
To: SQLite mailing list <[hidden email]>
Subject: Re: [sqlite] Selecting from view with System.Data.SQLite throws

> What is the declared data type for the column?  Also, what are the raw
> values for the first row?  You may want to use the SQLite command line tool
> to query the database for them.

I was selecting from all columns which were declared as either INT or TEXT.
I resolved it unintentionally by removing an alias as it was a single select on
the one view and did not need any aliasing.

The command text went from:

 SELECT s.Id, s.foo ...
  FROM SomeView s
WHERE s.bar = @bar;

to:

SELECT Id, foo ...
  FROM SomeView
WHERE bar = @bar;

Odd...

Thanks,
jlc
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Loading...