Using MySqlCommandBuilder With .net?

Nov 14, 2009

I am having a problem getting the mySqlCommandBuilder to work. It does not appear that it is creating the Update/Insert/Delete commands. I am using Visual Basic 2008 Express Edition.When I run the code in debug and set a breakpoint at the "myDataAdapter.Update(myDataSet, myTableName)" line and use "Watch" to examine the "myadapter" parameters, the "UpdateCommand", "InsertCommand" and "DeleteCommand" show as "Nothing". The "SelectCommand" shows the correct "SELECT" statement.

[Code]...

View 7 Replies


ADVERTISEMENT

MySQLCommandBuilder And Foreign Key

May 7, 2012

I have a pretty standard MySQL-query in my winform application like this:SELECT * FROM tblTable WHERE tblTable.tableID = " & variable..One of the fields is a foreign key. And when I try to add a record to my datagridview I get the error:Cannot add or update a child row: a foreign key constraint fails..Can't MySQLCommandBuilder make INSERT-commands with tables containing foreign keys?

View 2 Replies

Error:When MySqlCommandBuilder.ReturnGeneratedIdentifiers Is True, MySqlCommand.UpdatedRowSource Must Be Set To None

Jun 1, 2009

I am using the following

Dim cmC As New MySqlCommand()
Dim daC As New MySqlDataAdapter()
Private Sub btnClientSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClientSave.Click

[code].....

When I add 1 client it works fine, but when I try adding another I get the following error:

When MySqlCommandBuilder.ReturnGeneratedIdentifiers is true, MySqlCommand.UpdatedRowSource must be set to None.

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved