Function sms_rpt.IDENT_CURRENT does not exit.

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 );
Rama TitoProgrammerAsked:
Who is Participating?
johanntagleConnect With a Mentor Commented:
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
All Courses

From novice to tech pro — start learning today.