dbTalk Databases Forums  

Re: Regarding making a successful connection to UltaLite from Visual Stuio 2005

sybase.public.sqlanywhere.ultralite sybase.public.sqlanywhere.ultralite


Discuss Re: Regarding making a successful connection to UltaLite from Visual Stuio 2005 in the sybase.public.sqlanywhere.ultralite forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jayaram Krishnaswamy
 
Posts: n/a

Default Re: Regarding making a successful connection to UltaLite from Visual Stuio 2005 - 09-07-2007 , 09:55 AM






I am just testing to see if I can establish a connection to the UltraLite
database through a Pocket
PC 2003 SE emulator device deployment using the Visual Studio 2005. I
develop a reference to the custdb.db using the Visual Studio and SQL
Anyhwere Explorer which gives me a number of canned tables:

ULCustomer
ULCustomerIDPool
ULIdentifyEmployee_nosync
ULOrder
ULOrderIDPool
ULProduct

I drag one of these tabels to the
Form1.vb code page to a button click event code:
This produces the following code(auto generated)
Dim UlConnection As New
iAnywhere.Data.UltraLite.ULConnection(";ce_file=\P rogram
Files\WinFrm\custdb.udb;nt_file=C:\Documents and Settings\All
Users\Documents\SQL Anywhere
10\Samples\UltraLite.NET\CustDB\common\custdb.udb; uid=dba;pwd=sql")

Dim UlCommand As New iAnywhere.Data.UltraLite.ULCommand("SELECT ""cust_id"",
""cust_name"" FROM ""ULCustomer""", UlConnection)

Dim UlResultSet As iAnywhere.Data.UltraLite.ULResultSet

UlConnection.Open()

UlResultSet = UlCommand.ExecuteResultSet()

When I build and run this I get the following error:
Can't find PInvoke DLL 'ulnet10.dll'.

Exception detail follows:
-------------------------------------
System.MissingMethodException was unhandled
Message="Can't find PInvoke DLL 'ulnet10.dll'."
StackTrace:
at iAnywhere.Data.UltraLite.ULDatabaseManager..ctor()
at iAnywhere.Data.UltraLite.ULConnection..cctor()
at TestDevice.Form1.Button1_Click()
at System.Windows.Forms.Control.OnClick()
at System.Windows.Forms.Button.OnClick()
at System.Windows.Forms.ButtonBase.WnProc()
at System.Windows.Forms.Control._InternalWnProc()
at Microsoft.AGL.Forms.EVL.EnterMainLoop()
at System.Windows.Forms.Application.Run()
at TestDevice.Form1.Main()


-------------------------------------
The first Dim statement is the offending line.

The ulnet10.dll does exist on this machine at : C:\Program Files\SQL
Anywhere 10\win32
It's version matches with the versions of the added references.

The Added refreences to this project are:
iAnywhere.Data.UltraLite type=.NET Version:10.0.0.2465
iAnywhere.Data.UltraLite.resources typr=.NET Version:10.0.0.2465

Appreciate any help.

Jayaram


ps:

Ultralite with a windows application works fine where the DataGridViewer
wizard establishes the connectivity.



Reply With Quote
  #2  
Old   
Chris Keating (Sybase iAnywhere)
 
Posts: n/a

Default Re: Regarding making a successful connection to UltaLite from VisualStuio 2005 - 09-08-2007 , 09:05 PM






Place the file in same directory as the exe generated for the application.

Jayaram Krishnaswamy wrote:
Quote:
I am just testing to see if I can establish a connection to the UltraLite
database through a Pocket
PC 2003 SE emulator device deployment using the Visual Studio 2005. I
develop a reference to the custdb.db using the Visual Studio and SQL
Anyhwere Explorer which gives me a number of canned tables:

ULCustomer
ULCustomerIDPool
ULIdentifyEmployee_nosync
ULOrder
ULOrderIDPool
ULProduct

I drag one of these tabels to the
Form1.vb code page to a button click event code:
This produces the following code(auto generated)
Dim UlConnection As New
iAnywhere.Data.UltraLite.ULConnection(";ce_file=\P rogram
Files\WinFrm\custdb.udb;nt_file=C:\Documents and Settings\All
Users\Documents\SQL Anywhere
10\Samples\UltraLite.NET\CustDB\common\custdb.udb; uid=dba;pwd=sql")

Dim UlCommand As New iAnywhere.Data.UltraLite.ULCommand("SELECT ""cust_id"",
""cust_name"" FROM ""ULCustomer""", UlConnection)

Dim UlResultSet As iAnywhere.Data.UltraLite.ULResultSet

UlConnection.Open()

UlResultSet = UlCommand.ExecuteResultSet()

When I build and run this I get the following error:
Can't find PInvoke DLL 'ulnet10.dll'.

Exception detail follows:
-------------------------------------
System.MissingMethodException was unhandled
Message="Can't find PInvoke DLL 'ulnet10.dll'."
StackTrace:
at iAnywhere.Data.UltraLite.ULDatabaseManager..ctor()
at iAnywhere.Data.UltraLite.ULConnection..cctor()
at TestDevice.Form1.Button1_Click()
at System.Windows.Forms.Control.OnClick()
at System.Windows.Forms.Button.OnClick()
at System.Windows.Forms.ButtonBase.WnProc()
at System.Windows.Forms.Control._InternalWnProc()
at Microsoft.AGL.Forms.EVL.EnterMainLoop()
at System.Windows.Forms.Application.Run()
at TestDevice.Form1.Main()


-------------------------------------
The first Dim statement is the offending line.

The ulnet10.dll does exist on this machine at : C:\Program Files\SQL
Anywhere 10\win32
It's version matches with the versions of the added references.

The Added refreences to this project are:
iAnywhere.Data.UltraLite type=.NET Version:10.0.0.2465
iAnywhere.Data.UltraLite.resources typr=.NET Version:10.0.0.2465

Appreciate any help.

Jayaram


ps:

Ultralite with a windows application works fine where the DataGridViewer
wizard establishes the connectivity.



Reply With Quote
  #3  
Old   
Jayaram Krishnaswamy
 
Posts: n/a

Default Re: Regarding making a successful connection to UltaLite from Visual Stuio 2005 - 09-09-2007 , 02:56 PM



Do you mean the Project directory or the 'bin' directory?
"Chris Keating (Sybase iAnywhere)" <keating_spam_free (AT) ianywhere (DOT) com> wrote
in message news:46e354d4$1 (AT) forums-1-dub (DOT) ..
Quote:
Place the file in same directory as the exe generated for the application.

Jayaram Krishnaswamy wrote:
I am just testing to see if I can establish a connection to the UltraLite
database through a Pocket
PC 2003 SE emulator device deployment using the Visual Studio 2005. I
develop a reference to the custdb.db using the Visual Studio and SQL
Anyhwere Explorer which gives me a number of canned tables:

ULCustomer
ULCustomerIDPool
ULIdentifyEmployee_nosync
ULOrder
ULOrderIDPool
ULProduct

I drag one of these tabels to the
Form1.vb code page to a button click event code:
This produces the following code(auto generated)
Dim UlConnection As New
iAnywhere.Data.UltraLite.ULConnection(";ce_file=\P rogram
Files\WinFrm\custdb.udb;nt_file=C:\Documents and Settings\All
Users\Documents\SQL Anywhere
10\Samples\UltraLite.NET\CustDB\common\custdb.udb; uid=dba;pwd=sql")

Dim UlCommand As New iAnywhere.Data.UltraLite.ULCommand("SELECT
""cust_id"",
""cust_name"" FROM ""ULCustomer""", UlConnection)

Dim UlResultSet As iAnywhere.Data.UltraLite.ULResultSet

UlConnection.Open()

UlResultSet = UlCommand.ExecuteResultSet()

When I build and run this I get the following error:
Can't find PInvoke DLL 'ulnet10.dll'.

Exception detail follows:
-------------------------------------
System.MissingMethodException was unhandled
Message="Can't find PInvoke DLL 'ulnet10.dll'."
StackTrace:
at iAnywhere.Data.UltraLite.ULDatabaseManager..ctor()
at iAnywhere.Data.UltraLite.ULConnection..cctor()
at TestDevice.Form1.Button1_Click()
at System.Windows.Forms.Control.OnClick()
at System.Windows.Forms.Button.OnClick()
at System.Windows.Forms.ButtonBase.WnProc()
at System.Windows.Forms.Control._InternalWnProc()
at Microsoft.AGL.Forms.EVL.EnterMainLoop()
at System.Windows.Forms.Application.Run()
at TestDevice.Form1.Main()


-------------------------------------
The first Dim statement is the offending line.

The ulnet10.dll does exist on this machine at : C:\Program Files\SQL
Anywhere 10\win32
It's version matches with the versions of the added references.

The Added refreences to this project are:
iAnywhere.Data.UltraLite type=.NET Version:10.0.0.2465
iAnywhere.Data.UltraLite.resources typr=.NET Version:10.0.0.2465

Appreciate any help.

Jayaram


ps:

Ultralite with a windows application works fine where the DataGridViewer
wizard establishes the connectivity.



Reply With Quote
  #4  
Old   
Chris Keating (Sybase iAnywhere)
 
Posts: n/a

Default Re: Regarding making a successful connection to UltaLite from VisualStuio 2005 - 09-09-2007 , 07:34 PM



Check out the Ultralite.NET tutorial which provides the technique:

Link the UltraLite component to your project.

In this step, ensure that you add a link to the component, and that you
do not Open the component.

1)From the Project menu, choose Add Existing Item and browse to the
ultralite\UltraLite.NET\ce subdirectory of your SQL Anywhere installation.

2) Set the Files of Type drop down to All Files so that DLL files are
displayed.

3) Open the folder corresponding to the processor of the CE device you
are using (for the Pocket PC emulator, open the x86 folder) and select
ulnet9.dll. Do not click Open.

4) Click the arrow on the Open button and select Link File to link it to
your project.


Jayaram Krishnaswamy wrote:
Quote:
Do you mean the Project directory or the 'bin' directory?
"Chris Keating (Sybase iAnywhere)" <keating_spam_free (AT) ianywhere (DOT) com> wrote
in message news:46e354d4$1 (AT) forums-1-dub (DOT) ..
Place the file in same directory as the exe generated for the application.

Jayaram Krishnaswamy wrote:
I am just testing to see if I can establish a connection to the UltraLite
database through a Pocket
PC 2003 SE emulator device deployment using the Visual Studio 2005. I
develop a reference to the custdb.db using the Visual Studio and SQL
Anyhwere Explorer which gives me a number of canned tables:

ULCustomer
ULCustomerIDPool
ULIdentifyEmployee_nosync
ULOrder
ULOrderIDPool
ULProduct

I drag one of these tabels to the
Form1.vb code page to a button click event code:
This produces the following code(auto generated)
Dim UlConnection As New
iAnywhere.Data.UltraLite.ULConnection(";ce_file=\P rogram
Files\WinFrm\custdb.udb;nt_file=C:\Documents and Settings\All
Users\Documents\SQL Anywhere
10\Samples\UltraLite.NET\CustDB\common\custdb.udb; uid=dba;pwd=sql")

Dim UlCommand As New iAnywhere.Data.UltraLite.ULCommand("SELECT
""cust_id"",
""cust_name"" FROM ""ULCustomer""", UlConnection)

Dim UlResultSet As iAnywhere.Data.UltraLite.ULResultSet

UlConnection.Open()

UlResultSet = UlCommand.ExecuteResultSet()

When I build and run this I get the following error:
Can't find PInvoke DLL 'ulnet10.dll'.

Exception detail follows:
-------------------------------------
System.MissingMethodException was unhandled
Message="Can't find PInvoke DLL 'ulnet10.dll'."
StackTrace:
at iAnywhere.Data.UltraLite.ULDatabaseManager..ctor()
at iAnywhere.Data.UltraLite.ULConnection..cctor()
at TestDevice.Form1.Button1_Click()
at System.Windows.Forms.Control.OnClick()
at System.Windows.Forms.Button.OnClick()
at System.Windows.Forms.ButtonBase.WnProc()
at System.Windows.Forms.Control._InternalWnProc()
at Microsoft.AGL.Forms.EVL.EnterMainLoop()
at System.Windows.Forms.Application.Run()
at TestDevice.Form1.Main()


-------------------------------------
The first Dim statement is the offending line.

The ulnet10.dll does exist on this machine at : C:\Program Files\SQL
Anywhere 10\win32
It's version matches with the versions of the added references.

The Added refreences to this project are:
iAnywhere.Data.UltraLite type=.NET Version:10.0.0.2465
iAnywhere.Data.UltraLite.resources typr=.NET Version:10.0.0.2465

Appreciate any help.

Jayaram


ps:

Ultralite with a windows application works fine where the DataGridViewer
wizard establishes the connectivity.



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.