本文介绍了如何解决最好的重载方法匹配有一些无效的参数数据集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用数据集并且我正确地做了所有事情,字段作为数据库字段



但是这个消息总是出现给我:



编译错误



描述:编译服务此请求所需的资源时出错。请查看以下特定错误详细信息并相应地修改源代码。



编译器错误消息:CS1502:'KutubDataSetTableAdapters.BooksTableAdapter.InsertBook(字符串,字符串,十进制?,int?,int?,ref int)的最佳重载方法匹配?)'有一些无效的论点









I work with data set and I did every thing correctly, the fields as the Database fields

but always this message appears to me:

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS1502: The best overloaded method match for 'KutubDataSetTableAdapters.BooksTableAdapter.InsertBook(string, string, decimal?, int?, int?, ref int?)' has some invalid arguments




 int InsertBook(string BookName, string Description, int Price, int Publisher, int Category, int PublishDate)
    {

        KutubDataSetTableAdapters.BooksTableAdapter Bta = new KutubDataSetTableAdapters.BooksTableAdapter();

        return Bta.InsertBook(BookName, Description, Price, Publisher, Category, PublishDate);}
}





我试图用这个:



I tried to use this:

int InsertBook(string BookName, string Description, decumal? Price, int? Publisher, int? Category,ref int? PublishDate)





它没有成功..



And it didn't success..

推荐答案

int? thePublishDate = PublishDate;
return Bta.InsertBook(BookName, Description, Price, Publisher, Category, ref thePublishDate);



这篇关于如何解决最好的重载方法匹配有一些无效的参数数据集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 10:22