locked
DomainDataSource.QueryParameters How does it work? RRS feed

Answers

  • Essentially the same.

    this.dds.QueryParameters.Add(new Parameter { ParameterName = "country", Value = "RU" });

    Kyle

    Friday, July 24, 2009 11:12 AM
  • here how it works in c#

     

    var context = ddsDetailInfo.DomainContext as WATGDomainContext;

    context.Entities.Clear();

    ddsDetailInfo.QueryName =
    "GetCustomEditableProjectDetails";

    ddsDetailInfo.QueryParameters.Clear();

    var p = new Parameter();

    p.ParameterName = "_projectseq";

    p.Value = (Guid)summaryinformation.ProjectSeq;

    ddsDetailInfo.QueryParameters.Add(p);

    var pp = new Parameter();pp.ParameterName = "_projectnumber";

    pp.Value = summaryinformation.ProjectNumber;

    ddsDetailInfo.QueryParameters.Add(pp);

    ddsDetailInfo.Load();

    Saturday, July 25, 2009 8:10 AM

All replies

  • Follow an example using Parameter and ControlParameter:

            <riaControls:DomainDataSource
                x:Name="dds"
                QueryName="GetEntityByCountryName"
                AutoLoad="True">
                <riaControls:DomainDataSource.DomainContext>               
                   <web:YourDomainContext />
                </riaControls:DomainDataSource.DomainContext>
                <riaControls:DomainDataSource.QueryParameters>

                    <riaData:Parameter ParameterName="country" Value="RU"/>

                    <riaData:ControlParameter
                        ParameterName="name"
                        ControlName="txtTextToLookup"
                        PropertyName="Text"
                        RefreshEventName="TextChanged" />
            </riaControls:DomainDataSource>
    .
    .

    The GetEntityByCountryName query method on the server side would have the follow signature:
      public IQueryable<Entity> GetEntityByCountryName(string country, string name)

     

    Thursday, July 23, 2009 11:22 PM
  • thanks... that's in a XAML, and how to in C# (programmatically)?

    Friday, July 24, 2009 3:01 AM
  • Essentially the same.

    this.dds.QueryParameters.Add(new Parameter { ParameterName = "country", Value = "RU" });

    Kyle

    Friday, July 24, 2009 11:12 AM
  • Thanks!

    спасибо!!! :)

    Friday, July 24, 2009 5:11 PM
  • here how it works in c#

     

    var context = ddsDetailInfo.DomainContext as WATGDomainContext;

    context.Entities.Clear();

    ddsDetailInfo.QueryName =
    "GetCustomEditableProjectDetails";

    ddsDetailInfo.QueryParameters.Clear();

    var p = new Parameter();

    p.ParameterName = "_projectseq";

    p.Value = (Guid)summaryinformation.ProjectSeq;

    ddsDetailInfo.QueryParameters.Add(p);

    var pp = new Parameter();pp.ParameterName = "_projectnumber";

    pp.Value = summaryinformation.ProjectNumber;

    ddsDetailInfo.QueryParameters.Add(pp);

    ddsDetailInfo.Load();

    Saturday, July 25, 2009 8:10 AM
  • Is it possible to use the selected item from a datagrid as the query parameter for another datasources filter in xaml, not in code behind?

    Monday, August 31, 2009 4:17 AM
  • Can you tell me how to implement a method by passing its string of name in a custom control? like the QueryName of DomainDataSource?

    Thank you in advance.

    Monday, October 19, 2009 5:30 AM
  • You need to setup the parameter on the server-side webservice before sending the parameter in from the client.

    Once the webservice is defined, the client will automatically adapt and ask you for the paramter.

    See here for detailed example:

    http://www.buzzbit.net/user/systemblogger

     

    Tuesday, April 10, 2012 10:34 PM