Ashu grover

Ashu grover

  • NA
  • 2
  • 481

Syntax problem in C#

Jun 1 2018 10:34 PM
var temp = ConfigurationManager.ConnectionStrings["connectionStr"].ConnectionString;
conn = new SqlConnection(temp);
conn.Open();
// Create the command
SqlCommand command = new SqlCommand("SELECT * FROM View_Patients", conn);
command.Connection = conn;
RecCount = Convert.ToInt32(command.ExecuteScalar());
 
last line giving the error "Input String was not in a correct format" 

Answers (2)