c# 4.0 - C# - Data filter by datetimepicker -
I am a newbie to C # and I want to try it on.
Do I know how can I return event value by Dataatimpekar to the Database (MS Access 2007) filter?
For example:
I have DataGrid Video in a DetetPicker and Format 1. Can user show datagrid queue row by row to select date from dateetimeter and filtered data?
My main purpose would be to collect the date and return figures on that date.
Many thanks in advance! Gary Yee
Given that you have the date / date time of the access database, For example, in your SQL statement ValueChanged event's
DateTimePicker control
dateTime dt = datetimepicker.Value; // string string database strConn = @ "provider = Microsoft.Jet.OLEDB.4.0; data source = C: \ mydatabase.mdb;"; (Select Varici * YOURTABLE WHERE DateCol = '{0}' ", dt) using {string strSql = String.Format (Var Connection = New OleDbConnection (strConn)); (Using var adap = new OleDbDataAdapter (strSql, connection)) {DataTable table = new DataTable (); Adap.fill (table); GridView1.DataSource = Table; GridView1.DataBind (); }]
Comments
Post a Comment