Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2009
    Posts
    4

    Unanswered: 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?

  2. #2
    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?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •