If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > C# transact Error Code 1064

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-15-09, 11:00
raulbolanos raulbolanos is offline
Registered User
 
Join Date: Jun 2009
Posts: 4
C# transact Error Code 1064

Hello

I want to send this string but I got this error message.

Code:
string cmdString = @"IF (5 > 0) SELECT dbIndex FROM VerCommonHeader WHERE productNumber = 'XyX' AND internalSerialNumber = 'A1B2C3' AND rtsStatus = 2";

MySqlCommand command = new MySqlCommand(cmdString, m_connection);
ActivateDatabaseApplicationRole();
using (transaction = m_connection.BeginTransaction())
{
	Trace.WriteLine("\n\nBEGIN INSERT\n\n");
	//AC foreach (OleDbCommand command in sqlCommands)
        foreach (MySqlCommand command in sqlCommands)
	{
		Trace.WriteLine(command.CommandText);
		command.Transaction = transaction;
		command.ExecuteNonQuery();
	}
	transaction.Commit();
}
transaction = null;
Why I get this message? how should be the string?
Reply With Quote
  #2 (permalink)  
Old 06-15-09, 11:24
raulbolanos raulbolanos is offline
Registered User
 
Join Date: Jun 2009
Posts: 4
Question Procedure?

Quote:
Originally Posted by raulbolanos
Hello

I want to send this string but I got this error message.

Code:
string cmdString = @"IF (5 > 0) SELECT dbIndex FROM VerCommonHeader WHERE productNumber = 'XyX' AND internalSerialNumber = 'A1B2C3' AND rtsStatus = 2";

MySqlCommand command = new MySqlCommand(cmdString, m_connection);
ActivateDatabaseApplicationRole();
using (transaction = m_connection.BeginTransaction())
{
	Trace.WriteLine("\n\nBEGIN INSERT\n\n");
	//AC foreach (OleDbCommand command in sqlCommands)
        foreach (MySqlCommand command in sqlCommands)
	{
		Trace.WriteLine(command.CommandText);
		command.Transaction = transaction;
		command.ExecuteNonQuery();
	}
	transaction.Commit();
}
transaction = null;
Why I get this message? how should be the string?
Can I send this string or I have to make a procedure?
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On