Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/301.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# JSONWebService未实现接口成员_C#_Asp.net_Json - Fatal编程技术网

C# JSONWebService未实现接口成员

C# JSONWebService未实现接口成员,c#,asp.net,json,C#,Asp.net,Json,我在asp.net c代码中遇到错误 这是错误 “JSONWebService.Service1”未实现接口成员“JSONWebService.IService1.GetAllAccountClassifications” 这是我的密码: using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.ServiceModel;

我在asp.net c代码中遇到错误

这是错误

“JSONWebService.Service1”未实现接口成员“JSONWebService.IService1.GetAllAccountClassifications”

这是我的密码:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using System.Data.SqlClient;

namespace JSONWebService
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "Service1" in code, svc and config file together.
    public class Service1 : IService1
    {
        SqlConnection conn = new SqlConnection("Data Source=ASDASDASDAS1;Initial Catalog=ULIV;Persist Security Info=True;User ID=uliv_user;Password=******");

        public List<wsAccountClassification> GetAllCustomers()
        {
            ULIVDataContext dc = new ULIVDataContext();
            SqlCommand myCommand = new SqlCommand("Select * from AccountClassifications",conn );

            List<wsAccountClassification> results = new List<wsAccountClassification>();
            System.Globalization.CultureInfo ci = System.Globalization.CultureInfo.GetCultureInfo("en-US");

            foreach (AccountClassification AcctClass in dc.AccountClassifications)
            {
                results.Add(new wsAccountClassification()
                {
                    AccountClassificationID = AcctClass.AccountClassificationID,
                    ClassificationName = AcctClass.ClassificationName,
                    ClassificationDescription = AcctClass.ClassificationDescription
                });
            }

            return results;
        }
}
}
请帮忙。 提前感谢

在IService1接口中定义了一个名为GetAllAccountClassifications的方法。您正在实现该接口,因此您应该实现类中在IService1中定义的所有方法。正如错误所述,在这种情况下,您应该实现GetAllAccountClassifications方法