Database Reference
In-Depth Information
dataAdapter.Fill(dataSet);
connection.Close();
return dataSet.Tables[0];
}
}
}
now copy the code in Listing 4-4, open the IServerStatus.cs file, and paste
the code in it.
It is good practice to add a Test Project for any projects you create as
this would perform the first level of unit testing.
Best Practice
Listing 4-4. WCF Service library Interface Class
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.Data;
namespace WcfDataProvider
{
// NOTE: You can use the "Rename" command on the "Refactor" menu
to change the interface name "IServerStatus" in both code and config
file together.
[ServiceContract]
public interface IServerStatus
{
[OperationContract]
DataTable GetServerStatusDetails();
}
}
Build the wCF project in release mode and make sure that there are no errors.
Create a local folder in your file system under C:\ and name it wcfServicehost.
Make a folder called bin.
Copy the wcfDataProvider.dll file to the bin folder.
Make sure that network Service and IIS_IUSrS users have read & execute
permissions on the root folder.
 
 
Search WWH ::




Custom Search