Tuesday, March 6, 2012

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

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

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\"

|||

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

|||

It depends on the OS this device is running.

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

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

|||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.|||

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

|||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.|||

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 dpendance 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

|||

XScale is just an ARM variation, so pick ARM CAB file for Windows CE.

|||


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

|||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.|||

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

|||

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

|||

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

|||

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

sql.ppc.wce5.armv4i.CAB

No comments:

Post a Comment