473,413 Members | 1,755 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

Problem sensind Transactions

Hi guys,

I want to send this transaction but I got an error.

Expand|Select|Wrap|Line Numbers
  1. string cmdString = @"IF (5 > 0) BEGIN PRINT 'Hi..' END";
  2.  
  3. MySqlCommand command = new MySqlCommand(cmdString, m_connection);
  4. ActivateDatabaseApplicationRole();
  5. using (transaction = m_connection.BeginTransaction())
  6. {
  7.     Trace.WriteLine("\n\nBEGIN INSERT\n\n");
  8.     //AC foreach (OleDbCommand command in sqlCommands)
  9.         foreach (MySqlCommand command in sqlCommands)
  10.     {
  11.         Trace.WriteLine(command.CommandText);
  12.         command.Transaction = transaction;
  13.         command.ExecuteNonQuery();
  14.     }
  15.     transaction.Commit();
  16. }
  17. transaction = null;
  18.  
whather that an IF or Variable declaration I get this error: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IF (5 > 0) BEGIN PRINT 'hallo' END"..........

what do you think?

thank you.
Jun 15 '09 #1
0 919

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Vanchau Nguyen | last post by:
Hi all, Hoping someone can help us with this strange Innodb problem. At about 5:15 AM 2/2/04 (this morning), our slave server stopped accepting connections. The machine was pingable, but you...
6
by: Hennie de Nooijer | last post by:
Hi, Currently we're a building a metadatadriven datawarehouse in SQL Server 2000. We're investigating the possibility of the updating tables with enormeous number of updates and insert and the...
7
by: Richard Maher | last post by:
Hi, I am seeking the help of volunteers to test some software that I've developed which facilitates distributed two-phase commit transactions, encompassing any resource manager (e.g. SQL/Server...
11
by: Mike P | last post by:
I've been using C# transactions for a while and had no problems with them. Using try catch blocks I can trap basically all possible errors and rollback all necessary data. Over the last few...
8
by: Don Riesbeck Jr. | last post by:
I have an C# EnterpriseService component that is part of an application I am developing that is responsible for writing data to an SQL Server. (it reads from a local DB (MSDE), then writes to a...
0
radcaesar
by: radcaesar | last post by:
Customer Table ID Name Address City Phone 1 Vijay Stores 6,Gandhi Road Pondy 0413-276564 2 Ram Stores 3, MG Road, Pondicherry 0413-29543756 3 Balu Papers 3, RG...
0
radcaesar
by: radcaesar | last post by:
Hi All, I Have Three Tables, Customer NewTransaction Transactions The Customer Table Have details about customer and the Transactions table had details of the transactions with gross...
4
by: Ron | last post by:
Hi All, I've got a client/transaction type of database where tblClient is linked to tblTransactions via ClientID. The client table contains all clients from day one. The transaction table...
1
by: Jan | last post by:
Hi: I've been tearing my hair out over this one for a few days; did a search of the archives and found similar questions but no real answers. Here goes: This is an application for a retail...
1
kiemxai
by: kiemxai | last post by:
you see that,i did correct or not? PROBLEM ANALYSIS For an introduction to program transaction journal, see the background section of assignment . Not only transaction journal, but also inventory...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.