public bool InsertCacheDataPackets(IList <byte[]> cacheDataPackets) { using (DbConnection conn = new DbConnection()) { using (DbTransaction tran = DbTransaction.Open()) { try { foreach (byte[] bytes in cacheDataPackets) { string str = ValueHelper.Byte2HexStr(bytes, 0, bytes.Length); PacketsToSend packet = new PacketsToSend { DataPacket = str.Trim() }; packet.Save(); } return(true); } catch { return(false); } } } }