MySQLDirect .NET Mobile DataLoader

MySQLDirect .NET Mobile DataLoader

Postby 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
wrighty
 
Posts: 6
Joined: Wed 05 Oct 2005 13:00

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

Postby 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

Postby 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
wrighty
 
Posts: 6
Joined: Wed 05 Oct 2005 13:00

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

Postby 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???
wrighty
 
Posts: 6
Joined: Wed 05 Oct 2005 13:00

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


Return to dotConnect for MySQL