// class COMPCLS public DataTable MaxNEW() { var DAL = new SQlcls.DataAccessLayer(); var DT = new DataTable(); DT = DAL.SelectData_txt("SELECT ISNULL(MAX (ID)+1,1) FROM [dbo].[company]", default); return DT; }
//FRM_COMPANY public void MAX_NEW() { COMPCLS cmp = new COMPCLS(); var DT = new DataTable(); DT = cmp.MaxNEW(); if (DT.Rows.Count > 0) { TXT_ID.Text = DT.Rows(0)(0).ToString(); } }
Non-invocable member 'Data.Table.Rows cannot be used like a method.
TXT_ID.Text = DT.Rows(0)(0).ToString(); // should be TXT_ID.Text = DT.Rows[0][0].ToString();
Quote:TXT_ID.Text = DT.Rows(0)(0).ToString();
TXT_ID.Text = DT.Rows[0][0].ToString();
TXT_ID.Text = DT.Rows(0)(0).ToString();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)