2
Answers

Syntax problem in C#

Ashu grover

Ashu grover

6y
520
1
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)