How to execute a stored procedure within C# program

前端 未结 13 1655
别跟我提以往
别跟我提以往 2020-11-22 00:10

I want to execute this stored procedure from a C# program.

I have written the following stored procedure in a SqlServer query window and saved it as stored1:

<
13条回答
  •  终归单人心
    2020-11-22 00:36

    Please check out Crane (I'm the author)

    https://www.nuget.org/packages/Crane/

    SqlServerAccess sqlAccess = new SqlServerAccess("your connection string");
    var result = sqlAccess.Command().ExecuteNonQuery("StoredProcedureName");
    

    Also has a bunch of other features you might like.

提交回复
热议问题