コード例 #1
0
ファイル: TestAccessDb.aspx.cs プロジェクト: nkaluva/helper
        protected void Page_Load(object sender, EventArgs e)
        {
            //DbMapAccess adb = new DbMapAccess("c:\\_DtCms.mdb");

            //Article art = adb.Get<Article>("select top 1 * from article ");


            //art = new Article()
            //{
            //    AddTime = DateTime.Now,
            //    Author = "niejunhuahdasd",
            //    ClassId = 1526695269,
            //    Content = "asdasd"
            //};
            //adb.Insert<Article>(art);


            // Response.Write(art.Title);

            //AccessCore ac = new AccessCore("c:\\_DtCms.mdb");
            //ac.CreateAll("aaaa","");

            DbMap map = new DbMapAccess(@"E:\快盘\project\CaiDown\CaiDown\down.mdb");
            Console.WriteLine(map.DbContext.ConnStr + "#" + map.DbContext.ToString());

            njh.list list = new njh.list()
            {
                classname = "classname2",
                href = Guid.NewGuid().ToString(),
                idx = 1,
                title = "Title" + DateTime.Now.Ticks

            };

            int i = map.Insert<njh.list>(list);

        }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //DbMapAccess adb = new DbMapAccess("c:\\_DtCms.mdb");

            //Article art = adb.Get<Article>("select top 1 * from article ");


            //art = new Article()
            //{
            //    AddTime = DateTime.Now,
            //    Author = "niejunhuahdasd",
            //    ClassId = 1526695269,
            //    Content = "asdasd"
            //};
            //adb.Insert<Article>(art);


            // Response.Write(art.Title);

            //AccessCore ac = new AccessCore("c:\\_DtCms.mdb");
            //ac.CreateAll("aaaa","");

            DbMap map = new DbMapAccess(@"E:\快盘\project\CaiDown\CaiDown\down.mdb");

            Console.WriteLine(map.db.ConnStr + "#" + map.db.ToString());

            njh.list list = new njh.list()
            {
                classname = "classname2",
                href      = Guid.NewGuid().ToString(),
                idx       = 1,
                title     = "Title" + DateTime.Now.Ticks
            };

            int i = map.Insert <njh.list>(list);
        }