I'm quite new to C# so sorry if my coding a bit dodgy!
I keep getting 3 errors for my People application.
The errors are caused by trying to convert the int and bools into strings, I'm just not sure how I'm meant to change it, if you guys could give me a hand, that would be great thanks! Any tips will also be greatly appreciated!
The errors that keep reoccurring are:
Error 1: The best overloaded method match for 'Lab5b.Person.Person(string, int, string, string, bool, string)' has some invalid arguments
Error 2: Argument 2: cannot convert from 'string' to 'int'
Error 3: Argument 5: cannot convert from 'method group' to 'bool'
My Code:
public partial class _Default : Page
{
protected void Button1_Click(object sender, EventArgs e)
{
Response.Write("You have successfully added a Person!");
Person p = new Person(TextBox1.Text, TextBox2.ToString(), TextBox3.Text, TextBox4.Text, DropDownList1.ToString, TextBox5.Text);
}
}
and my Person class:
class Person
{
private string name;
private int age;
private string dob;
private string telNo;
private bool gender;
private string address;
public Person(string name, int age, string dob, string telNo, bool gender, string address)
{
Name = name;
Age = age;
DOB = dob;
TelNo = telNo;
Gender = gender;
Address = address;
}
public int Age { get; set; }
public string Name { get; set; }
public string DOB {get; set;}
public string TelNo {get; set;}
public bool Gender {get; set;}
public string Address {get; set;}
public string PresentPerson()
{
}
}