This is my Class. no error

This is my first windows Form. No error
namespace LabEx
{
public partial class frmRegistration : Form
{
private string _FullName;
private int _Age;
private long _ContactNo;
private long _StudentNo;
public long StudentNumber(string studNum)
{
_StudentNo = long.Parse(studNum);
return _StudentNo;
}
public long ContactNo(string Contact)
{
if (Regex.IsMatch(Contact, @"^[0-9]{10,11}$"))
{
_ContactNo = long.Parse(Contact);
}
return _ContactNo;
}
public string FullName(string LastName, string FirstName, string MiddleInitial)
{
if (Regex.IsMatch(LastName, @"^[a-zA-Z]+$") || Regex.IsMatch(FirstName, @"^[a-zA-Z]+$") || Regex.IsMatch(MiddleInitial, @"^[a-zA-Z]+$"))
{
_FullName = LastName + ", " + FirstName + ", " + MiddleInitial;
}
return _FullName;
}
public int Age(string age)
{
if (Regex.IsMatch(age, @"^[0-9]{1,3}$"))
{
_Age = Int32.Parse(age);
}
return _Age;
}
public frmRegistration()
{
InitializeComponent();
}
private void frmRegistration_Load(object sender, EventArgs e)
{
string[] ListOfProgram = new string[]
{
"BS Information Technology",
"BS Computer Science",
"BS Information Systems",
"BS in Accountanct",
"BS in Hospitality Management",
"BS in Tourism Management"
};
for(int i= 0; i < 6; i++)
{
cbPrograms.Items.Add(ListOfProgram[i].ToString());
}
}
private void btnRegister_Click(object sender, EventArgs e)
{
}
}
}
My third Windows form.. have error

Sachin SinghPosted Nov 3, 2021, 6:46 AM
hustino siatPosted Nov 3, 2021, 9:00 AM
Sachin SinghPosted Nov 3, 2021, 8:46 AM
it means your textboxes are not present in frmConfirmation form. You can't access values from form1 in form2 directly.
On Registration form on register click, before saving data to database show the user a dialog stating "are you sure" you want to continue and display a summary the same you are creating in Confirmation frm and if the user agrees then save the data to database.
hustino siatPosted Nov 3, 2021, 7:56 AM
Sachin SinghPosted Nov 3, 2021, 7:37 AM
hustino siatPosted Nov 3, 2021, 7:31 AM