示例#1
0
        public static void UpdateDatabase1FromJS()
        {
            Random           random = new Random();
            SQL_cs_connector cs_con = new SQL_cs_connector(SqlConProp.domain, SqlConProp.database1, SqlConProp.login, SqlConProp.pass);

            cs_con.UpdateTable("Table1", "name", random.Next(100));
            cs_con.Disconnect();
        }
示例#2
0
 private void button4_Click(object sender, EventArgs e)
 {
     if (cs_con != null)
     {
         cs_con.Disconnect();
         this.dataGridView1.DataSource = null;
         cs_con = null;
     }
 }
示例#3
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            SQL_cs_connector cs_con = new SQL_cs_connector(SqlConProp.domain, SqlConProp.database1, SqlConProp.login, SqlConProp.pass);

            this.GridView1.DataSource = cs_con.SelectTable("Table1");
            this.GridView1.DataBind();
            this.GridView1.Visible = true;
            cs_con.Disconnect();
        }
示例#4
0
        protected void Button12_Click(object sender, EventArgs e)
        {
            SQL_cs_connector cs_con = new SQL_cs_connector(SqlConProp.domain, SqlConProp.database1, SqlConProp.login, SqlConProp.pass);
            int nId = Int32.Parse(this.TextBox1.Text);

            this.GridView1.DataSource = cs_con.CallStoreProc("GetTableFromId", nId);
            this.GridView1.DataBind();
            this.GridView1.Visible = true;
            cs_con.Disconnect();
        }
示例#5
0
        protected void Button2_Click(object sender, EventArgs e)
        {
            Random           random = new Random();
            SQL_cs_connector cs_con = new SQL_cs_connector(SqlConProp.domain, SqlConProp.database1, SqlConProp.login, SqlConProp.pass);

            cs_con.UpdateTable("Table1", "name", random.Next(100));
            this.GridView1.DataSource = cs_con.SelectTable("Table1");
            this.GridView1.DataBind();
            this.GridView1.Visible = true;
            cs_con.Disconnect();
        }
示例#6
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (cs_con == null)
     {
         log.Info("Connecting to DB");
         //cs_con = new SQL_cs_connector("192.168.8.99", "TestDatabase1", "Administrator", "Pa$$word");
         cs_con = new SQL_cs_connector();
         cs_con.SetLogger(log);
         cs_con.Connect(ConfigurationManager.AppSettings["DBconnStr"]);
         this.dataGridView1.DataSource = cs_con.SelectTable("Table1");
     }
 }