Function sms_rpt.IDENT_CURRENT does not exit.

Posted on 2012-09-21
Last Modified: 2012-09-24
Hi i do encounter is error "Function sms_rpt.IDENT_CURRENT does not exit."

private void LastRowNo()
            InitialRecord = LastRecord;

            string cmd = "Select IDENT_CURRENT('mastersmsdb')";
            MySqlCommand checkcmd = new MySqlCommand(cmd, myconint);
            LastRecord = Convert.ToInt32(checkcmd.ExecuteScalar());                    // <--- error point over here.

            if (myconint.State == ConnectionState.Open)

            lblSSNewRecord.Text = "New Incoming Record :" + Convert.ToString(LastRecord - InitialRecord );
            lblSSExistingRecord.Text = "Existing Record : " + Convert.ToString(InitialRecord );
Question by:TITO2009
    1 Comment
    LVL 24

    Accepted Solution

    MySQL does not have an ident_current function.  If you are trying to get the auto-generated integer primary key of a just inserted row, see

    However, it seems you just seem to want to get the last generated number for a table.  For this you just do a "select max(primary key column) from table".

    Of course, this assumes you used the auto_increment feature (see

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    I have been using r1soft Continuous Data Protection ( for many years now with the mySQL Addon and wanted to share a trick I have used several times. For those of us that don't have the luxury of using all transact…
    Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL ( several years ago, it seemed like now was a good time to updat…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now