A
A
Alexander Alexandrovich2014-03-16 22:02:42
MySQL
Alexander Alexandrovich, 2014-03-16 22:02:42

How to execute the request correctly?

Hello guys. Please help me understand why a request of this type does not work:
"Before this section, I connect to the database and execute 1 request, after that I want to execute the second one, but something goes wrong .."

IDbCommand lolo = dbcon.CreateCommand ();
    string sqlto = "INSERT INTO `tranzakcii`(`nomertranzakcii`, `idc`, `price`, `datetranzakcii`) VALUES (0,1,100700,0)";
    lolo.CommandText = sqlto;
    lolo.ExecuteNonQuery ();

It does not give any errors, the application closes immediately.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dobriykot, 2014-08-21
@dobriykot

Have you tried wrapping this code in a try-catch and debugging to see what happens there?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question