C# JSONWebService未实现接口成员
我在asp.net c代码中遇到错误 这是错误 “JSONWebService.Service1”未实现接口成员“JSONWebService.IService1.GetAllAccountClassifications” 这是我的密码: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;
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方法