Click here to Skip to main content
15,879,082 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have successfully set up services for my Silverlight application using Linq to SQL. I just don't know how to correctly configure the service. I need to be able to display query results in the data grid. I am trying to access the stored procedure.

Documentation would help greatly.

This is the IService code.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

// NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService" in both code and config file together.
[ServiceContract]
public interface IService
{
  [OperationContract]
  List<contract> GetContract(string Contract);
}</contract>

I don't know how to structure the Services.cs file- I keep getting errors.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

public class Service : IService
{
    public void DoWork()
    {
    }
}
Posted
Updated 14-Jul-10 15:28pm
v2

See here[^] - maybe it can help.
 
Share this answer
 
Comments
technette 15-Jul-10 10:27am    
Reason for my vote of 5
Great Reference... Thank you.
You should implement all operation contracts declared in IService in your service class.
In Service.cs, you should implement GetContract(string Contract) method and also you didn't specify return type for that method decalaration. Something like,

List<string> GetContract(string Contract);


Better learn more about Interface, Generics & WCF.
 
Share this answer
 
Comments
technette 15-Jul-10 10:27am    
Reason for my vote of 5
Fixed the problem.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900