Re: MySqlBinary exception without any MySqlBinary parameter
Posted by: Martin Domanski
Date: November 10, 2004 07:56AM

Hi,
I also got this problem with 1.0.1-beta 2
SHOW CREATE:
*******************
CREATE TABLE `g_historia`
(
`ID_historia` INTEGER (20) NOT NULL AUTO_INCREMENT ,
`data_wygenerowania` TIMESTAMP NOT NULL ,
`ID_pracownika` bigint (20) NOT NULL DEFAULT 0,
`typ_operacji` tinyint (4) NOT NULL DEFAULT 0,
`opis` text NOT NULL ,
`tabela` varchar (100) NOT NULL ,
`pole` varchar (100),
`rekord` bigint (20),
`stara_wartosc` varchar (200),
`nowa_wartosc` varchar (200),
`old_ID_globalny` bigint (20),
PRIMARY KEY (ID_historia)
) TYPE=MyISAM
*********************

code snippet (using DataSet&CommandBuilder on inserting new row)
translates one table ('m_historia') to another ('g_historia'):
************
tempC = new MySqlCommand(selectTemp, myConn);
tempDA = new MySqlDataAdapter(tempC);
tempCB = new MySqlCommandBuilder(tempDA);
tempDA.Fill(tempDT);

foreach(DataRow dr in importData.Tables["m_historia"].Rows) {
tempDR = tempDT.NewRow();
...
tempDR["data_wygenerowania"] = dr["data_rejestracji"];
...
tempDT.Rows.Add(tempDR);
}
tempDA.Update(tempDT); <- here goes exception:
****************
MySql.Data.MySqlClient.MySqlException: Only byte arrays can be serialized by MySqlBinary
at System.Data.Common.DbDataAdapter.Update(DataRow[] dataRows, DataTableMapping tableMapping)
...
****************
I didn't try with 1.0.0 beta...
maybe I should not assign objects directly (like a["colnameA"] = b["colnameB"]) but parse them first?

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.