コード例 #1
0
        public void Text_StringLength_1()
        {
            var str1 = string.Join(",", Enumerable.Range(0, 10000).Select(a => "我是中国人"));

            var item1 = new TS_TEXT02 {
                Data = str1
            };

            Assert.Equal(1, g.firebird.Insert(item1).ExecuteAffrows());

            var item2 = g.firebird.Select <TS_TEXT02>().Where(a => a.Id == item1.Id).First();

            Assert.Equal(str1, item2.Data);

            //NoneParameter
            item1 = new TS_TEXT02 {
                Data = str1
            };
            Assert.Equal(1, g.firebird.Insert(item1).NoneParameter().ExecuteAffrows());
            item2 = g.firebird.Select <TS_TEXT02>().Where(a => a.Id == item1.Id).First();
            Assert.Equal(str1, item2.Data);
            //Assert.Throws<Exception>(() => g.firebird.Insert(item1).NoneParameter().ExecuteAffrows());
            //Dynamic SQL Error
            //SQL error code = -104
            //String literal with 159999 bytes exceeds the maximum length of 65535 bytes
        }
コード例 #2
0
        public void Text_StringLength_1()
        {
            var str1 = string.Join(",", Enumerable.Range(0, 1000).Select(a => "我是中国人"));

            var item1 = new TS_TEXT02 {
                Data = str1
            };

            Assert.Equal(1, g.mysql.Insert(item1).ExecuteAffrows());

            var item2 = g.mysql.Select <TS_TEXT02>().Where(a => a.Id == item1.Id).First();

            Assert.Equal(str1, item2.Data);

            //NoneParameter
            item1 = new TS_TEXT02 {
                Data = str1
            };
            Assert.Equal(1, g.mysql.Insert(item1).NoneParameter().ExecuteAffrows());
        }