private CivInfoBO ReadRecord(SqlCeDataReader reader) { CivInfoBO result = new CivInfoBO(); result.Name = reader.GetString(0); result.Value = reader.GetString(1); return(result); }
private void CreateCIVInfoTable() { if (IsAvailable) { CivInfoDAO.Instance.CreateTable(); CivInfoBO info = new CivInfoBO(); info.Name = "Version"; info.Value = XmlFactory.SaveToString(_version, typeof(CIVVersion), new XmlFactorySettings()); CivInfoDAO.Instance.Insert(info); } }
public void Insert(CivInfoBO civInfoBO) { using (SqlCeCommand cmd = new SqlCeCommand("INSERT INTO CivInfo (name, value) VALUES (@name, @value)", DataBaseFactory.Instance.GetConnection())) { cmd.Parameters.Add(new SqlCeParameter("@name", SqlDbType.NVarChar) { Value = civInfoBO.Name }); cmd.Parameters.Add(new SqlCeParameter("@value", SqlDbType.NText) { Value = civInfoBO.Value }); cmd.ExecuteNonQuery(); } }