예제 #1
0
        public bool InsertOneItem(ValueType item)
        {
            Connectors             info     = (Connectors)item;
            string                 strSql   = "insert into connectors (name,length,desc,needShow) values (@name,@length,@desc,@needShow)";
            List <SQLiteParameter> paraList = new List <SQLiteParameter>();

            paraList.Add(SQLiteHelper.CreateParameter("@name", DbType.String, info.Name));
            paraList.Add(SQLiteHelper.CreateParameter("@length", DbType.Single, info.Length));
            paraList.Add(SQLiteHelper.CreateParameter("@desc", DbType.String, info.Description));
            paraList.Add(SQLiteHelper.CreateParameter("@needShow", DbType.Boolean, info.IsShowInList));

            SQLiteCommand command = SQLiteHelper.CreateCommand(this.STR_CONNECTION, strSql, paraList.ToArray());

            return(SQLiteHelper.ExecuteNonQuery(command) > 0);
        }