इसके बजाय command.ExecuteNonQuery(); आपको कॉल करना चाहिए Object res = command.ExecuteScalar(); Console.WriteLine(res);