示例#1
0
 private void button4_Click(object sender, EventArgs e)
 {
     if (SqliHelper.DeleteData("表2", "用户名 Like '阿男达'", "密码 like '8888'") == true)
     {
         SqliHelper.CheckImporlistview(this.listView1, "表2", "");
     }
 }
示例#2
0
        private void button3_Click(object sender, EventArgs e)
        {
            SqliHelper.UpdateData("table1", new string[] { "Name = 'aaa'" }, "EMAIL='修改@.com'", "CODE='修改'");
            List <List <string> > List = SqliHelper.ReadData("table1", new string[] { "Name", "CODE" }, " ORDER BY ASC LIMIT 1 OFFSET 0", "Name like 'aaa'");

            if (List.Count > 0)
            {
                textBox1.Text = List[0][0]; textBox2.Text = List[0][1];
            }
        }
示例#3
0
        private void button1_Click(object sender, EventArgs e)
        {
            var tablevalue = new List <string[]>()
            {
                new string[] { "`Name` TEXT", "`EMAIL` TEXT", "`CODE` TEXT" },
                new string[] { "`用户ID` TEXT", "`用户名` TEXT", "`密码` TEXT", "`时间` TEXT" }
            };

            SqliHelper.CreateTable(new string[] { "table1", "表2" }, tablevalue);
        }
示例#4
0
        private void button3_Click(object sender, EventArgs e)
        {
            SqliHelper.UpdateData("table1", "Name", "aaa", "EMAIL='修改@.com'", "CODE='修改'");
            List <string> List = SqliHelper.ReadMultiData("table1", new string[] { "Name", "CODE" }, "Name like 'aaa'");

            if (List.Count > 0)
            {
                textBox1.Text = List[0]; textBox2.Text = List[1]; textBox3.Text = List[2];
            }
        }
示例#5
0
 private void button2_Click(object sender, EventArgs e)
 {
     try
     {
         List <List <string> > List = SqliHelper.ReadData("table1", new string[] { "Name", "EMAIL", "CODE" }, " ORDER BY RANDOM() LIMIT 1 OFFSET 0", "Name like 'aaa'", "CODE like '1234'");
         if (List.Count > 0)
         {
             textBox1.Text = List[0][0]; textBox2.Text = List[0][1]; textBox3.Text = List[0][2];
         }
         SqliHelper.CheckImporlistview(this.listView1, "表2", "");
     }
     catch
     {
     }
 }
示例#6
0
 private void button5_Click(object sender, EventArgs e)
 {
     if (SqliHelper.CheckDataExsit("table1", "Name", "aaa") == false)
     {
         SqliHelper.InsertData("table1", new string[] { "Name", "EMAIL", "CODE" }, new string[] { "aaa", "[email protected]", "1234" });
         SqliHelper.InsertData("table1", new string[] { "Name", "EMAIL", "CODE" }, new string[] { "bbb", "[email protected]", "5678" });
         SqliHelper.InsertData("table1", new string[] { "Name", "EMAIL", "CODE" }, new string[] { "ccc", "[email protected]", "6666" });
     }
     if (SqliHelper.CheckDataExsit("表2", "用户ID", "用户1") == false)
     {
         SqliHelper.InsertData("表2", new string[] { "用户ID", "用户名", "密码", "时间" }, new string[] { "用户1", "网中行", "1234", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss tt", CultureInfo.InvariantCulture) });
     }
     if (SqliHelper.CheckDataExsit("表2", "用户ID", "用户2") == false)
     {
         SqliHelper.InsertData("表2", new string[] { "用户ID", "用户名", "密码", "时间" }, new string[] { "用户2", "小水", "8888", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss tt", CultureInfo.InvariantCulture) });
         SqliHelper.InsertData("表2", new string[] { "用户ID", "用户名", "密码", "时间" }, new string[] { "用户3", "阿男达", "8888", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss tt", CultureInfo.InvariantCulture) });
     }
 }