none
.Net CF 2.0 Error , "Can't find PInvoke DLL 'dbnetlib.dll'." RRS feed

  • Question

  • Hi All,

    I'm developing Pocket Pc application, In that i have set of statement, which establishes connection with sql Server 2000 Database. When ever I try to open SqlConnection, I’m getting error "Can't find PInvoke DLL 'dbnetlib.dll'.". Right now i am working in .Net Compact Framework 2.0 , But previously i worked in .Net CF 1.1 i didn’t face problem while doing that. Can any one help me to solve this issue?

      My code exactly look like :

     

    Private SqlCmd As New SqlCommand

    Private SqlTrans As SqlTransaction

    Private SqlConn As SqlClient.SqlConnection

    Private SqlCmdBuilder As SqlCommandBuilder

    Private SqlDataAdapter As SqlDataAdapter

    Public Function Select_DocumentTemplate() As DataSetDocumentTemplate

    Dim DocuMentTemplateDs As New DataSetDocumentTemplate

    Try

    SqlConn = New SqlConnection("Data Source=SERVERNAME;Initial Catalog=DATABASENAME;Persist Security Info=True;User ID=sa")

     If SqlConn.State = ConnectionState.Closed Then

    SqlConn.Open()

    End If

     SqlCmd = New SqlCommand

    SqlCmd.CommandType = CommandType.StoredProcedure

    SqlCmd.CommandText = New StringBuilder(500).Append("Select_documentTemplateDetails").ToString()

    SqlCmd.Connection = SqlConn

    SqlDataAdapter = New SqlDataAdapter(SqlCmd)

    SqlCmdBuilder = New SqlCommandBuilder(SqlDataAdapter)

    SqlDataAdapter.Fill(DocuMentTemplateDs.Ncm_DocumentTemplate)

    Return DocuMentTemplateDs

    Catch ex As Exception

    Throw ex

    Finally

    SqlConn.Close()

    End Try

    End Function

    ' When Ever I try to call above method to retrive data from Db  , It's giving Missingmethod Exception and error message will be "Can't find PInvoke DLL 'dbnetlib.dll'."

    Thanks ,

    Jayakumar.A

     

     

     

     

    Monday, January 16, 2006 5:04 AM

Answers

  • It depends on the OS this device is running.

    sql.ppc.wce4.armv4.CAB - PPC 2003

    sql.phone.wce5.armv4i.CAB - WM 5.0

    Monday, January 16, 2006 5:10 PM
  •  

    I have solved it. The problem is actually the database collation.

     

    Thursday, March 1, 2007 4:01 AM
  • You must use SQL CE 2.0 if you have to use VS 2003 and .NET CF 1.1. The required cab file is in this location on my system, the location will be similar (I have VS 2005):

    C:\Program Files\Microsoft Visual Studio 8\SmartDevices\SDK\SQL Server\Mobile\v2.0\wce400\armv4

    The cab file name is: sqlce20.ppc.wce4.armv4

     

    Wednesday, June 27, 2007 3:34 PM
    Moderator

All replies

  • Please make sure SQL Client CAB is installed on device, you can check in "Remove Programs" applet. If not, please install correct CAB file manually.

     

    CABs can be found in  %ProgramFiles%\Microsoft Visual Studio 8\SmartDevices\SDK\SQL Server\Client\v2.0\"

    Monday, January 16, 2006 5:58 AM
  • Hi

    Yes, Cab file is not installed , Could you please tell me how to find correct cab File for Intel (R) PXA270 processor. Pocket Pc Model is iPAQ Hx2790.

    Thanks ,

    Jayakumar.A

    Monday, January 16, 2006 6:15 AM
  • It depends on the OS this device is running.

    sql.ppc.wce4.armv4.CAB - PPC 2003

    sql.phone.wce5.armv4i.CAB - WM 5.0

    Monday, January 16, 2006 5:10 PM
  • Hi I am experiencing the same error and I can't find any resources how to fix this. What did you do to fix this error. I keep on receiving this error when I ported my application to CF 2.0 from Beta 2 using Visual Studio 2005.

    thanks.
    Sunday, May 7, 2006 4:18 AM
  •  

    Hi ,

     This error occurs, when we try to create SQL CE database or Inserting Data into the SQL CE database before loading forms. We can avoid this error if you do that operation after loading Form and other initialization, I was getting that error because I coded that operation in the form load event. And it’s better to use  

      GC.Collect()

      GC.WaitForPendingFinalizers()

    Before doing that operations.

     

    Thanks ,

    Jayakumar A

    Tuesday, May 9, 2006 5:06 AM
  • Looks like an OS bug to me.  Just moving some code around a bit can cause this problem to appear or disappear.  Also, the only sure fix appears to be a cold boot, i.e., need to reinstall all Cabs.
    Tuesday, November 28, 2006 6:41 PM
  • The same problem for me but it apear at the db connection. I work on VS2005 under VB with à CE 5.00 on 7535 Psion whith xscale processor.

    I don't find the dbnetlib.dll in any dépendance of the file chose for my application cab.

    I would like to install the cab of sqlceclient on the device but i don't now who choose for an xscale procesor.

    is someone know that thanks!!!

     

    Sorry for my english

    Thursday, January 11, 2007 1:43 PM
  • XScale is just an ARM variation, so pick ARM CAB file for Windows CE.

    Thursday, January 11, 2007 7:49 PM

  • Hi ,

    If XScale is just an ARM variation, then you can choose

    sql.ppc.wce4.armv4.CAB - PPC 2003

    sql.phone.wce5.armv4i.CAB - WM 5.0

    -Jayakumar

    Friday, January 12, 2007 9:30 AM
  • Thanks All, it's work properly now. I have just à problem when i do a cold reset but i think it's because the dll isn't storage in the flash disk. I test that.
    Friday, January 12, 2007 9:37 AM
  • hi Ilya Tumanov

    can you tell me from where i can download "sql.phone.wce5.armv4i.CAB - WM 5.0". and how to install it on PDA.

    thanks in advance

    Saturday, February 3, 2007 9:32 AM
  • Hi Lovelu

    Donwload Microsoft SQL Server 2005 Mobile Edition and install.

    You can find it in

    C:\Program Files\Microsoft SQL Server 2005 Mobile Edition\Device\Client\v2.0\wce500\ARMV4I

    Bruno

    Monday, February 5, 2007 8:36 AM
  •  

       I am using windows mobile 5 pocket PC, I installed sql.phone.wce5.armv4i.CAB but still get the error. Any idea?

    Wednesday, February 28, 2007 7:45 AM
  • On Windows Mobile 5 Pocket PC, to install SqlClient, you need to use:

    sql.ppc.wce5.armv4i.CAB

     

    Wednesday, February 28, 2007 8:26 AM
    Moderator
  •  

    I have installed sql.ppc.wce5.armv4i.CAB, but i got an error message "PlatformNotSupportedException". Anything that i am missing?

    I am using a WIFI handheld terminal operating on windows mobile 5.0 PPC with a program to communicate with SQL Server 2005 which is located in a PC via WIFI.

    Thursday, March 1, 2007 2:26 AM
  •  

    I have solved it. The problem is actually the database collation.

     

    Thursday, March 1, 2007 4:01 AM
  •  ErikEJ wrote:

    On Windows Mobile 5 Pocket PC, to install SqlClient, you need to use:

    sql.ppc.wce5.armv4i.CAB

     

     

    Hi,

     

    I am developing mobile app using VS2003 with .net framework 1.1 for my HP iPAQ hx2490b ( has Compact framework ver1 and 2 installed).

     

    What cab file should I use and where can I get it? I tried to extract the cab file above by running the msi file from here but it seems

    that that cab file is not ment for the mobile applications developed with vs 2003.

     

     

    Thanx,

    Wednesday, June 27, 2007 8:12 AM
  • You must use SQL CE 2.0 if you have to use VS 2003 and .NET CF 1.1. The required cab file is in this location on my system, the location will be similar (I have VS 2005):

    C:\Program Files\Microsoft Visual Studio 8\SmartDevices\SDK\SQL Server\Mobile\v2.0\wce400\armv4

    The cab file name is: sqlce20.ppc.wce4.armv4

     

    Wednesday, June 27, 2007 3:34 PM
    Moderator
  •  

    Hi ErikEJ,

     

    Domo arigatou gozaimasu!!

     

    It worked!!

     

    k

    Friday, June 29, 2007 1:32 AM
  •  

    Hi ErikEJ,

     

    Just asking how the developers who have used VS 2003 obtained the sqlce20.ppc.wce4.armv4.cab file? Was that file available for download during the pre VS2005 era?

    Monday, July 2, 2007 7:14 AM
  • It was included in the file system similar to with SQL Mobile 2005 with VS 2005. Can't remember the exact location. You can also download the device DLLs for version 2.0 from here: http://www.microsoft.com/downloads/details.aspx?familyid=B9B12312-FE57-4817-A4BC-69992802732D&displaylang=en

     

    Tuesday, July 3, 2007 6:51 PM
    Moderator
  • Hi,

    I am a beginner on using PDA's, how do i install files on a PDA?

     

    JO

    Wednesday, August 22, 2007 5:14 PM
  • by using ActiveSync4.5 which is the latest updation of Microsoft you can transfer files between ur PDA and PC

    Saturday, December 8, 2007 12:28 PM
  • Hello

    I Am facing the same problem. I have MC3070 WiFI with WindowsCE 4 .0 and i Have installed Sql Ce 2.0

    I want to connect to Database server through WiFi device But I get an Error "SqlException" on my device when i run my aplication. Kindlly Help me in solving the problem.

    Thursday, December 13, 2007 7:32 AM
  • I have a different problem.  I have VS2005 and SQL Server 2005 installed and getting this error message in the Pocket PC Emulator.  Does anyone know what to do about that?  I've read alot on what to do if you get it on an actual device but not the emulator.

     

    Thanks

    Friday, June 27, 2008 2:32 PM
  • Copy the required cab file to the emulator file system, and click it in File Manager (in the Emulator). 

     

    Sunday, June 29, 2008 11:35 AM
    Moderator
  • How do I copy something to the emulator file system? I am not sure where that is.

    Monday, June 30, 2008 12:38 PM
  • You can use the Remote Tools (Remote File Viewer), or you can cradle the device. Look fro example here:

    http://windowsmobilepro.blogspot.com/2006/04/emulator-troubleshootingtip-01-to.html

     

    Monday, June 30, 2008 1:04 PM
    Moderator
  • hi erikej i am havr=eing the same problem but the diffrence in my case that i am using a thin client  hp compaq t5530 with windows ce 5.0

    after days of trying to make the application to even start i got to make it start but my problem now is this same message

    while in the windows mobile emulater and on a i mate jaq 3 mobile i have no problems at all

    i copied the dbnetlib.dll file every where and still doesnt work

    do u have any solution i am realy beginig to get crazy

    thank u in advance

    Wednesday, June 9, 2010 6:45 AM
  • doesnt any one know how to

    i am realy depressed

    Saturday, June 12, 2010 2:15 PM
  • i found it i finnaly found it its in the

    %ProgramFiles%\Microsoft Visual Studio 8\SmartDevices\SDK\SQL Server\Client\v2.0\

    there is a x68 folder where there are the appropiate cab files

    Saturday, June 12, 2010 2:27 PM
  • Hi,

     

    I was able to resolve this after going through this page http://support.microsoft.com/kb/945371

     

    Actually I was installing the wrong SQL CAB file to my emulator. According to the KB article I should use the CAB file from the "C:\Program Files\Microsoft SQL Server Compact Edition\v3.5\Devices\Client\wce500\x86".

    I copied both, "sql.wce5.x86.CAB" and "dbnetlib.dll" files to my emulator. Install the CAB file and it worked.

     

    I copied x86 as I’m using the Windows CE 5.0 emulator for my developments. My development environment is,

    -       Windows 7 Ultimate

    -       VS 2005 Professional

    -       SQL 2008 Express

    -       SQL CE 3.5 SP1

     

    So I hope this would help someone.

     

    Thank you & Regards,

    -Jinantha
    Friday, February 4, 2011 5:03 AM
  •  

    I have solved it. The problem is actually the database collation.

     

    Hi FDSD,

    What kind collaction you use ?

    couse i have some problem..

    Thanks,

    Wednesday, September 26, 2012 7:07 AM
  • I am also getting the same error while developing a windows mobile  application in visual studio 2008 with windows mobile 5.0 emulator , trying to connect to sql server 2005 ,
    Do I need to install the specified cab file or just download it and copy to any specific path (But I don't know the path)..

    Please help...
    Thanks in advance.

    Monday, November 18, 2019 12:01 PM