using System; using System.Collections.Generic; using System.Data; using System.Data.SqlClient; using System.Linq; using System.Web; namespace HeenaTravel.Models { public class ConnectionManager { SqlConnection con=null; public string Command { get; set; } public ConnectionManager() { con=new SqlConnection(@"Data Source=(localdb)\Projects;Initial Catalog=HeenaTravel;Integrated Security=True"); } public bool ExecuteInsertUpdateAndDelete() { SqlCommand cmd = new SqlCommand(Command,con); if(ConnectionState.Closed==con.State) { con.Open(); } int x = cmd.ExecuteNonQuery(); if (x > 0) return true; else return false; } } }