Need Comapct Framework sample

Mar 5, 2010 at 6:11 PM
Edited Mar 5, 2010 at 6:59 PM

I use EffiProz on VB.Net application. Work great.

But I try to use Compact framework version. It didn't work.

I need connection string that I must use for open connection.

I got below message after open connection.

"ArgumentException
Parameter name: exitContext"

Coordinator
Mar 6, 2010 at 1:31 AM

compact framework connection string is identical to regular connection string.

make sure you are linking with CF Dlls. what emulator are you using? Do you get a stacktrace?

Mar 6, 2010 at 4:11 AM

Tanks for quick response.

I used same connection string, Which had used on Win app.

I use it on real device with Wince 5.0.

I add 2 Dlls to reference :

EffiProz.CoreCF.dll

System.Data.EffiProzCF.dll

Coordinator
Mar 6, 2010 at 11:10 AM

Those dlls are compiled on Windows Mobile 5 smartphone sdk. You may need to recompile source on WinCE 5.0.

Mar 24, 2010 at 7:27 AM

I compiled on Wince but I got below message again:

"ArgumentException
Parameter name: exitContext"

I use same way which use on test for CF in your project (On provider). But problem didn't solve.

Coordinator
Mar 24, 2010 at 3:32 PM
Edited Mar 24, 2010 at 3:41 PM

Are you using .Net 2.0 ?

This seems to be a issue with  WaitHandle.WaitOne with exitcontext parameter in .net 2.0.   Check this http://jdconley.com/blog/archive/2006/11/08/compact-framework-waithandle.waitone-gotcha.aspx

Could you try it with .Net 3.5?

Anyway good news is... it compiles okay on WINCE:-)

 

 

Mar 24, 2010 at 8:30 PM
Edited Mar 24, 2010 at 8:31 PM

I use .Net 3.5.

I compile it on debug mode with CF 3.5.

Coordinator
Mar 25, 2010 at 1:27 AM
Edited Mar 25, 2010 at 1:56 AM

Could you check if it works on windows mobile emulator?  Can you share the sample code you are using?

 Also you can try replacing WaitOne(-1,true) with,

Monitor.Exit(x);

y.WaitOne();

Monitor.Enter(x);

if not,

just use

y.WaitOne();

Mar 25, 2010 at 9:07 AM
Edited Mar 25, 2010 at 9:22 AM

I got same error on win mobile 5.0 emulator.

Code I try to use:

        Dim filePath As String = "FileDB"

        Dim strConn As String = "Connection Type=File ; Initial Catalog=" + filePath + "; User=sa; Password=;"

        Dim Conn As EfzConnection = New EfzConnection(strConn)

        Dim sql As String = "DROP TABLE TEST IF EXISTS; CREATE CACHED TABLE TEST(ID INT, NAME VARCHAR(100));"
        Dim command As DbCommand = Conn.CreateCommand()
        command.CommandText = sql

        Conn.Open()
        Dim count As Integer = command.ExecuteNonQuery()
        command.CommandText = "INSERT INTO TEST(ID , NAME ) VALUES(1,'irantha'); INSERT INTO TEST(ID , NAME ) VALUES(NULL,'nuwan');"
        count = command.ExecuteNonQuery()

        command.CommandText = "SELECT * FROM TEST;"
        Dim reader As DbDataReader = command.ExecuteReader()
        System.Diagnostics.Debug.WriteLine(reader.FieldCount)


        While reader.Read()
            If reader.IsDBNull(0) Then
                System.Diagnostics.Debug.WriteLine("ID= " + " Name=" + reader.GetString(1))
            Else
                System.Diagnostics.Debug.WriteLine("ID= " + reader.GetInt32(0) + " Name=" + reader.GetString(1))
            End If
        End While

        command = Conn.CreateCommand()
        command.CommandText = "SHUTDOWN;"
        command.ExecuteNonQuery()

 

 

I got error when I app try to open connetion:

Conn.Open()

Thanks for replays

Coordinator
Mar 25, 2010 at 1:43 PM

Strangely I can't reproduce this with either win mobile 5 or 6...

Coordinator
Mar 27, 2010 at 5:03 PM

See if this works for you  http://effiproz.codeplex.com/releases/view/42650

check on windows mobile 6.5.

 

Apr 17, 2010 at 1:52 PM

Hiya! I'm getting the exact same thing using that packaged version ( CF 1.0 ), works fine on cf 3.5 but breaks on the open connection on cf 2.0.  Igloobone, which changeset did you use to compile the CF1.0 bits? From what I can see in changeset 42650 it doesn't contain any cf bits, perhaps I'm missunderstanding the numbers?

Cheers!