| |

VerySource

 Forgot password?
 Register
Search
Author: 摩羯可乐

Executing the stored procedure has no effect, but no error is reported, but the stored procedure executes normally in th

[Copy link]

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 Invalid IP Address

Post time: 2020-3-16 23:45:01
| Show all posts
Your method name is too. . . .
Reply

Use magic Report

1

Threads

60

Posts

37.00

Credits

Newbie

Rank: 1

Credits
37.00

 Finland

 Author| Post time: 2020-3-17 14:15:01
| Show all posts
I also don't want to use this method. We have a basic class that executes stored procedures. I used it, but the execution did not report an error, but there was no effect.
Execution in the Query Analyzer has effect, so try another method and see if there is a problem there
Reply

Use magic Report

1

Threads

60

Posts

37.00

Credits

Newbie

Rank: 1

Credits
37.00

 Unknown

 Author| Post time: 2020-3-18 00:15:01
| Show all posts
public void JiSuanZongHe (string faid, string bjid, string xsid)
        {
            string Error = "";
            SqlParameter [] para = {
                                     new SqlParameter ("@ faid", SqlDbType.NVarChar, 40),
                                    new SqlParameter ("@ bjid", SqlDbType.NVarChar, 40),
                                   new SqlParameter ("@ xsid", SqlDbType.NVarChar, 40),
                                     new SqlParameter ("@ error", SqlDbType.NVarChar, 500)
                                  };
            para [0] .Value = faid;
            para [1] .Value = bjid;
            para [2] .Value = xsid;
            para [3] .Direction = ParameterDirection.Output;


    HNXL.Utility.DbHelperSQL.RunProcedure ("P_JISUAN_ZHCJ", para, out Error);
}
This is the earliest I wrote to execute other stored procedures without problems
Reply

Use magic Report

1

Threads

60

Posts

37.00

Credits

Newbie

Rank: 1

Credits
37.00

 China

 Author| Post time: 2020-3-18 10:00:02
| Show all posts
ALTER procedure P_JISUAN_ZHCJ
@FAID varchar (40), --Required parameter
             @BJID VARCHAR (40), --Required parameter
             @XSID VARCHAR (40), --XSID is empty when calculating the overall grade of the class, XSID is not empty when calculating the comprehensive grade of a single student
@Error varchar (500) output
as


Stored procedure content
Too many not listed

  If @@ error <> 0
  Begin
    select @ Error = 'error'
    GOTO errHandle
  End
  set @ Error = '0'
  return
errHandle:
  SET @ Error = '1'
Reply

Use magic Report

1

Threads

18

Posts

15.00

Credits

Newbie

Rank: 1

Credits
15.00

 China

Post time: 2020-3-18 16:15:01
| Show all posts
Take a look at the event viewer
Reply

Use magic Report

1

Threads

60

Posts

37.00

Credits

Newbie

Rank: 1

Credits
37.00

 China

 Author| Post time: 2020-3-20 09:15:01
| Show all posts
See the execution in the event viewer
Reply

Use magic Report

3

Threads

26

Posts

13.00

Credits

Newbie

Rank: 1

Credits
13.00

 China

Post time: 2020-3-23 13:45:01
| Show all posts
m_com.ExecuteNonQuery ();
Reply

Use magic Report

0

Threads

4

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-3-27 14:15:01
| Show all posts
ExecuteNonQuery () returns the number of rows affected by the command
Reply

Use magic Report

0

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 LAN

Post time: 2020-4-1 22:15:02
| Show all posts
Bangding!
Reply

Use magic Report

0

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-5-3 22:00:01
| Show all posts
1 See if you can get the results in the query analyzer
2. P_JISUAN_ZHCJ This should be the name of your stored procedure, did not see the call reflected in your code
3. m_com.CommandType = CommandType.Text; This seems wrong
4.m_com.ExecuteNonQuery (); I do n’t see any stuff that receives your return. It ’s not good, you take a look at his response.write
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list