date validations

Posted by: RegexLib.com - Recent Patterns, on 01 Oct 2008 | View original | Bookmarked: 0 time(s)

if (RadDatePicker1.SelectedDate == System.DateTime.Now.Date) { string strconnection; strconnection = ConfigurationSettings.AppSettings["ConnectionString"].ToString(); SqlConnection cn = new SqlConnection(strconnection); SqlCommand cmd = new SqlCommand("empattendancedetails", cn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@empid", SqlDbType.Int).Direction = ParameterDirection.Input; cmd.Parameters.Add("@date", SqlDbType.DateTime).Direction = ParameterDirection.Input; cmd.Parameters.Add("@intime", SqlDbType.DateTime).Direction = ParameterDirection.Input; cmd.Parameters.Add("@outtime", SqlDbType.DateTime).Direction = ParameterDirection.Input; cmd.Parameters["@empid"].Value = Session["loginid"]; cmd.Parameters["@date"].Value = RadDatePicker1.SelectedDate.ToString(); cmd.Parameters["@intime"].Value = RadTimePicker1.SelectedDate.ToString(); cmd.Parameters["@outtime"].Value = RadTimePicker2.SelectedDate.ToString(); cn.Open(); cmd.ExecuteNonQuery(); cn.Close(); Response.Write("Record Added."); } else Response.Write("enter todays date"); }

Advertisement
Free Agile Project Management Tool from Telerik
TeamPulse Community Edition helps your team effectively capture requirements, manage project plans, assign and track work, and most importantly, be continually connected with each other.
Category: SQL | Other Posts: View all posts by this blogger | Report as irrelevant | View bloggers stats | Views: 1228 | Hits: 23

Similar Posts

  • SQL SERVER DATEDIFF Accuracy of Various Dateparts more
  • Converting a .NET DateTime object to a JavaScript Date object more
  • SQL SERVER Denali Date and Time Functions DATEFROMPARTS() DATETIMEFROMPARTS() DATETIME2FROMPARTS() TIMEFROMPARTS() SMALLDATETIMEFROMPARTS() DATETIMEOFFSETFROMPARTS() A Quick Introduction more
  • Extracting the Date from a DateTime in Entity Framework 4 and LINQ more
  • SQL SERVER Information Related to DATETIME and DATETIME2 more
  • Updating Dates with WPF DatePicker more
  • SQL SERVER Difference Between DATETIME and DATETIME2 WITH GETDATE more
  • SQL SERVER Difference Between DATETIME and DATETIME2 more
  • SOLVED: Error 1 Ticks must be between DateTime.MinValue.Ticks and DateTime.MaxValue.Ticks more
  • Eschewing Date Types in our Database more

News Categories

.NET | Agile | Ajax | Architecture | ASP.NET | BizTalk | C# | Certification | Data | DataGrid | DataSet | Debugger | DotNetNuke | Events | GridView | IIS | Indigo | JavaScript | Mobile | Mono | Patterns and Practices | Performance | Podcast | Refactor | Regex | Security | Sharepoint | Silverlight | Smart Client Applications | Software | SQL | VB.NET | Visual Studio | W3 | WCF | WinFx | WPF | WSE | XAML | XLinq | XML | XSD