siddu1281's Profile User Rating: -----

Reputation: 0 Apprentice
Group:
New Members
Active Posts:
10 (0.01 per day)
Joined:
17-August 12
Profile Views:
217
Last Active:
User is offline Oct 03 2012 01:09 AM
Currently:
Offline

Previous Fields

Dream Kudos:
0
Icon   siddu1281 has not set their status

Posts I've Made

  1. In Topic: how to caluclate the days between the two selected dates

    Posted 7 Sep 2012

    actually i want to pass the date variable into that method how it can be done?
  2. In Topic: how to caluclate the days between the two selected dates

    Posted 7 Sep 2012

    Is it possible to pass 'NoOfDays' instead of '10' inthe string
  3. In Topic: how to caluclate the days between the two selected dates

    Posted 7 Sep 2012

    how to update a record or value in sqlserver 2005 using asp.net.
    my problem is if iam having a number 20 in my database, now iwant to subtract 5 and update that record into 15.

    my DATABASE Leaverecord
    Id-------LeaveRemaining
    1-------------20
    2-------------18
    3-------------18

    the code which i developed was not correct actually, so please help me in ExecuteUpdate() method. i want to know how to pass the value into that method

    public partial class Applying : System.Web.UI.Page
    
    {
        String connectionString = ConfigurationManager.ConnectionStrings["SQLDbconnection"].ToString();
        SqlConnection con;
    
        public Applying()
        {
            con = new SqlConnection(connectionString);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            tbStartdate_CalendarExtender.StartDate = DateTime.Today;
            tbEndDate_CalendarExtender.StartDate = DateTime.Today.AddDays(1);
        }
        public void btnOk_Click(object sender, EventArgs e)
        {
    DateTime StartDate1 = DateTime.ParseExact(tbStartdate.Text, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture);
    
    DateTime EndDate1 = DateTime.ParseExact(tbEnddate.Text, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture);
    
       int date = (EndDate1 - StartDate1).Days;
    
       [b]ExecuteUpdate(NoOfDays);[/b]             
    
        }
    } 
    
    [b]private void ExecuteUpdate() // help me in this code
        {
         con.Open();
         SqlCommand cmd1 = new SqlCommand();
         string sql_update="UPDATE LeaveRecord SET LeavesRemaining WHERE Id=' "+tbID.Text+" ' ";
         cmd1.CommandType = CommandType.Text;
         cmd1.ExecuteNonQuery();
         con.Close();
        }[/b]
    
  4. In Topic: how to caluclate the days between the two selected dates

    Posted 7 Sep 2012

    thank you CasiOo,

My Information

Member Title:
New D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:

Contact Information

E-mail:
Private

Friends

siddu1281 hasn't added any friends yet.

Comments

siddu1281 has no profile comments yet. Why not say hello?