为什么Mysql日期列不出现在GridView中 [英] Why Mysql Date Column Not Coming to GridView

查看:93
本文介绍了为什么Mysql日期列不出现在GridView中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好.....
我正在使用一个mysql查询,该查询获取Date列以外的所有列.有什么需要的程序吗? (以获取日期列)

Hi all.....
I am using a mysql query which fetches all columns except Date column. is there any process needed? (in order to get Date Column)
thanks in advance.

推荐答案

如果有人有任何想法,请在此处发布:
If anyone does have an idea, please post it here: MysqlDateAdapter not fetching `Date` from mysql[^] as I am running out of ideas!


MySqlCommand command = GetDatabaseConnection().CreateCommand();
MySqlDataAdapter mda = new MySqlDataAdapter();
DataTable dt = new DataTable();

command.CommandType = CommandType.Text;
string sqlStatement = "select * from table";
command.CommandText = sqlStatement;

mda.SelectCommand = command;
mda.SelectCommand.Connection = GetDatabaseConnection();
mda.Fill(dt);
//Dispose the command object
command.Dispose();

return dt;



这将适用于所有类型的列
你有这样尝试过吗?

希望这会有所帮助.



This will work for all the types of column
Have you tried like this??

Hope this will help.


伙计们...
我终于找到了解决我问题的方法
解决方案是尝试使用绑定字段获取日期列,谢谢谁回答了我的问题OriginalGriff
还有Saranya1388.
guys ...
i found solution for my question at last
solution is try using Bound Field it fetchs Date Column thanks who answred my question OriginalGriff
And Saranya1388.


这篇关于为什么Mysql日期列不出现在GridView中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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