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.....
|
| Author: vipul 08 Sep 2008 | Member Level: Diamond | Rating: 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 )
|