Click here to Skip to main content
15,893,487 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I'm beginner in SQLite and nsb-appstudio too
by the way I downloaded SQlite and create tables with cmd
but how to use this db in my project when I write
C#
db = SqlOpenDatabase("test.db", "1.0", "My Data")

then try to select from table I created I got "no such table "

how to link database I made before with this
thank you

What I have tried:

C#
Function Button1_onclick()
  db = SqlOpenDatabase("test.db", "1.0", "My Data")
  If db = 0 Then
    MsgBox "Error opening db"
  End If
  sqlListSelect=[]
  sqlListSelect[0]=["SELECT * FROM dbUsers " , nameFound]
  Sql(db, sqlListSelect)
End Function

Function nameFound(transaction, results)
  If results.rows.length>0 Then
    TextBox1.text = results.rows.item(0).name
    TextBox2.text = results.rows.item(0).pass
  Else
    MsgBox "error"
  End If
End Function
Posted
Comments
Richard MacCutchan 14-Jun-16 3:17am    
Try checking the database from the command line to make sure it does contain the table you think. Also make sure you spell the table name correctly, especially using upper and lower case in the right places.
Heba Kamel 14-Jun-16 3:33am    
I made this and table already found, my question here is how the code above know that test.db that this is the database I created
because SqlOpenDatabase if doesn't found the database it create new one
and this what happened in my case every time I launch the project the database create again
how to make the project know that I want to use the database I created in sqlite using cmd
or how to get the database that the project created
may be I don't understand well how it works but that's what I understand till now
thanks
Richard MacCutchan 14-Jun-16 3:43am    
You need to ensure that the database you created is in the correct location for your application. I do not know nsb-appstudio so cannot make any suggestions there.
Heba Kamel 14-Jun-16 4:19am    
ok, I'll try again
thanks :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900