public void InsertState(BALState obj) { query = "insert into State(statename) values ('" + obj.StateName + "')"; SqlCommand cmd = new SqlCommand(query, con); con.Open(); cmd.ExecuteNonQuery(); con.Close(); }
public void UpdateState(BALState obj) { query = "update State set statename='" + obj.StateName + "' where stateid=" + obj.StateId; SqlCommand cmd = new SqlCommand(query, con); con.Open(); cmd.ExecuteNonQuery(); con.Close(); }
public void DeleteState(BALState obj) { query = "delete from State where stateid=" + obj.StateId; SqlCommand cmd = new SqlCommand(query, con); con.Open(); cmd.ExecuteNonQuery(); con.Close(); }
public DataSet SelectStateByStateId(BALState obj) { query = "select * from State where stateid="+obj.StateId; DataSet ds = new DataSet(); SqlDataAdapter adp = new SqlDataAdapter(query, con); adp.Fill(ds); return ds; }
public void insertState(BALState obj) { SqlCommand cmd = new SqlCommand(); cmd.Connection = con; cmd.CommandText = "spInsertState"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@statename", obj.StateName); con.Open(); cmd.ExecuteNonQuery(); con.Close(); }