Click here to Skip to main content
15,867,141 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to save user details in my database, whenever i click on save button it shows this error
"Unable to load DLL 'SQLite.Interop.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)"
See the code below
C#
string dbConnectionString = @"Data Source=database.db;version=3;";

        private void btn_save(object sender, RoutedEventArgs e)
        {
            SQLiteConnection sqliteCon = new SQLiteConnection(dbConnectionString);
            //Open connection to database
            try
            {
                sqliteCon.Open();
                string Query = "insert into student (Registration Number,First Name,Last Name,Middle Name,Gender,Age,Contact Address,Contact Phone,Email Address,Class) values('" + this.RegTbx.Text + "','" + this.TbxFn.Text + "','" + this.LnTbx.Text + "','" + this.MnTbx.Text + "','" + this.GenCmb.Text + "','" + this.AgeCmb.Text + "','" + this.AddTbx.Text + "','" + this.PhoneTbx.Text + "','" + this.EmTbx.Text + "','" + this.ClassCmb.Text + "',)";
                SQLiteCommand createCommand = new SQLiteCommand(Query, sqliteCon);
                createCommand.ExecuteNonQuery();
                MessageBox.Show("Saved");
                sqliteCon.Close();
               
            }
            catch (Exception ex) 
            {
                MessageBox.Show(ex.Message);
            }

Kindly help
Posted
Updated 4-May-15 0:16am
v2
Comments
Joan Magnet 4-May-15 6:24am    
sounds like you need to copy this .dll to the project's folder.

1 solution

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