Something like this perhaps?
int choice;
if(int.TryParse(Console.ReadLine, out choice)){
switch (choice)
{
case 1:
Console.WriteLine("\n");
conn.InsertData();
Console.WriteLine("\n");
conn.GetData();
break;
}
else{
Console.WriteLine("PLease enter an integer value!");
}
Int.TryParse[
^]