0

get error cannot find table although database already in correct path!. I also already put SQLite.Interop.dll on my project file

Edited by ara_tul87: wrong spelling

2
Contributors
6
Replies
9
Views
5 Years
Discussion Span
Last Post by ara_tul87
0
SQLiteConnection conn = new SQLiteConnection();
            //SQLiteDataAdapter da;
            SQLiteCommandBuilder cb;
            DataTable dt=new DataTable();
            int row = 0;
            
            conn.ConnectionString = "Data Source=C:\\database\\info";
            conn.Open();--->error here

            DataRow dr = dt.NewRow();
            dr["name"] = txtName.Text;
            dr["address"] = txtAddress.Text;
            dr["phone"] = txtPhone.Text;
            dr["position"] = txtPosition.Text;
            dt.Rows.Add(dr);
            da.Update(dt);

            row = dt.Rows.Count - 1;
            txtName.Text = dt.Rows[row]["name"].ToString();
            txtAddress.Text = dt.Rows[row]["address"].ToString();
            txtPhone.Text = dt.Rows[row]["phone"].ToString();
            txtPosition.Text = dt.Rows[row]["position"].ToString();
        
            da.Fill(dt);

            cb = new SQLiteCommandBuilder(da);
            
            conn.Dispose();
            conn.Close();
0

Are you giving the full file name (e.g. info.db) or literally as you have it here - Data Source=C:\\database\\info?

yes, that is full path name... I already use info database to at my windows form application and it's work well but when i reuse that database on windows mobile it's not working...
any idea?

0

Is "cannot find table" the exact error message you are getting? Because at the point you stay you are getting the error (opening the connection) it shouldn't be locating a particular table it should be attempting to connect to the database.

0

Sorry about that, the exactly error is Unable to open database error

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.