locked
how to store the count depends on the search RRS feed

  • Question

  • User-980271842 posted

    i am using radcombobox

    <telerik:RadAjaxPanel runat="server" ID="RadAjaxPanel1">
                                                <div>
                                                    <telerik:RadComboBox ID="RadComboBox1" runat="server" Width="200px" AllowCustomText="true"
                                                        Height="150px" EmptyMessage="Enter or Select a Destination" ShowMoreResultsBox="false">
                                                        <Items>
                                                            <telerik:RadComboBoxItem Text="Ayutthaya" />
                                                            <telerik:RadComboBoxItem Text="Bangkok" />
                                                            <telerik:RadComboBoxItem Text="Buriram" />
                                                            <telerik:RadComboBoxItem Text="Chiang Mai" />
                                                            <telerik:RadComboBoxItem Text="Chiang Rai" />
                                                            <telerik:RadComboBoxItem Text="Lampang" />
                                                            <telerik:RadComboBoxItem Text="Lopburi" />
                                                            <telerik:RadComboBoxItem Text="Nakhon Ratchasima" />
                                                            <telerik:RadComboBoxItem Text="Sukhothai" />
                                                            <telerik:RadComboBoxItem Text="Surin" />
                                                            <telerik:RadComboBoxItem Text="Ubon Ratchathai" />
                                                        </Items>
                                                    </telerik:RadComboBox>
                                                </div>
                                            </telerik:RadAjaxPanel>
    protected void Searchbutton_Click(object sender, ImageClickEventArgs e)
        {
            Session["Destination"] = RadComboBox1.Text;
            Response.Redirect("quicksearch.aspx");
        }
    
    
    when the user serch the value
    
    
    like  if user search bangkok it update vlue-1
    then again other user search bangkok it update value to 2
    and so on like that .
    Please tell me how to uspate these value in database.....
    
    
    i am using query like
                    string queryString = "SELECT Id , name , tourcode, description, images FROM TourHeader WHERE city like '%" + destin + "%'";
    
    Thursday, September 8, 2011 1:06 AM

Answers

  • User-980271842 posted

    i am done it by using this

    string querystring = "update tag set counter = counter + 1 WHERE city like '%" + destin + "%'";
                    SqlCommand cmd1 = new SqlCommand(querystring, sqlConnection);
                    sqlConnection.Open();
                    cmd1.ExecuteNonQuery();
                    sqlConnection.Close();
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, September 8, 2011 2:45 AM

All replies

  • User-980271842 posted

    plsease help me out....

    thanx in advance

    Thursday, September 8, 2011 1:06 AM
  • User-980271842 posted

    i am done it by using this

    string querystring = "update tag set counter = counter + 1 WHERE city like '%" + destin + "%'";
                    SqlCommand cmd1 = new SqlCommand(querystring, sqlConnection);
                    sqlConnection.Open();
                    cmd1.ExecuteNonQuery();
                    sqlConnection.Close();
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, September 8, 2011 2:45 AM