I created a public class and wrote a public constructor with parameters like:
public Patient(SqlDataReader reader, string p) {
if (p == "L") {
Name = reader[0].ToString();
}
else { }
}
then I used this constructor like
SqlDataReader reader = command.ExecuteReader();
while (reader.Read())
{
Patient myP(reader, "L");
}
Then during debug, I got the error: Error 49 Expected ; or = (cannot specify constructor arguments in declaration)
Where is the problem and how can I fix it?