N
N
nika092017-06-07 23:05:28
SQL
nika09, 2017-06-07 23:05:28

How to display all data from a table in Unity?

How to display all data in a row from a table in Unity? I have this code, but it gives an error:

cmd_db = new SqliteCommand ("SELECT * from Users", con_db);
    rdr = cmd_db.ExecuteReader();
while (rdr.Read())
    {
      txt = txt + rdr [0].ToString ()+" ," + rdr [1].ToString ()+", " + rdr [2].ToString (); 
      text.text = txt;
    }

This displays the last entry from the table:
cmd_db = new SqliteCommand ("SELECT * from Users", con_db);
    rdr = cmd_db.ExecuteReader();
    while (rdr.Read ()) 
    {
      text.text = rdr[1].ToString ();
      text1.text = rdr[2].ToString ();
      text2.text = rdr[3].ToString ();
    }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
n-fom, 2017-06-08
@nika09

One to one question
https://stackoverflow.com/questions/9302239/why-is...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question