Filter data from dropdown list ,Asp.net ,C#

Posted by Raja_89 under C# on 3/15/2013 | Points: 10 | Views : 2781 | Status : [Member] | Replies : 3
Hai Techie

When i selects the date from dropdown list it will display in two text boxes.Based on two textboxes values grid view should display the filtered data .But the gridview does not visible

Here is the code

SqlConnection objcon = new SqlConnection("Data Source=.;Initial Catalog=Iwens_Database;User ID=sa;Password=123;Integrated Security=SSPI;");
objcon.Open();
try
{


selectionquery = "SELECT E_id, E_Name, E_Address, E_Contact_No, E_Email, DOEn, E_noi, E_coursename, E_year, E_companyname, E_others, E_design, E_Selected, E_Followup FROM dbo.Enquiry_table where DOEn between'" + FromTextBx.Text + "' AND '" +ToTextBx.Text + "'";


SqlDataAdapter objsda = new SqlDataAdapter(selectionquery,objcon );
DataSet objds = new DataSet();
objsda.Fill(objds, "Enquiry_table");

BetweenGridView.DataBind();
objcon.Close();
}
catch (Exception ex)
{
Response.Write(ex.Message);

}




Responses

Posted by: Santhi on: 3/15/2013 [Member] Starter | Points: 25

Up
0
Down
Hi

Whether your select query returns value.
what is the data tye of the text boxes.
If it is date you need to convert the text box values in to date time.

Thanks & Regards,
Santhi .V

Raja_89, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Raja_89 on: 3/15/2013 [Member] Starter | Points: 25

Up
0
Down
Hai
I convert into value of textbox to datetime but there is no change
How can i store a date and time in the form dd/mm/yyyy min:sec:ms in server explorer in visual studio

Is it possible to write the code

Thanks

Raja_89, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Raja_89 on: 3/15/2013 [Member] Starter | Points: 25

Up
0
Down
Hai
The field data is in the form of 2013-03-15 10:30:31.960
but i convert into 15-03-2013 to text by text manipulations [remove function]




Raja_89, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response