• Welcome, Guest. Please login.
 
September 22, 2019, 05:37:40 am

News:

Welcome to the SQLitening support forums!


SQLitening and VB.NET?

Started by radosamo, January 11, 2010, 04:59:01 pm

Previous topic - Next topic

radosamo

Hi from Slovakia,

I think to use the SQLitening with Visual Studio 2008 and write my little aplication with VB.NET.
Is it possible?
Please give me some impuls or link to the sample source code with information how I can to do it.

Thanks.

Rado Samudovsky

Fred Meier

Hi Rado and welcome to SQLitening.  The Special API works fine with VB so
should probable also work with .Net.  Try it first.  If the Special API
does not work then try the Universal API. 

The following is from the SQLitening.Txt file and is also contained in the
SQLitening.Chm help file.

Quote#========================<[ SQLitening API's ]>=========================
SQLitening comes with three different API's as follows:
   Basic     ---  Dll name is SQLitening.Dll
             ---  Include name is SQLitening.Inc
             ---  All routines begin with sl.
   Special   ---  Dll name is SQLiteningS.Dll
             ---  Include name is SQLiteningS.Inc
             ---  All routines begin with sls.
   Universal ---  Dll name is SQLiteningU.Dll
             ---  Include name is SQLiteningU.Inc
             ---  All routines begin with slu.

All DLL's are written in PowerBASIC and use the SDECL (aka STDCALL)
convention for parameter passing.  SDECL specifies that the declared
procedure uses the "Standard Calling Convention" as defined by Microsoft. 
When calling an SDECL procedure, parameters are passed on the stack from
right to left and the stackl is automatically cleaned before execution
returns to the calling code. 

PowerBASIC allocates strings using the Win32 OLE string engine. 
This allows you to pass strings from your program to DLLs, or
API calls that support OLE strings.


   Which API or DLL should you use?

Basic:: Always try to use the Basic API.  If you language supports passing
OLE strings both ByVal and ByRef then you should be able to use the Basic
API.  OLE strings are allocated using the Win32 OLE string engine.  There
are some routines in the Basic API that will probably only work with
PowerBASIC.  slSelAry is one that passes an array and therefore may only
work in PowerBASIC.  You may need to modify the include file
(SQLitening.Inc) to support your language

Special:: If your language supports OLE string passing but only ByRef
(Visual Basic) then the Special API will probable work for you.  The
language must also support optional parameter passing.  The slSelAry is
not available in this API.  You will need to modify the include file
(SQLiteningS.Inc) to support your language This DLL is a front-end to the
Basic API. 

Universal:: If your language does not support OLE strings then the Special
API will probable work for you.  This API will work for any language that
can call a standard Dll.  The parameter passing is patterned after the
Windows API.  The slSelAry is not available in this API.  You will need to
modify the include file (SQLiteningU.Inc) to support your language This
DLL is a front-end to the Basic API.  Documentation about parameter passing
is located in the include file.

radosamo

Hi Fred,

thank you and I goig to try it.

Rado

radosamo

Hi Fred,

In the first I have one plea for your help.
I have the problem get the dll's to VB.NET and using the function fro them. Please can you preper som elementary sample demo solution  with server and client side demonstrating the elementary function of SQLitening database?
(Server - configure the name, port and start/stop service;;;;  Client - detection existing/create/delete database or table,  and add/edit/delete the records)   
It is the possible for you?

In the second I have one question?
Is the SQLitening good way to write little client/server aplication without robust database machine with central database at the local server and with maximum 5 clients connect to the database via ethernet from their PC's?

Thank you.

Rado
.

Fred Meier

Rado,

I recommend you learn SQLite/SQLitening using only local mode.  Stay away
from client/server until your have mastered SQLite/SQLitening in local
mode. 

There are PowerBasic examples included in the download.  I do not have VB
nor VB.Net so I can not provide you examples in those languages.  There are
other users that use VB.  Maybe they can help you. 

QuoteIn the second I have one question?
Is the SQLitening good way to write little client/server aplication without robust database machine with central database at the local server and with maximum 5 clients connect to the database via ethernet from their PC's?

Yes, I believe SQLitening would be fine for the above environment.


radosamo

Fred,

thank you for your information.

Rado

xsigns

hi rado,
here a litle sample in vb.net and csharp

VB.Net class
Public Function Connect(ByVal Server As String, ByVal port As Integer, ByVal connectionMode As String, ByVal Database As String, ByVal DBMode As String) As Boolean

Public Function GetDataTable(ByVal Statement As String, ByVal rsMode As String) As DataTable

cSharp
test_vb.Class1 sqlitening = new test_vb.Class1();
sqlitening.connect("localhost", 4400, "T2", "test.db", "RT5");
dataGridView2.DataSource = sqlitening.GetDataTable("select * from users", "");