用户操作
[留言]  [发消息]  [加为好友] 
订阅我的博客
XML聚合    FeedSky
订阅到鲜果
订阅到Google
订阅到抓虾
u9999的公告
文章分类
    存档

    原创  在C#中捕获sql2000中自定义的错误消息 收藏

    ALTER  PROCEDURE sp_CheckCoInstrState --检查器具状态
     @CoInstrId int  --器具ID
    AS
    declare @TransId as int
    declare @RecvId as int
    declare @Msg as varchar(200)

    if exists(SELECT * from b_CoInstr where CoInstrId=@CoInstrId and takeId<1) begin
     SELECT @TransId=TransId from b_CoInstr where CoInstrId=@CoInstrId and takeId<1
     SELECT @RecvId=RecvId from b_Trans where TransId=@TransId
     set @Msg = '该器具确实没有进行取件登记!请检查委托单:'+Convert(varchar(9),@RecvId)+'!'
     RAISERROR (@Msg, 16, 1)
     return 0
    end
    else begin
     Update CoInstr set StateId=0 where CoInstrId=@CoInstrId
     return 1
    end

    上面这一句RAISERROR (@Msg, 16, 1)
     在C# 中捕获就行了

    发表于 @ 2007年09月06日 12:59:00 | 评论( loading... ) | 编辑| 举报| 收藏

    新一篇:条码打印机编程使用方法 C#

    • 发表评论
    • 评论内容:
    •  
    Copyright © u9999
    Powered by CSDN Blog