如何根据gridview中的日期进行排序? [英] how to do sorting based on date in gridview ?

查看:115
本文介绍了如何根据gridview中的日期进行排序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一栏在数据库中有一些数据如

TBSPL / C / Mar12 / 634



KBSPL / C / jan14 / 735



TBDPL / C / aug13 / 834



SBSPL / C / july12 / 034

int我需要根据gridview中的年份对数据进行排序。但我得到的问题是,我在jan14(KBSPL / C / jan14 / 735)排在中间的那一年,我无法排序,请帮助我。 ..

i have a one column in that having some data in database like
TBSPL/C/Mar12/634

KBSPL/C/jan14/735

TBDPL/C/aug13/834

SBSPL/C/july12/034
int that i need to sort the data based on year in gridview . but i am getting the problem that ,the year i presented in the middle of the row like jan14 (KBSPL/C/jan14/735) i am not able to sort guys please help me . ..

推荐答案

无论如何都无法通过这种方式执行排序......

当你在DB中插入这些数据时添加一个名为SortDateMonth的新列,并相应地插入与您的数据相关的月份和年份,然后在SortDateMonth列上应用排序。
You will not able to perform sorting anyhow by this way...
When u insert this data in DB add a new column named 'SortDateMonth' and insert a Month and Year related to your data accordingly in that and then apply sorting on SortDateMonth column.


这篇关于如何根据gridview中的日期进行排序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆