locked
SQLite error "SQLite error no such table:" RRS feed

  • Question

  • User387006649 posted

    Hi,

    I am developing windows mobile application. I am using SQLite for database.

    using System.Data.SQLite;
    using System.IO;

     

     

    SQLiteConnection con = new SQLiteConnection();
                try
                {
                    string path = @"new.db";
                    if (File.Exists(path))
                    {
                        con.ConnectionString = "Data Source="+ path;
                    }
                    con.Open();

                    SQLiteCommand cmd = con.CreateCommand();

                    SQLiteDataAdapter DB = new SQLiteDataAdapter("select name from user", con);
                    DataSet ds = new DataSet();
                    DB.Fill(ds);
                    label1.Text = ds.Tables[0].Rows[0][0].ToString();
                }
                catch (Exception ex)
                {
                }
                finally
                {
                    con.Close();
                }

     

    Here I getting error "SQLite error no such table:user"

     

    Anyone having solution please share with me

    Friday, April 1, 2011 5:00 AM

Answers

  • User387006649 posted

    Thanks for reply Yasser, I got the solution the code is write.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, April 2, 2011 3:24 AM

All replies

  • User1637850196 posted

    Firstly check wether a user table exist in your db new. If not then please let me know the line at which this exception occurs.

    Regards,

     

    Friday, April 1, 2011 5:37 AM
  • User387006649 posted

    Thanks for reply Yasser, I got the solution the code is write.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, April 2, 2011 3:24 AM