开发者

Changing data type of data grid view column after setting data source

I am working in C#.NET. I have a datagridview and a data table has been set as its data source. Data table is the output of select query (sql) and there is a column named date whose data type is datetime. Now after setting data so开发者_如何学Gource I needed to change the data type of corresponding column of grid to string. Anyone know about it?


You can probably change the SQL statement so that it selects a calculated column where the value is a formatted string representation of the datetime instead of the actual "date" column itself. The SQL to do that would depend on which database product you are using.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜