Hi,
I am using autocomplete for a RADCombobox.
[OperationContract]
public RadComboBoxData wpfSelectProgrammeFromClientDB(RadComboBoxContext context)
{
}
In this service, I am using a SQL Query to fill a datatable.
strSQLQuery = "SELECT pk_ProgrammeID,Title FROM Programme WHERE Title LIKE @prefixText";
da = new SqlDataAdapter(strSQLQuery, ConfigurationManager.ConnectionStrings["DEMO"].ToString());
da.SelectCommand.Parameters.Add("@prefixText", SqlDbType.VarChar, 50).Value = "%" + context.Text + "%";
dt = new DataTable();
da.Fill(dt);
In my .aspx, I use
<telerik:RadComboBox ID="rcbClientProgrammeTitle" Runat="server" EmptyMessage="Select a Title" EnableLoadOnDemand="true"
ShowMoreResultsBox="true" EnableVirtualScrolling="true" Skin="Windows7"
AutoPostBack="True" >
<WebServiceSettings Method="SelectProgrammeFromClientDB" Path="LinkMedia.aspx.cs"/>
</telerik:RadComboBox>
I need to pass a second parameter to the SQL Query, like
strSQLQuery = "SELECT pk_ProgrammeID,Title FROM Programme WHERE Title LIKE @prefixText AND Client = @Client";
da = new SqlDataAdapter(strSQLQuery, ConfigurationManager.ConnectionStrings["DEMO"].ToString());
da.SelectCommand.Parameters.Add("@prefixText", SqlDbType.VarChar, 50).Value = "%" + context.Text + "%";
da.SelectCommand.Parameters.Add("@Client", SqlDbType.VarChar, 50).Value = " + WHAT DO I PASS HERE;
dt = new DataTable();
da.Fill(dt);
OR is there any other alternative to do this. The @Client comes from a Query String which I am not able to access in the WCF Service.
Can you please show me a demo of how to send multiple parameters to the Service or how to access the query string values from the page in the service.
Thanks
Prithvi
I am using autocomplete for a RADCombobox.
[OperationContract]
public RadComboBoxData wpfSelectProgrammeFromClientDB(RadComboBoxContext context)
{
}
In this service, I am using a SQL Query to fill a datatable.
strSQLQuery = "SELECT pk_ProgrammeID,Title FROM Programme WHERE Title LIKE @prefixText";
da = new SqlDataAdapter(strSQLQuery, ConfigurationManager.ConnectionStrings["DEMO"].ToString());
da.SelectCommand.Parameters.Add("@prefixText", SqlDbType.VarChar, 50).Value = "%" + context.Text + "%";
dt = new DataTable();
da.Fill(dt);
In my .aspx, I use
<telerik:RadComboBox ID="rcbClientProgrammeTitle" Runat="server" EmptyMessage="Select a Title" EnableLoadOnDemand="true"
ShowMoreResultsBox="true" EnableVirtualScrolling="true" Skin="Windows7"
AutoPostBack="True" >
<WebServiceSettings Method="SelectProgrammeFromClientDB" Path="LinkMedia.aspx.cs"/>
</telerik:RadComboBox>
I need to pass a second parameter to the SQL Query, like
strSQLQuery = "SELECT pk_ProgrammeID,Title FROM Programme WHERE Title LIKE @prefixText AND Client = @Client";
da = new SqlDataAdapter(strSQLQuery, ConfigurationManager.ConnectionStrings["DEMO"].ToString());
da.SelectCommand.Parameters.Add("@prefixText", SqlDbType.VarChar, 50).Value = "%" + context.Text + "%";
da.SelectCommand.Parameters.Add("@Client", SqlDbType.VarChar, 50).Value = " + WHAT DO I PASS HERE;
dt = new DataTable();
da.Fill(dt);
OR is there any other alternative to do this. The @Client comes from a Query String which I am not able to access in the WCF Service.
Can you please show me a demo of how to send multiple parameters to the Service or how to access the query string values from the page in the service.
Thanks
Prithvi