When I run cmd.ExecuteScalar () or cmd.ExecuteNonQuery (), the Output and InputOutput parameters in the command object are updated from the changes to the stored procedure. However, the same does not happen for cmd.ExecuteReader (). This happens on both Sql Server and MySql Connections. Is this design behavior?
Hey, this can help you. clicky ...
It seems like this could be a problem in certain circumstances.
The output parameters are only available after reading at the end of the recordset.
For example, in this procedure:
alter procedure db.TestProc(@p int output) as select 1 select 1 set @par = 1
@par , . SELECT, . , , .
You should be able to get the value through the Output parameter. Take a look at this article on MS support and see if your problem is one of those mentioned: link text
Also, what are you trying to return? If this is just one value, it would be useful to use ExecuteScalar () rather than ExecuteReader ().
Source: https://habr.com/ru/post/1720267/More articles:Easy way to implement a computer board in Java - javaСохранение значений любого типа как типа, первоначально поставляемого в шаблоном factory в С++? - c++Java connection pool without JNDI? - javaLINQ TO SQL SQL query generated - linq-to-sqlAccessing a method from a template derived class without using virtual functions in C ++? - c ++ASP.NET: проверка размера файла (ширина и высота) перед загрузкой - c#Fluent NHibernate: rarely used properties as a component or in a separate table? - mappingHow to get a list of all possible exceptions that may occur in a specific area - javagenerate viewmodel from model? - c #C # Outlook does not move all emails - c #All Articles