存储过程未显示在Designer中 [英] Stored Procedure does not show up in the Designer

查看:68
本文介绍了存储过程未显示在Designer中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为customers表创建了一个更新程序("UpdateCustomer")。只需从tableadapters命令的下拉框中选择我的DeleteCustomer和InsertCustomer过程,就可以将其分配给客户的表表适配器。我的存储过程"UpdateCustomer"未在UpdateCommand的CommandText属性中列出。我的代码是syntex还是有问题,或者我需要更改另一个属性以允许我将Table的update命令更改为我的存储过程吗?


I've created an update procedure for my customers table ("UpdateCustomer").  My DeleteCustomer and InsertCustomer procedures can be assigned to the customer's table table adapter simply by selecting them from the drop down box on the tableadapters commands.  My stored procedure "UpdateCustomer" is not listed in the UpdateCommand's CommandText property. Is there something wrong my codes syntex or is there another property that I need to change to allow me to change the Table's updatecommand to my stored procedure?

ALTER PROCEDURE dbo.UpdateCustomer
(
    @CustName nvarchar(255),
    @Contact nvarchar(100),
    @BusinessPhone nvarchar(50),
    @MobilePhone nvarchar(50),
    @Phone nvarchar(50),
    @Address nvarchar(255),
    @City nvarchar(255),
    @State char(2),
    @Zip nvarchar(10),
    @Contact2 nvarchar(100),
    @EMail nvarchar(255),
    @Notify1 nvarchar(100),
    @Notify2 nvarchar(100),
    @Notify3 nvarchar(100),
    @NotifyWho1 nvarchar(100),
    @NotifyWho2 nvarchar(100),
    @NotifyWho3 nvarchar(100),
    @FaxNumber nvarchar(50),
    @NotifyOnce1 bit,
    @NotifyOnce2 bit,
    @NotifyOnce3 bit,
    @Latitude float,
    @Longitude float,
    @Taxable bit,
    @TaxCode nvarchar(20),
    @CurrName nvarchar(50),
    @InQB bit,
    @Active bit,
    @AddNote1 bit,
    @AddNote2 bit,
    @AddNote3 bit,
    @CustTax nvarchar(50),
    @PriceLevel nvarchar(225),
    @Notes nvarchar(MAX),
    @CustName1 nvarchar(50),
    @CustName2 nvarchar(50),
    @CustName3 nvarchar(50),
    @CustName4 nvarchar(50),
    @CustName5 nvarchar(50),
    @CustName6 nvarchar(50),
    @CustName7 nvarchar(50),
    @CustName8 nvarchar(50),
    @CustName9 nvarchar(50),
    @CustName10 nvarchar(50),
    @CustName11 nvarchar(50),
    @CustName12 nvarchar(50),
    @CustName13 nvarchar(50),
    @CustName14 nvarchar(50),
    @CustName15 nvarchar(50),
    @CustField1 nvarchar(50),
    @CustField2 nvarchar(50),
    @CustField3 nvarchar(50),
    @CustField4 nvarchar(50),
    @CustField5 nvarchar(50),
    @CustField6 nvarchar(50),
    @CustField7 nvarchar(50),
    @CustField8 nvarchar(50),
    @CustField9 nvarchar(50),
    @CustField10 nvarchar(50),
    @CustField11 nvarchar(50),
    @CustField12 nvarchar(50),
    @CustField13 nvarchar(50),
    @CustField14 nvarchar(50),
    @CustField15 nvarchar(50),
    @OnWeb bit,
    @ReportNum int,
    @AddrOnWeb bit,
    @PassTxt nvarchar(50),
    @UserTxt nvarchar(50),
    @Addr1 nvarchar(255),
    @Addr2 nvarchar(255),
    @Addr3 nvarchar(255),
    @Addr4 nvarchar(255),
    @Addr5 nvarchar(255),
    @Marketing nvarchar(255),
    @SendEmail2 bit,
    @SendEmail3 bit,
    @SendTxt2 bit,
    @SendTxt3 bit,
    @Location nvarchar(250),
    @Website nvarchar(200),
    @CustomerID int,
    @Modified timestamp OUTPUT
)
AS
 SET NOCOUNT ON;
 
 UPDATE Customers SET 
    CustName = @CustName,
     Contact = @Contact,
    BusinessPhone  = @BusinessPhone,
    MobilePhone = @MobilePhone,
    Phone = @Phone,
    Address = @Address,
    City = @City,
    State = @State,
    Zip = @Zip,
    Contact2 = @Contact2,
    EMail = @EMail,
    Notify1 = @Notify1,
    Notify2 = @Notify2,
    Notify3 = @Notify3,
    NotifyWho1 = @NotifyWho1,
    NotifyWho2 = @NotifyWho2,
    NotifyWho3 = @NotifyWho3,
    FaxNumber = @FaxNumber,
    NotifyOnce1 = @NotifyOnce1,
    NotifyOnce2 = @NotifyOnce2,
    NotifyOnce3 = @NotifyOnce3,
    Latitude = @Latitude,
    Longitude = @Longitude,
    Taxable = @Taxable,
    TaxCode = @TaxCode,
    CurrName = @CurrName,
    InQB = @InQB,
    Active = @Active,
    AddNote1 = @AddNote1,
    AddNote2 = @AddNote2,
    AddNote3 = @AddNote3,
    CustTax = @CustTax,
    PriceLevel = @PriceLevel,
    Notes = @Notes,
    CustName1 = @CustName1,
    CustName2 = @CustName2,
    CustName3 = @CustName3,
    CustName4 = @CustName4,
    CustName5 = @CustName5,
    CustName6 = @CustName6,
    CustName7 = @CustName7,
    CustName8 = @CustName8,
    CustName9 = @CustName9,
    CustName10 = @CustName10,
    CustName11 = @CustName11,
    CustName12 = @CustName12,
    CustName13 = @CustName13,
    CustName14 = @CustName14,
    CustName15 = @CustName15,
    CustField1 = @CustField1,
    CustField2 = @CustField2,
    CustField3 = @CustField3,
    CustField4 = @CustField4,
    CustField5 = @CustField5,
    CustField6 = @CustField6,
    CustField7 = @CustField7,
    CustField8 = @CustField8,
    CustField9 = @CustField9,
    CustField10 = @CustField10,
    CustField11 = @CustField11,
    CustField12 = @CustField12,
    CustField13 = @CustField13,
    CustField14 = @CustField14,
    CustField15 = @CustField15,
    OnWeb = @OnWeb,
    ReportNum = @ReportNum,
    AddrOnWeb = @AddrOnWeb,
    PassTxt = @PassTxt,
    UserTxt = @UserTxt,
    Addr1 = @Addr1,
    Addr2 = @Addr2,
    Addr3 = @Addr3,
    Addr4 = @Addr4,
    Addr5 = @Addr5,
    Marketing = @Marketing,
    SendEmail2 = @SendEmail2,
    SendEmail3 = @SendEmail3,
    SendTxt2 = @SendTxt2,
    SendTxt3 = @SendTxt3,
    Location = @Location,
    Website = @Website
 WHERE (CustomerID = @CustomerID) AND (Modified = @Modified) ;

 IF @@ROWCOUNT>0 AND @@ERROR=0
 -- Selects the updated timestamp which is put back into the dataset
   SELECT @Modified = Modified
   FROM Customers
   WHERE (CustomerID = CustomerID);
 ELSE
 -- Report an update conflict if there was one
   RAISERROR 50000 'Concurrency violation on table Customer.'

推荐答案



您的意思是在创建TableAdapter时,您找不到在"将命令绑定到现有存储过程"中创建的UpdateCustomer过程" TableAdatper配置向导的步骤?

一般情况下,数据库中映射到TableAdapter的所有程序都可以显示在下拉列表中,如果找不到,请确保已成功在正确的数据库中创建过程,如果仍然看不到该过程,则可以选择"创建新的存储过程"。在"选择命令类型"中配置向导的步骤,并在即将到来的空白处复制您的程序代码。

如果这不能回答您的问题,请随时将该帖子标记为未回答并回复。
<谢谢。

Hi,
 
Do you mean when you create a TableAdapter, and you can't find the UpdateCustomer procedure you created in the "Bind Commands to Existing Stored Procedure " step of TableAdatper configuration wizard?


Generally, all procedures in the database which map to the TableAdapter can be displayed in the dropdownlist,  if you can't find it, please make sure that the procedure has been created in the right database successfully, if you still can't see that procedure, you can choose "Create new stored procedures" in "Choose Command Type" step of the configuration wizard, and copy your procedure code in the coming blank.

If this does not answer your question, please feel free to mark the post as Not Answered and reply.

Thanks.


这篇关于存储过程未显示在Designer中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆