tanmoy Level: Whizz Kid
 Registered: 17-03-2006 Posts: 18
|
see data in datagrid as per date and data will be sorted in ascending order
hello sir.i want to see some data from database in a datagrid as per date sequencially.the data is coming in datagrid as per date but data is not sequncially desangied.actualy in my table there was a field.name"trID".and this field the data is in 1,2,3,4,5,6,7 in this format.now i want to see some data in datagrid as per date.i use this coding.
Dim seldat As New OleDb.OleDbDataAdapter()
pm.TextBox2.Text = pm.DateTimePicker1.Value
Dim inv As String
inv = "select * from payment where Dat=# " & pm.TextBox2.Text & " # "
seldat.SelectCommand = New OleDb.OleDbCommand(inv, con)
ds.Tables("payment").Clear()
seldat.Fill(ds, "payment")
pm.DataGrid1.DataSource = ds.Tables("payment")
but with this coding the data is sort as per date so the data is not showing sequencialy.i mean after the data short as per date i want to do a another sort of this data as per "trID" in ascending order.i mean i want to show data as per date. and the date will be given by user.and the data will be sorted by field name"trID" in ascending order.please help me.thank you.
____________________________
ambarish sadhu
|