本文介绍了无法将insert语句放在业务逻辑中。方法没有重载需要21个参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好。我的问题是我想为插入添加另一个字段,即ImagePath。

但是当我尝试在业务逻辑中添加插入ImagePath的逻辑时,它显示SP_INSERT_INTO_FONDATION_BOLT_MST方法没有重载需要21个参数。 br />


'SP_INSERT_INTO_FONDATION_BOLT_MST'是用于插入的存储过程。



以下是业务逻辑

Hi. My problem is I want to add another field for insert i.e ImagePath.
But when I try to add the logic for Insert ImagePath in business logic it shows No overload for 'SP_INSERT_INTO_FONDATION_BOLT_MST' method takes 21 arguments.

'SP_INSERT_INTO_FONDATION_BOLT_MST' is the stored procedure used for insert.

Below is the business logic

public class FoundationBoltLogic
    {
        protected MastersDataContext context = new MastersDataContext();

        public string InsertData(FoundationBoltEntities BoltEntity)
        {

            ISingleResult<SP_INSERT_INTO_FONDATION_BOLT_MSTResult> ds = context.SP_INSERT_INTO_FONDATION_BOLT_MST(BoltEntity.JBoltNos, BoltEntity.JBoltNos_desc, BoltEntity.JBoltDia, BoltEntity.JBoltDia_desc, BoltEntity.YieldStress, BoltEntity.YieldStress_desc, BoltEntity.PitchCircleDia, BoltEntity.PitchCircleDia_desc, BoltEntity.BoltLen, BoltEntity.BoltLen_desc, BoltEntity.ProjectedBLen, BoltEntity.ProjectedBLen_desc, BoltEntity.Cost, BoltEntity.Product_Type, BoltEntity.Bolt_Type, BoltEntity.ED_ACC, BoltEntity.UNIT_OF_MEASUREMENT, BoltEntity.IsActive, BoltEntity.CreatedBy, BoltEntity.CreatedOn, BoltEntity.ImagePath);

            string strResult = "ERROR";

            foreach (SP_INSERT_INTO_FONDATION_BOLT_MSTResult row in ds)
            {
                strResult = row.STATUS;
                if (strResult == "ERROR")
                {
                    strResult = row.ERROR_MESSAGE;
                }

            }

            return strResult;
        }





请建议我可以做些什么来插入另一个字段。我在表格中创建了ImagePath字段。并且还在存储过程中添加。



Please suggest what can I do to insert another field. I have created ImagePath field in the table. And also added in stored procedure.

推荐答案

1. Open your .edmx file.
2. In the Model Browser, right-click the .edmx file and select "Update Model from Database".
3. Click the Refresh tab.
4. Click Finish button to update the .edmx file with the database changes.





提前点击链接



[]



这篇关于无法将insert语句放在业务逻辑中。方法没有重载需要21个参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-22 21:44