Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3851658
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T17:11:48+00:00 2026-05-19T17:11:48+00:00

My requirement is if the user click on update data with out changing any

  • 0

My requirement is if the user click on update data with out changing any field on the form i would like to show as No changes made and if any changes i would like to update the data

I have written a Routine for updating data as follows

CREATE DEFINER=`root`@`%` PROCEDURE `uspEmployeeFaxDetailsUpdate`(_EmpID int(11),
_FaxNumberTypeID varchar(45),
_FaxNumber decimal(10,0),
_EndDate datetime)

BEGIN

 declare p_ecount int;

  set p_ecount= (select count(1) from tblemployeefaxdetails  where
 FaxNumberTypeID=_FaxNumberTypeID and
 FaxNumber=_FaxNumber and
 EndDate='9999-12-31');

 if p_ecount=0 then

begin

 update tblemployeefaxdetails

  set

    EndDate=_EndDate WHERE EmpID=_EmpID and EndDate="9999-12-31";

    insert into tblemployeefaxdetails(EmpID,FaxNumberTypeID,FaxNumber,StartDate,EndDate) values
    (_EmpID,_FaxNumberTypeID,_FaxNumber,curdate(),'9999-12-31');

    end;
    end if;

END

I am getting some time my required message but some time it is showing the update message

This is my code on update

   oEmployeePersonalData.EmpID = EmpID;
        oEmployeePersonalData.FaxNumberTypeID = ddlFaxTypeID.SelectedItem.Text;
        oEmployeePersonalData.FaxNumber = Convert.ToInt64(txtFaxNumber.Text);
        oEmployeePersonalData.EndDate = DateTime.Today.AddDays(-1);
        if (oEmployeePersonalData.FaxDetailUpdate())
        {
            oMsg.Message = "Updated Sucessfully";
            Label m_locallblMessage;
            oMsg.AlertMessageBox(out m_locallblMessage);
            Page.Controls.Add(m_locallblMessage);
                       }
        else
        {
            oMsg.Message = "Not Sucessfully";
            Label m_locallblMessage;
            oMsg.AlertMessageBox(out m_locallblMessage);
            Page.Controls.Add(m_locallblMessage);
        }

Updated code

   public bool FaxDetailUpdate()
    {
        m_bFlag = false;
        try
        {

            m_oCmd = new MySqlCommand(StoredProcNames.tblEmployeeFaxdetails_uspEmployeeFaxdetailsUpdate, m_oConn);
            m_oCmd.CommandType = CommandType.StoredProcedure;
            m_oCmd.Parameters.AddWithValue("_EmpID", EmpID);
            m_oCmd.Parameters.AddWithValue("_FaxNumberTypeID", FaxNumberTypeID);
            m_oCmd.Parameters.AddWithValue("_FaxNumber", FaxNumber);
            m_oCmd.Parameters.AddWithValue("_EndDate", EndDate);
            if (m_oConn.State == ConnectionState.Closed)
            {
                m_oConn.Open();
            }
            if ((m_oCmd.ExecuteNonQuery()) > 0)
            {
                this.m_bFlag = true;
            }
        }
        catch (MySqlException oSqlEx)
        {
            m_sbErrMsg.Length = 0;
            m_sbErrMsg = Utilities.SqlErrorMessage(oSqlEx);
            //DB write the Error Log
            m_oErrlog.Add(m_sbErrMsg.ToString(), DateTime.Now);
        }
        catch (Exception oEx)
        {
            m_sbErrMsg = Utilities.ErrorMessage(oEx);
            //DB write the Error Log
            m_oErrlog.Add(m_sbErrMsg.ToString(), DateTime.Now);
        }
        finally
        {
            m_oConn.Close();
        }
        return this.m_bFlag;
    }

I am not getting any error but i would like to be done as per i said

Can any one tell what changes i have to made in this

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T17:11:48+00:00Added an answer on May 19, 2026 at 5:11 pm

    I do not really understand the routine, what the magic date 9999-12-31 represents, and why a new record is inserted every time, instead of updating the old one.

    What you can do, is have the routine return a indicator if the row was changed or not, returning the value of p_ecount through a OUT parameter.

    For more information on how to use OUT parameters using the .net MySql client see http://dev.mysql.com/doc/refman/5.0/en/connector-net-programming-stored.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

It seems like a standard requirement: next time the user launches the application, open
I have a requirement where the user wants to be able to click a
I currently have a requirement to notify my application user if any fields have
In my ASP.Net application I have a requirement that when a user clicks on
I want to model messages between users, here is the requirement: User has received
I have a requirement for an admin user to set up an export directory
A requirement for an ASP.Net 2.0 project I'm working on limits a certain field
So I have an input form that I want to use to update a
I've a requirement where user are going to fill lots of fields ( text
EDIT It appears the user has to enter some data for his profile, otherwise

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.