MySQLDirect .NET Mobile DataLoader

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply
wrighty
Posts: 6
Joined: Wed 05 Oct 2005 13:00

MySQLDirect .NET Mobile DataLoader

Post by wrighty » Wed 05 Oct 2005 13:12

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

Serious

Post by Serious » Wed 05 Oct 2005 14:13

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();

wrighty
Posts: 6
Joined: Wed 05 Oct 2005 13:00

Post by wrighty » Wed 05 Oct 2005 14:17

OK I'll give it a try. Thanks

wrighty
Posts: 6
Joined: Wed 05 Oct 2005 13:00

Error

Post by wrighty » Thu 06 Oct 2005 12:17

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

Serious

Post by Serious » Thu 06 Oct 2005 12:44

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.

wrighty
Posts: 6
Joined: Wed 05 Oct 2005 13:00

Post by wrighty » Thu 06 Oct 2005 13:01

Hi

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

Serious

Post by Serious » Thu 06 Oct 2005 13:21

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

Post Reply