TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
ashish dixit
NA
27
9k
i want to move or delete the data when system date = last da
Apr 8 2013 4:15 AM
i want to move or delete the data when system date = last date
code part-
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btncreat_Click(object sender, EventArgs e)
{
int Totaldays = duration(txtstart.Text, txtEnd.Text);
diffrence.Text = Convert.ToString(Totaldays);
}
public int duration(string startdate, string enddate)
{
DateTime dt1 = DateTime.Parse(Convert.ToDateTime(txtstart.Text).ToString("MM/dd/yyyy"));
DateTime dt2 = DateTime.Parse(Convert.ToDateTime(txtEnd.Text).ToString("MM/dd/yyyy"));
TimeSpan ts = dt2.Subtract(dt1);
int days = ts.Days;
return days;
if (txtEnd.Text == System.DateTime)
{
}
}
}
design part
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<cc1:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</cc1:ToolkitScriptManager>
<table width="50%" align="center" >
<tr>
<td align="right" >
</td>
<td >
</td>
<td >
</td>
<td >
</td>
</tr>
<tr>
<td align="right" >
<asp:Label ID="lblstart" runat="server" Font-Bold="True" Text="StartDate:"></asp:Label>
</td>
<td >
</td>
<td >
<asp:TextBox ID="txtstart" runat="server"></asp:TextBox>
<cc1:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtstart">
</cc1:CalendarExtender>
</td>
<td >
</td>
</tr>
<%--<tr>
<td align="right" >
Upload Image:</td>
<td >
</td>
<td >
<asp:FileUpload ID="fileuploadimages" runat="server" />
</td>
<td >
</td>
</tr>
<tr>
<td align="right" >
Enter Image Desc</td>
<td >
</td>
<td >
<asp:TextBox ID="txtDesc" runat="server"></asp:TextBox>
</td>
<td >
</td>
</tr>--%>
<tr>
<td align="right">
<asp:Label ID="lblEnd" runat="server" Font-Bold="True" Text="EndDate:"></asp:Label>
</td>
<td>
</td>
<td>
<asp:TextBox ID="txtEnd" runat="server"></asp:TextBox>
<cc1:CalendarExtender ID="CalendarExtender2" runat="server" TargetControlID="txtEnd" >
</cc1:CalendarExtender>
</td>
<td>
</td>
</tr>
<tr>
<td align="right" >
</td>
<td>
</td>
<td>
<asp:Label ID="diffrence" runat="server"></asp:Label>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
<td>
<asp:Button ID="btncreat" runat="server" onclick="btncreat_Click"
Text="Submit" />
</td>
<td>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
Reply
Answers (
1
)
.Net Books for C#, ASP.NET
I can't get into my settings