int id; id = Convert.ToInt32(txtRollNumber.Text); SqlConnection Con = new SqlConnection(@"Data Source=HORTON-2A5CB16E\SQLEXPRESS;Initial Catalog=Temp;Integrated Security=SSPI;Max Pool Size=100;Connect Timeout=1000"); Con.Open();
id = Convert.ToInt32(txtRollNumber.Text); input string is not in correct format
txtRollNumber
Convert
int.TryParse(txtRollNumber.Text, out id)
id
txtRollNumber.Text
int id = 0; Int32.TryParse(txtRollNumber.Text, out id);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)