Page 1 of 1

MySQLDirect .NET Mobile DataLoader

Posted: Wed 05 Oct 2005 13:12
by wrighty
Hi

Am I missing something, or am I unable to Insert data into a table from a PocketPC. I have no mySqlLoader option, so what is the alternative.

Thanks

Posted: Wed 05 Oct 2005 14:13
by Serious
You can use MySqlCommand class instead of MySqlLoader.

Code: Select all

connection.Open();

CoreLab.MySql.MySqlCommand command = new CoreLab.MySql.MySqlCommand("insert into dept (dname,loc) values (:dname,:loc)", connection);
command.Parameters.Add("dname", CoreLab.MySql.MySqlType.VarChar);
command.Parameters.Add("loc", CoreLab.MySql.MySqlType.VarChar);

command.Parameters["dname"].Value = "prog";
command.Parameters["loc"].Value = "New York";

command.ExecuteNonQuery();

Posted: Wed 05 Oct 2005 14:17
by wrighty
OK I'll give it a try. Thanks

Error

Posted: Thu 06 Oct 2005 12:17
by wrighty
OK, I've had a go at your suggestion, but I am still having problems.

Basically, I am playing with the demo c# code, and am getting an error on the PDA of ConnectionNotInit, but I cannot see where to fix it.

I have the connectform.cs file, have used the DataReader with no problems, but cannot write data to the DB.

Thanks

Posted: Thu 06 Oct 2005 12:44
by Serious
Check you've assigned Connecion property for all components that have it.
I advise you to look at the call stack when exceptiopn occurs: you will find what you need to fix.

Posted: Thu 06 Oct 2005 13:01
by wrighty
Hi

I must confess that I am new to this, but I am not getting any feedback to the callstack???

Posted: Thu 06 Oct 2005 13:21
by Serious
In Visual Studio environment: go to "Exceptions" window (default shortcut is Ctrl+Alt+E), for Common Language Runtime select "Break into debugger" option.
Run your project in emulator (default shortcut is F5).
When excepion occurs, you'll be able to see call stack in debugger window called "Call Stack" (default shortcut is Ctrl+Alt+E).