C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




Datagridview display only time ??????


Posted Date: 07 Sep 2008      Total Responses: 1

Posted By: Rajarajan       Member Level: Silver     Points: 1



Hi friends,

C#.net Windows Application

I m using this code :

DataSet ds;
string str = "select SlNo,ScheduleID,StartTime,EndTime from table1";
ds = SqlHelper.ExecuteDataset(objconnect, CommandType.Text, str);
dataGridview1.DataSource = ds.Tables[0].DefaultView;

the result Display like this

SlNo ScheduleID StartTime EndTime

1 SID01 9/8/2008 5:00 PM 9/8/2008 6:00 PM


but i need datagridview display like this

SlNo ScheduleID StartTime EndTime
1 SID01 5:00 PM 6:00 PM


how to do this.....






Responses

Author: vipul    08 Sep 2008Member Level: DiamondRating:     Points: 3

Hi,
For that you used this way
select convert(varchar,getdate(),108)
DataSet ds;
string str = "select SlNo,ScheduleID,convert(varchar,StartTime,108) as Start,convert(varchar,EndTime,108) as End from table1";
ds = SqlHelper.ExecuteDataset(objconnect, CommandType.Text, str);
dataGridview1.DataSource = ds.Tables[0].DefaultView;


vipul,
http://dongavipul.blogspot.com

Patel Vipul
Web Developer
Ahmedabad ( Gujarat )



Post Reply
You must Sign In to post a response.
Next : adding a windows service in a windows application
Previous : insert row number for datagrid in windows using C#
Return to Discussion Forum
Post New Message
Category: Windows

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design


Contact Us    Privacy Policy    Terms Of Use