SQLite via C# got an Error

Get help with using AutoHotkey and its commands and hotkeys
Klarion
Posts: 176
Joined: 26 Mar 2019, 10:02

SQLite via C# got an Error

04 Apr 2019, 09:12

Hi
I am trying to use SQLite at AHK via C#
So, I wrote very simple codes as followings

Code: Select all

myCode =
(
	using System;
	using System.Windows.Forms;
	using System.Data;
	using System.Data.SQLite;					
	class myClass
	{
		public void myMethod()
		{         
			string myPath = @"BulahBulah";           
			int myCount;
			using(SQLiteConnection myConnection = new SQLiteConnection(@"Data Source=" + myPath))
			{
				SQLiteCommand myCommand = new SQLiteCommand("SELECT COUNT(*) FROM myTable", myConnection);       
				myConnection.Open();
				myCount = Convert.ToInt32(myCommand.ExecuteScalar());
			}
			MessageBox.Show(myCount.ToString());
		}
	}
)
myReference = 
(	Join|
	mscorlib.dll
	System.dll
	System.Windows.Forms.dll
	System.Data.dll
	System.Data.SQLite.dll
)
CLR_CreateObject(CLR_CompileC#(myCode, myReference), "myClass").myMethod()
But, I have error only

Error: 0x80070002 -
지정된 파일을 찾을 수 없습니다.
(<--Could not find designated file)
Source: ppoyiic4
Description: 파일이나 어셈블리 'System.Data.SQLite, Version=1.0.104.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139'
또는 여기에 종속되어 있는 파일이나 어셈블리 중 하나를 로드할 수 없습니다.
(<--OR Could not load one of dependency file or assembly)
지정된 파일을 찾을 수 없습니다.
(<--Could not find designated file)
HelpFile: (null)
HelpContext: 0


I have placed two dlls at script folder

System.Data.dll
System.Data.SQLite.dll


What seems to be the problem ? version ? referencing ? something else ?

Thanks
Klarion
Posts: 176
Joined: 26 Mar 2019, 10:02

Re: SQLite via C# got an Error

04 Apr 2019, 10:00

System.Data.SQLite.dll ver 1.0.104.0
System.Data.dll ver 4.030319
Target framework 4.5.1
.NET ver 4.7
Klarion
Posts: 176
Joined: 26 Mar 2019, 10:02

Re: SQLite via C# got an Error

04 Apr 2019, 22:51

ah
I have downloaded the file from here

System.Data.SQLite Downloads
https://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki

Precompiled Binaries for 64-bit Windows (.NET Framework 4.0)
sqlite-netFx40-binary-x64-2010-1.0.110.0

It is quite confusing, for bitness.
My computer is 64bit
So, I have downloaded the above file from SQLite site

But, If I check the reference folder for C#, it uses the folder named 32bit
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework
So, "System.Data.dll " is 32bit

Which is right ?
User avatar
kczx3
Posts: 1118
Joined: 06 Oct 2015, 21:39

Re: SQLite via C# got an Error

05 Apr 2019, 18:24

Why do you need to use C# when there is a perfectly good library that wraps sqlite3.dll on this forum?
SOTE
Posts: 1035
Joined: 15 Jun 2015, 06:21

Re: SQLite via C# got an Error

05 Apr 2019, 20:32

Klarion wrote:
04 Apr 2019, 09:12
Hi
I am trying to use SQLite at AHK via C#
Maybe you should use AHK and SQLite more directly. You might want to check this link out-
https://www.autohotkey.com/boards/viewtopic.php?f=6&t=1064
([Class] SQLiteDB)
Klarion
Posts: 176
Joined: 26 Mar 2019, 10:02

Re: SQLite via C# got an Error

05 Apr 2019, 21:44

kczx3 wrote:
05 Apr 2019, 18:24
Why do you need to use C# when there is a perfectly good library that wraps sqlite3.dll on this forum?
Good question
I'm giving you my answer as a question format
Why do you need to use AHK, We have perfectly good library in Python, perl, C, C++, C# and Java already

Have a nice day !
Last edited by Klarion on 05 Apr 2019, 21:49, edited 1 time in total.
Klarion
Posts: 176
Joined: 26 Mar 2019, 10:02

Re: SQLite via C# got an Error

05 Apr 2019, 21:49

SOTE wrote:
05 Apr 2019, 20:32
Maybe you should use AHK and SQLite more directly. You might want to check this link out-
https://www.autohotkey.com/boards/viewtopic.php?f=6&t=1064
([Class] SQLiteDB)
thanks, Good Tip

It lacks sqlite3_create_function that's why
https://www.sqlite.org/c3ref/create_function.html

On the contrary, C# has all of them.
User avatar
kczx3
Posts: 1118
Joined: 06 Oct 2015, 21:39

Re: SQLite via C# got an Error

06 Apr 2019, 06:32

Implementing that in AHK isn’t that hard
Klarion
Posts: 176
Joined: 26 Mar 2019, 10:02

Re: SQLite via C# got an Error

06 Apr 2019, 08:04

you do not have to implement it anything
all are done already
the only problem is to find out the cause of this error from System.Data.SQLite.dll
just me
Posts: 7155
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: SQLite via C# got an Error

06 Apr 2019, 09:36

[offtopic]
Hi IMEime, why did you choose a new user name?
[/offtopic]
SOTE
Posts: 1035
Joined: 15 Jun 2015, 06:21

Re: SQLite via C# got an Error

06 Apr 2019, 11:42

Klarion wrote:
05 Apr 2019, 21:49
SOTE wrote:
05 Apr 2019, 20:32
Maybe you should use AHK and SQLite more directly. You might want to check this link out-
https://www.autohotkey.com/boards/viewtopic.php?f=6&t=1064
([Class] SQLiteDB)
thanks, Good Tip

It lacks sqlite3_create_function that's why
https://www.sqlite.org/c3ref/create_function.html

On the contrary, C# has all of them.
If the only thing that you need is the sqlite3_create_function, so that you can use just AHK and SQLiteDB alone, then why not ask for help in creating that one function? It appears there are a few AHK members that could of helped you do that (which also helps the AHK community).

If SQLiteDB for AutoHotkey is lacking something, the only way to call attention to it and get new code is to make a request and explain the issue. Other AHK members are using SQLiteDB, so will likely want the update or code workaround too.
Klarion
Posts: 176
Joined: 26 Mar 2019, 10:02

Re: SQLite via C# got an Error

06 Apr 2019, 14:47

just me wrote:
06 Apr 2019, 09:36
[offtopic]
Hi IMEime, why did you choose a new user name?
[/offtopic]
everybody do their own job very nicely
You
Me
and somebody else.
the ID you mentioned banned from here
That's why
Good to see you here again
Klarion
Posts: 176
Joined: 26 Mar 2019, 10:02

Re: SQLite via C# got an Error

06 Apr 2019, 14:52

SOTE wrote:
06 Apr 2019, 11:42
If SQLiteDB for AutoHotkey is lacking something, the only way to call attention to it and get new code is to make a request and explain the issue. Other AHK members are using SQLiteDB, so will likely want the update or code workaround too.
If you look into that post carefully
You could find that I do everything I could do
The owner of that post have failed to understand why (s)he has to improve its own codes
So I gave it up

And

If someone gave the answer to this post, It is very good to this Community members too.
It should improve AHK's library one level upward. Right ?
C# is a almost perfect one to use.
Lots of real professionals are working hard for that.
Klarion
Posts: 176
Joined: 26 Mar 2019, 10:02

Re: SQLite via C# got an Error

08 Apr 2019, 00:52

Last call.
AnyBody ?

Return to “Ask For Help”

Who is online

Users browsing this forum: elvo11, teadrinker and 40 guests