Hi
I'm trying to use VB in VS.NET 2003 to iput data from a PDA to a MySQL database.
Could someone give an example of how to do this please.
Thanks
Insert records using VB in Visual Studio .NET 2003
If you use MySQLDirect .NET and want to Insert/Update/Delete rows in database table with Pocket PC you can use the same technicue as in common Windows application.
Some limitations are caused by controls restrictions in .NET Compact Framework. For instance, DataGrid component does not allow data modifications. Use custom dialogs in this case.
Some limitations are caused by controls restrictions in .NET Compact Framework. For instance, DataGrid component does not allow data modifications. Use custom dialogs in this case.
Error trying to insert data
I get the following error
An unhandled exception of type 'System.ArgumentException' occurred in CoreLab.MySql.dll
Additional information: ParameterValueMissing
on this line
Dim myConnection As New MySqlConnection(myConnectionString)
myConnectionString isset as
myConnectionString = "Database=mysqldb;Data Source=localhost;User Id=root;Password="
The full code is
Private Sub cmdSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSubmit.Click
' If the connection string is null, use a default.
If myConnectionString = "" Then
myConnectionString = "Database=mysqldb;Data Source=localhost;User Id=root;Password="
End If
Dim myConnection As New MySqlConnection(myConnectionString)
Dim myInsertQuery As String = "INSERT INTO test_table (Name, Telephone, Job) Values('" & TxtName.Text & "', '" & TxtTelephone.Text & "', '" & TxtJob.Text & "')"
Dim myCommand As New MySqlCommand(myInsertQuery)
myCommand.Connection = myConnection
myConnection.Open()
myCommand.ExecuteNonQuery()
myCommand.Connection.Close()
Close()
End Sub
Help please
An unhandled exception of type 'System.ArgumentException' occurred in CoreLab.MySql.dll
Additional information: ParameterValueMissing
on this line
Dim myConnection As New MySqlConnection(myConnectionString)
myConnectionString isset as
myConnectionString = "Database=mysqldb;Data Source=localhost;User Id=root;Password="
The full code is
Private Sub cmdSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSubmit.Click
' If the connection string is null, use a default.
If myConnectionString = "" Then
myConnectionString = "Database=mysqldb;Data Source=localhost;User Id=root;Password="
End If
Dim myConnection As New MySqlConnection(myConnectionString)
Dim myInsertQuery As String = "INSERT INTO test_table (Name, Telephone, Job) Values('" & TxtName.Text & "', '" & TxtTelephone.Text & "', '" & TxtJob.Text & "')"
Dim myCommand As New MySqlCommand(myInsertQuery)
myCommand.Connection = myConnection
myConnection.Open()
myCommand.ExecuteNonQuery()
myCommand.Connection.Close()
Close()
End Sub
Help please