This is my Class. no error

This is my first windows Form. No error
C#
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 SinghRank #66 · 26.2K reputationPosted Nov 3, 2021, 2:46 AM EDT
Sachin SinghRank #66 · 26.2K reputationPosted Nov 3, 2021, 3:37 AM EDT
hustino siat90 reputationPosted Nov 3, 2021, 3:31 AM EDT
hustino siat90 reputationPosted Nov 3, 2021, 3:56 AM EDT
Sachin SinghRank #66 · 26.2K reputationPosted Nov 3, 2021, 4:46 AM EDT
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 siat90 reputationPosted Nov 3, 2021, 5:00 AM EDT