Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 4729

datetime

$
0
0

hi,

how to display only date format  in sql 2005

1	edward	2014-01-05 00:00:00.000	2014-01-11 00:00:00.000	Sun       	2014-01-05 00:00:00.000	Administrative Work	edison	9:30am	5:30pm	5	30	10	07:15:00	NULL	NULL	NULL	NULL	NULL

string str1 = "insert into EmpTimesheet(EmpName,StartDate,EndDate,day,date,Service,Venue,StartTime,EndTime,Breakfast," +"Lunch,Dinner,DailyTotal)values(@EmpName,@StartDate,@EndDate,@day,@date,@Service,@Venue,@StartTime,@EndTime,@Breakfast," +"@Lunch,@Dinner,@DailyTotal)"; // string str1 = "insert into EmpTimesheet(EmpName,StartDate,EndDate)values(@EmpName,@StartDate,@EndDate)"; SqlCommand cmdTime1 = new SqlCommand(str1, cn); cmdTime1.CommandType = CommandType.Text; cmdTime1.Parameters.AddWithValue("@EmpName", SqlDbType.VarChar); cmdTime1.Parameters["@EmpName"].Value = txt_EmpName.Text; cmdTime1.Parameters.AddWithValue("@StartDate", SqlDbType.Date); cmdTime1.Parameters["@StartDate"].Value = txt_StartDate.Text; cmdTime1.Parameters.AddWithValue("@EndDate", SqlDbType.Date); cmdTime1.Parameters["@EndDate"].Value = txt_EndDate.Text; cmdTime1.Parameters.AddWithValue("@day", SqlDbType.Char); cmdTime1.Parameters["@day"].Value = lnkBtnSun.Text;

.

...}





Viewing all articles
Browse latest Browse all 4729


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>