Sqlite Help

If you need help with a project or need to know how to do something specific in VB.NET then please ask your questions in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
5 posts Page 1 of 1
Contributors
User avatar
Dummy1912
VIP - Donator
VIP - Donator
Posts: 1969
Joined: Sat Aug 21, 2010 2:17 pm

Sqlite Help
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
visit us on:


http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
User avatar
CodenStuff
Site Admin
Site Admin
Posts: 4389
Joined: Tue Aug 04, 2009 1:47 am

Re: Sqlite Help
CodenStuff
It should just be
Code: Select all
Dim attributes As String = "*"
..to get all records.
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
User avatar
Dummy1912
VIP - Donator
VIP - Donator
Posts: 1969
Joined: Sat Aug 21, 2010 2:17 pm

Re: Sqlite Help
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
visit us on:


http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
User avatar
un kn0 wn
VIP - Donator
VIP - Donator
Posts: 269
Joined: Mon Mar 29, 2010 6:12 pm

Re: Sqlite Help
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.
User avatar
Dummy1912
VIP - Donator
VIP - Donator
Posts: 1969
Joined: Sat Aug 21, 2010 2:17 pm

Re: Sqlite Help
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;
visit us on:


http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
5 posts Page 1 of 1
Return to “Coding Help & Support”