Page 1 of 1

Sqlite Help

Posted: Tue Feb 28, 2017 4:40 pm
by Dummy1912
Hello,

Does anyone knows how we get all records from a table even if we don't ask for it?
Code: Select all
 Dim attributes As String = "category.name,category.budget"
            Dim whereClause As String = "ledger.Monthid='" & sMonth & "' AND ledger.yearid ='" & sYear & "'"
            Dim fromClause As String = "LEFT JOIN category ON ledger.category=category.id" 'we only get 1 value because we asked for it. 

            Dim empls As SQLiteDataReader = DataBase.executeQuery("SELECT " & attributes & " FROM ledger " & fromClause & " WHERE " & whereClause & " ;")
as you can see we ask for some existing value from the table category
Code: Select all
'tried
 Dim attributes As String = "*,category.name,category.budget"           
but nothing do :(

but our table has many more values
how can we still show them?
Yes the category.name and category.budget are the only one we need to show

Thanks

Dummy1912

Re: Sqlite Help

Posted: Wed Mar 01, 2017 10:22 am
by CodenStuff
It should just be
Code: Select all
Dim attributes As String = "*"
..to get all records.

Re: Sqlite Help

Posted: Wed Mar 01, 2017 10:36 am
by Dummy1912
Hello,

:teehe; must it be that easy
i only get 1 record :(
Code: Select all
 Dim attributes As String = "*"
Dim empls As SQLiteDataReader = DataBase.executeQuery("SELECT " & attributes & " FROM category ")
if i only use this part then i get all records

Re: Sqlite Help

Posted: Sat Mar 25, 2017 7:50 pm
by un kn0 wn
Dummy1912 wrote:
Hello,

:teehe; must it be that easy
i only get 1 record :(
Code: Select all
 Dim attributes As String = "*"
Dim empls As SQLiteDataReader = DataBase.executeQuery("SELECT " & attributes & " FROM category ")
if i only use this part then i get all records
That's probably because there is only one record which matches the parameters in you WHERE clause.

Re: Sqlite Help

Posted: Sun Mar 26, 2017 8:28 am
by Dummy1912
Hi Un kn0wn

Long time no see :)
how are you.


Yeah i think you might be right about this part
i will have a look into it

Cheers :lover;