无效的参数错误

时间:2011-07-22 13:07:59

标签: c# wcf sql-server-2008

我刚刚将我们的Web应用程序数据库从sybase sql 11迁移到SQL Server 2008 R2 express,当我尝试编译与SQL服务器接口的WCF服务时,我发现了多个错误,其中最明显的就是下面的那个。我从不我们的数据库是sybase时看到了这个问题。

Error  5 The best overloaded method match for 
'GlobeMailServiceLibrary.GMDatabaseService.KioskDataSetTableAdapters.Kiosk.CreateFolder(int?, 
string, bool?, bool?, ref int?)' has some invalid arguments
C:\WebMailDev\Code\GlobeMailServiceLibrary\GMDatabaseService\GMDatabaseService.40
 13 GlobeMailServiceLibrary

以下是调用并执行存储过程的WCF服务方法: -

private int CreateFolder(int iUser, string strFolder, bool bUserCreate, bool bOutgoing)
    {
        int iFolder;
        DBEncoder.EncodeObject(ref strFolder);
        KioskAdapter.CreateFolder(iUser, strFolder, bUserCreate, bOutgoing, out
                                  iFolder);            
        return iFolder;
    }

以下是存储过程定义: -

create procedure dbo.CreateFolder( @v_userID integer,@v_foldername varchar(512),@v_IsUserDefined 
                                   bit,@v_IsOutGoing bit,@v_folderID integer Output) 
    AS
    begin
       --set option MAX_STATEMENT_COUNT = 0;
       --set option MAX_CURSOR_COUNT = 0;
        insert into GCK_Folder( Foldername,IsUserDefined,IsOutGoing,UserID ) values( 
                                @v_foldername,@v_IsUserDefined,@v_IsOutGoing,@v_userID ) ;
        set @v_folderID = @@IDENTITY
 end
 go

我注释掉了Set OPTION MAX_STATEMENT_COUUNT和MAX_CURSON_COUNT,因为我不知道SQL Server 2008 R2 express中Sybase的等效命令。

1 个答案:

答案 0 :(得分:0)

您遇到的问题是,GlobeMailServiceLibrary.GMDatabaseService.KioskDataSetTableAdapters.Kiosk.CreateFolder期望ref int?为最后一个参数,而您传递的是out参数,这与所需的签名不匹配