.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

TableAdapter Fill() not returning result over WCF Service

Posted By:      Posted Date: September 30, 2010    Points: 0   Category :WCF

Firstly I must mention I'm new to WCF and relatively new to .NET Development - so what I'm doing might not be the best way to do it.


My problem is that when I indirectly use a table adapter's Fill() over a WCF Service connection to fill a strongly typed DataTable - it fills the table, but in the calling function, the table remains empty.


I’m busy creating a proof-of-concept using Visual Studio 2010 Professional on Windows 7 Professional accessing MS SQL 2008.

I’m trying to create an n-tier setup and thus have the following 5 projects:

1. "MsSqlDataAccess" - a project containing the TableAdapters from a strongly typed dataset.

2. "Entity" - I've separated my DataSet from the "MsSqlDataAccess" to be in this project.

3. "Comm" - WCF Service using netTCPBinding.

 - This makes available GetUsers() and FillUsers().

 - FillUsers() can either take a dataset or a datatable.

 - Above mentioned methods call the applicable TableAdapter methods.

4. "Service" - a Windows Service hosting the WCF Service.

5. "WpfTestClient" - a WPF client consuming the service.


I can return a filled DataTable when I use the TableAdapter's Get() method via the WCF service's GetUsers() method.<

View Complete Post

More Related Resource Links

reading the result of a web service (XML)


Hi all,

I registered for a service that returns me the geolocation of the visitor and i process it in my exe application (c#).

But i dont know how to read that data in cs?

Here is the link that i send : 


and returning page content ;  

<?xml version="1.0" encoding="UTF-8" ?>
  <provider>Turk Telekom</provider>

Error calling WCF service that is returning list.".Debugging resource strings are unavailable ......

Ok.this is just making me frustrated... Here is step by step of what I am trying to do (& not able to) 1. I am calling WCF service hosted in a SharePoint 2010 site from a silverlight app in same domain (So no cross doman I guess). 2. I use Linq to Sharepoint for querying the DB. 3. I am having a list "machines" in Sharepoint 2010 that is having a lookup column from Other list called "part" 4. My WCF method GetAllMachines() works perfectly well when it skips the lookup column "partname" & returns List of type machineitem. 5. But problem occurs when I add machineitemobject.parts.partsname in my Linq to Sharepoint query . My service gives the error not found Async_ExceptionOccurred] Arguments: Debugging resource strings are unavailable." 6. Note that return type of my Method is List<machinesitem> 7. The point to note here is that I use SPMETAL tool to generate the LINQ class that maps the lists . So When I try to query the lookup column it tries to add List item of the type class & that is what causing the error. Is it because I am not using datacontract in my service (but it returns the strings & all private members of machines list e.g. name,title etc) Is it making the attribute Serialisable will solve the error ??? I am kind of lost in it ...Plss help!!   Thanks

Binding Web Service Result in asp:gridview and enable sorting(paiging)

Hello everyoneI have web service and gridviewI'm binding it without problemcode: protected void Page_Load(object sender, EventArgs e) { GetCallsService wservice = new GetCallsService(); List<Call> list = wservice.getCalls(2); GridView1.DataSource = list; //GridView1.AllowSorting = true; GridView1.DataBind(); } But I want to enable sorting and(or) paging.   GridView1.AllowSorting = true; this doen't solves problem.everything worls fine if I'm usign sqlDatasource but when datasource is web service it doesn't wokdoes enyone know solution?

WCF service returning old values

Hi. I am developing an application with WCF services. The basic functionaloty of a screen is to provide an entry screen to add particular entity. Once save even fired It will save the data to the database and call the bind method to bind into the grid by refreshing the latest data. When I am running the site from my source (Visual Studio) , it works perfectly. When the client calls method to fetch the data the WCF service, it returns latest (added) data. But the issue comes in the server when it works with IIS. I deployed the code in the server, once the data added I am getting the old data only. But after two refresh I am getting the latest data. Could you please let me know what required to be done to get the latest record. Many Thank, Kelvin Kumar

wcf returning a list from wcf service - I have lots of locations and I want to return the locations


How is it possible to return some kind of list from a wcf serivce, this the method in my wcf service 
my interface:

    [WebInvoke(Method = "GET",
        ResponseFormat = WebMessageFormat.Json,
        BodyStyle = WebMessageBodyStyle.Wrapped,
        UriTemplate = "Locations")]
    IList<Location> GetLocations();

 public IList<Location> GetLocations()
        Pazar.Data.Repositories.LocationRepository locRepository = new Pazar.Data.Repositories.LocationRepository();
        return locRepository.GetRootLocations().ToList<Location>();

and this how my GetRootLocations looks like, It returns IQueryable, I wounder if I can maybee return Iqueryable from my svc-service?

public IQueryable<Location> GetRootLocations()
        IQueryable<Location> locations = GetAll().Where(p => !p.ID_Parent.HasValue).OrderBy(p => p.Sequence);
        return locations;

calling web service from SSIS return result as null



I got this result

<Result>The result is null. Either the result is null or the Web method returns void.</Result> 
 when I calling web service from SSIS. I setup HTTP connection and tested without any problem; download WSDL without any problem; I did exactly as the link: http://msdn.microsoft.com/en-us/library/ms181267.aspx. From input editor, I selected service and method. For the chosen method, there will be 3 variables (1 input parameter, 2 output parameters). For the input variable, I defined the package variable as string, and copied XML content to the variable as the value. I will select this defined package variable as the input parameter. I then moved to defined output file.
 When I run the simple package, I will get the output file as result as above. What is wron

User Profile Service not returning security groups


I just got the User Profile Service working, and tried using GetCommonMemberships but I am only getting Distro lists and Sharepoint groups.  No security groups (Domain Local, Global, Universal) are showing up.

I did come across one post where someone was not running in Native mode AD, its possible since I *JUST* ADPrepped and added a 2008 DC today that I'm back in a mixed mode and that is the problem...?  Seems weird tho.   Just checked on the new 2008 DC it says Windows 2003 mode or something along those lines

Sharepoint itself is able to see and use the security groups.  If I change permissions on a List or library, I am able to select security groups.  It seems specific to the User Profile Service.

A little more looking... it seems that DL's show up, and Universal security groups show up.  Domain Local and Domain Global security groups do not.




Assigning XML Tag Names Within ASP Web Service Returning Jagged Array



I am using an ASP webservice to return a jagged array.  I need to be able to define the tags names in the XML which is returned.  How do I do this?


Code and Example XML follow.




        orderListId = new string[100];
        orderListTime = new string[100];
        orderListEmail = new string[100];
        orderListStatus = new string[100];
        orderListSubtotal = new string[100];

        int orderCount = 0;
        foreach (DataRow drRow in dtResult.Rows)
            orderListId[orderCount] = (drRow["SubmittedFormId"].ToString());
            orderListTime[orderCount] = (drRow["SubmitTime"].ToString());
            orderListEmail[orderCount] = (drRow[&quo

How to bind distinct values to DropDownList from DataSet (as a result of a web service call)?


Hi there,

I'm trying to bind a dataset (where the data is coming from a webservice) to a dropdownlist; the problem is that I'm getting duplicates in the list... how can I display distinct values only:

drp_Brand.DataSource = ds.Tables[0];
            drp_Brand.DataTextField = "Brand";
            drp_Brand.DataValueField = "Brand";



WCF Service returning DataTable for silverlight client



I am creating a WCF 3.0 service which will fetch data from the database and return mostly in DataTable and DataSet format. I am building a Silverlight client for consuming this service. But what I found is Silverlight 3.0 does not support datatable or dataset. Unfortunately most of my datas are returned in the datatable format. Is there any way to consume datatable in silver light or converting datatable to generic list or LINQ before returning them? If it is possible to convert datatable to generic collection, does it possible without iteration? This is because converting hundreds of records by iterating will affect my performance.

Thanks in Advance!!!!

Best regards,
Subalakshmi Vijayarajan.

Subalakshmi Vijayarajan.

WCF service over https returning error


I am trying to deploy a wcf service. I have created a simple service, basically I have created a new wcf service and tried to deploy it however I get this error

The type 'WCF_Application.Service1', provided as the Service attribute value in the ServiceHost directive, or provided in the configuration element system.serviceModel/serviceHostingEnvironment/serviceActivations could not be found.


I am trying to deploy my service to a subdomain like https://services.mydomain.com/business


My config looks like this


      <service name="WCF_Application.Service1">
        <endpoint address="Business" binding="wsHttpBinding" contract="WCF_Application.IService1"
            <dns value="services.mydomain.com" />
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
            <add baseAddress="https://services.mydomain.com/" />

WCF service hosted in IIS 7 returning error "Security settings for this service require 'Anonymous'

Using the CalculatorService provided as a WCF sample from MSDN, I tried to host it as an application in IIS 7. The virtual folder in IIS is configured as Basic Authentication enabled and Anonymous Authentication disabled. I don't have any certificates setup. This is all hosted in a single machine setting. Each time I access the service through a browser, I'm getting the error "Security settings for this service require 'Anonymous' Authentication but it is not enabled for the IIS application that hosts this service".

Below is my web.config --

Can someone please provide some answer, I don't want to enable Anonymous authentication in IIS. I even set the 

aspNetCompatibilityEnabled = true.

<?xml version="1.0"?>


Service returning Object fails when object is complex class


Hi. I have created a WPF client and a self-hosted WCF Service based on an interface, in wich alle methods returns a standard response class. An example of one such method definition is:

Response CreateAccount(AccountCreationParams accountParams);


The response object is defined as:



public class Response



public string ResponseText;


public bool CompletedSuccesfully;



How to setup a ReceiveReply activity to receive the result of a WCF service operation?


I already figured out what I have to do to send a WCF message to a WCF service developed with .NET, but I could not get the result back to the workflow. I need to know what I have to do to get that result. 

I have a very simple test WCF service with following contract:

[ServiceContract(Namespace = http://www.juergen-bayer.net/samples/wcf)]
public interface IDemoService
  long Add(int value1, int value2);

The client application uses a workflow with a Send and a ReceiveReply activity. The WCF endpoint is configured in the config file:

   name="BasicHttpBinding_IDemoService" />

The Send activity is configured like follows:

Action="http://www.juergen-bayer.net/samples/wcf/IDemoService/Add" => This would also be the default value in my case

The parameters of the WCF message are placed in the content: 


correct way to fill a DataTable with a TableAdapter method


I have a dataset with a table adapter that has several queries. I want to execute on of the queries and fill a data table but am having trouble with this operation. Am I invoking my table adapter incorrectly? See line 56. Thanks.

//check to see if there are any nearby properties
//using the "GetNearbyProperties" method in the membersTableAdapter
//create a new DataTable to hold the results
DataTable NearbyProperties = new DataTable();

//declare a new instance of the membersTableAdapter
maineinnsDataset = new App_Code.DataAccessLayer.MaineInnsDataset();
MembersTableAdapter = new App_Code.DataAccessLayer.MaineInnsDatasetTableAdapters.membersTableAdapter();
//run the query and fill the NearbyProperties DataTable
//pass a parameter to the SQL select query (City = @City), use PreviousTown for the value

//any records returned by GetNearbyProperties?
int rows = NearbyProperties.Rows.Count;
if (rows != 0)  



Web Services - Returning a Cookie from the web service im calling after authentication



I am trying to call an authentication method on a web service that returns a cookie, however when i call the web service, I just get the SOAP object returned, how do i get the cookie back after I have been authenticated ?

Any help or pointers appriciated

Kindest regards


Windows Service Applications Tutorials

You can easily create services by creating an application that is installed as a service. For example, suppose you want to monitor performance counter data and react to threshold values. You could write a Windows Service application that listens to the performance counter data, deploy the application, and begin collecting and analyzing data.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend