Sumit Kumawat

Sumit Kumawat

  • NA
  • 454
  • 415.9k

SQlite connectivity through Window Service...

Mar 29 2012 5:11 AM

Hi all,

i am creating one window service  in this onStart i am writing code for SQlite query as below

    protected override void OnStart(string[] args)
        {
#if (DEBUG)
            Debugger.Launch();
            string ns = "insert into test (Name,Version,Date) values ('new',6,'2012-12-12')";
            //sn.ConnectionString = "Data Source=sumit.s3db;Version=3;New=False;Compress=True;";
            sn = new SQLiteConnection(@"Data Source=E:\sumit.s3db;Version=3;New=False;Compress=True;");
            sn.Open();
            cmd = sn.CreateCommand();
            cmd.CommandText = ns;
            cmd.ExecuteNonQuery();
            sn.Close();
#endif
        }

But i am getting error"Unable to load DLL 'SQLite.Interop.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)"

even i put this .dll in bin folder also but its not working abd same code running in my C# application without any error.


Answers (2)