2014-02-26 2 views
0

я столкнуться с ошибкой в ​​моей asp.net C# кодJSONWebService не реализует элемент интерфейса

здесь ошибка

«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; 
     } 
} 
} 

ПОМОГИТЕ. СПАСИБО ЗАРАНЕЕ

ответ

0

Существует метод с именем GetAllAccountClassifications определен в IService1 interface.You реализует этот интерфейс, так что вы должны реализовать все методы внутри вашего класса, которые определяют в IService1 .Каке ошибка сказала, что вы должны реализовать GetAllAccountClassifications метод в Это дело.

Смежные вопросы