当前位置: 首页>>代码示例>>C#>>正文


C# Database.SelectDataFromDatabase方法代码示例

本文整理汇总了C#中Database.SelectDataFromDatabase方法的典型用法代码示例。如果您正苦于以下问题:C# Database.SelectDataFromDatabase方法的具体用法?C# Database.SelectDataFromDatabase怎么用?C# Database.SelectDataFromDatabase使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Database的用法示例。


在下文中一共展示了Database.SelectDataFromDatabase方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Button1_Click

        protected void Button1_Click(object sender, EventArgs e)
        {
            //Label1.Text = textarea1.InnerText +syntax_selection.SelectedIndex.ToString() +syntax_selection.Value.ToString();
            Label1.Text = textarea1.InnerText + syntax_selection.SelectedIndex.ToString() + syntax_selection.SelectedValue.ToString();
            Database db = new Database();
            MySqlDataReader rdr = null;
            rdr = db.SelectDataFromDatabase("select ipaddress from compilertype where name='" + syntax_selection.SelectedValue.ToString() + "'");
            if (rdr.HasRows)
            {

                if (rdr.Read())
                {

                    type1ip = rdr.GetString(0);
                }

            }

            //Label4.Text = "Your chose:" + DropDownList1.SelectedItem.Text + DropDownList1.SelectedIndex.ToString();
            int i = 0;

            i = db.InsertIntoDatabase("insert into crawler(prog,result,operation) values('" + textarea1.InnerText + "','0'," + (syntax_selection.SelectedIndex + 1).ToString() + ")");

            DataSend ds = new DataSend(type1ip, "5212");
            ds.sendData("  " + i.ToString());
            id = i;
            Button2.Visible = true;
        }
开发者ID:suman1234567890,项目名称:CloudStructureSetup,代码行数:28,代码来源:compiler.aspx.cs

示例2: Button2_Click

        protected void Button2_Click(object sender, EventArgs e)
        {
            Database db = new Database();
            MySqlDataReader rdr = db.SelectDataFromDatabase("select result from crawler where id=" + id);
            Label1.Text = "select result from crawler where id=" + id;
            if (rdr.HasRows)
            {
                if (rdr.Read())
                {
                    textarea2.InnerText = rdr.GetString(0);
                    //Label1.Text = "Data Result" + rdr.GetString(0);

                }
            }
        }
开发者ID:suman1234567890,项目名称:CloudStructureSetup,代码行数:15,代码来源:compiler.aspx.cs

示例3: computeIt

    void computeIt(String data)
    {
        Database db = new Database();
        MySqlDataReader rdr=db.SelectDataFromDatabase("select prog,operation from crawler where id="+data);
        if (rdr.HasRows)
        {
            if (rdr.Read())
            {
                if (rdr.GetInt32(1) == 1)
                {
                    n.AddToTextBox("Data Retrived : " + rdr.GetString(0) + rdr.GetInt32(1));
                    //int res = rdr.GetInt32(0) + rdr.GetInt32(1);
                    String res=dojobC(rdr.GetString(0));
                    db.UpdateIntoDatabase("update crawler set result='" + res + "' where id=" + data);
                }
                if (rdr.GetInt32(1) == 2)
                {
                    n.AddToTextBox("Data Retrived : " + rdr.GetString(0) + rdr.GetInt32(1));
                    //int res = rdr.GetInt32(0) - rdr.GetInt32(1);
                    String res = dojobJava(rdr.GetString(0));
                    n.AddToTextBox("Result"+res);
                    db.UpdateIntoDatabase("update crawler set result='" + res + "' where id=" + data);
                }
                if (rdr.GetInt32(1) == 3)
                {
                    n.AddToTextBox("Data Retrived : " + rdr.GetInt32(0) + rdr.GetInt32(1));
                    //int res = rdr.GetInt32(0) * rdr.GetInt32(1);
                    String res = dojobC(rdr.GetString(0));
                    db.UpdateIntoDatabase("update crawler set result='" + res + "' where id=" + data);
                }
                if (rdr.GetInt32(1) == 4)
                {
                    n.AddToTextBox("Data Retrived : " + rdr.GetInt32(0) + rdr.GetInt32(1));
                    //int res = rdr.GetInt32(0) / rdr.GetInt32(1);
                    String res = dojobC(rdr.GetString(0));
                    db.UpdateIntoDatabase("update crawler set result='" + res + "' where id=" + data);
                }
                else
                {
                    n.AddToTextBox("not selected");
                }

            }
        }
    }
开发者ID:suman1234567890,项目名称:CloudStructureSetup,代码行数:45,代码来源:Communication.cs

示例4: Button1_Click

        protected void Button1_Click(object sender, EventArgs e)
        {
            Database db = new Database();
            MySqlDataReader i = db.SelectDataFromDatabase("select id from compileruser where username='"+TextBox4.Text+"' and password='"+TextBox5.Text+"'");
            if (i.HasRows)
            {
                if (i.Read())
                {
                    Session["userid"] = i.GetInt32(0);
                    Response.Redirect("compiler.aspx");
                }
                else
                {
                    Label1.Text = "login Unsuccessful";
                }

            }
        }
开发者ID:suman1234567890,项目名称:CloudStructureSetup,代码行数:18,代码来源:profile.aspx.cs

示例5: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {

                syntax_selection.Items.Clear();
                Button2.Visible = false;
                Database db = new Database();
                MySqlDataReader rdr = db.SelectDataFromDatabase("select name from compilertype");
                if (rdr.HasRows)
                {

                    while (rdr.Read())
                    {
                        //Label6.Text = "Data Result" + rdr.GetString(0);
                        //syntax_selection.Items.Add(rdr.GetString(0));
                        syntax_selection.Items.Add(rdr.GetString(0).ToString());

                    }

                }
            }
        }
开发者ID:suman1234567890,项目名称:CloudStructureSetup,代码行数:23,代码来源:compiler.aspx.cs

示例6: Button1_Click

        protected void Button1_Click(object sender, EventArgs e)
        {
            Database db = new Database(this);
            MySqlDataReader rdr = null;
            rdr = db.SelectDataFromDatabase("select ipaddress from compilertype where name='" + DropDownList1.SelectedItem.Text + "'");
            if (rdr.HasRows)
            {

                if (rdr.Read())
                {

                    type1ip = rdr.GetString(0);
                }

            }

            Label4.Text = "Your chose:" + DropDownList1.SelectedItem.Text+DropDownList1.SelectedIndex.ToString();
            int i = 0;

            i = db.InsertIntoDatabase("insert into crawler(prog,result,operation) values('" + TextBox1.Text + "','0'," + (DropDownList1.SelectedIndex+1).ToString() + ")");

            DataSend ds = new DataSend(type1ip, "5212");
            ds.sendData("  " + i.ToString());
            id = i;
            Button2.Visible = true;

            /*
            if (DropDownList1.SelectedItem.Text == "Sum")
            {

                rdr = db.SelectDataFromDatabase("select ipaddress from compilertype where name='Sum'");
                if (rdr.HasRows)
                {

                    if (rdr.Read())
                    {
                        //Label6.Text = "Data Result" + rdr.GetString(0);
                        //DropDownList1.Items.Add(rdr.GetString(0));
                        type1ip = rdr.GetString(0);
                    }

                }

                Label4.Text = "You choose:" + DropDownList1.SelectedItem.Text;
                int i = 0;

                i = db.InsertIntoDatabase("insert into crawler(prog,result,operation) values('" + TextBox1.Text + "','0',1)");
                Label4.Text = "Not updated" + i;
                DataSend ds = new DataSend(type1ip, "5212");
                ds.sendData("  "+i.ToString());
                id = i;
                Button2.Visible = true;

            }
            if (DropDownList1.SelectedItem.Text == "Sub")
            {
                rdr = db.SelectDataFromDatabase("select ipaddress from compilertype where name='Sub'");
                if (rdr.HasRows)
                {

                    if (rdr.Read())
                    {
                        //Label6.Text = "Data Result" + rdr.GetString(0);
                        //DropDownList1.Items.Add(rdr.GetString(0));
                        type2ip = rdr.GetString(0);
                    }

                }

                Label4.Text = "You choose:" + DropDownList1.SelectedItem.Text;
                int i = 0;
                db = new Database(this);
                //i = db.InsertIntoDatabase("insert into crawler(value1,value2,result,operation) values(" + TextBox1.Text + "," + TextBox2.Text + ",0,2)");
                i = db.InsertIntoDatabase("insert into crawler(prog,result,operation) values('" + TextBox1.Text + "','0',2)");
                Label4.Text = "Not updated" + i;
                DataSend ds = new DataSend(type2ip, "5212");
                ds.sendData("  " + i.ToString());
                id = i;
                Button2.Visible = true;
            }
            if (DropDownList1.SelectedItem.Text == "Multi")
            {
                rdr = db.SelectDataFromDatabase("select ipaddress from compilertype where name='Multi'");
                if (rdr.HasRows)
                {

                    if (rdr.Read())
                    {
                        //Label6.Text = "Data Result" + rdr.GetString(0);
                        //DropDownList1.Items.Add(rdr.GetString(0));
                        type3ip = rdr.GetString(0);
                    }

                }
                Label4.Text = "You choose:" + DropDownList1.SelectedItem.Text;
                int i = 0;
                db = new Database(this);
                //i = db.InsertIntoDatabase("insert into crawler(value1,value2,result,operation) values(" + TextBox1.Text + "," + TextBox2.Text + ",0,3)");
                i = db.InsertIntoDatabase("insert into crawler(prog,result,operation) values('" + TextBox1.Text + "','0',3)");
                Label4.Text = "Not updated" + i;
//.........这里部分代码省略.........
开发者ID:suman1234567890,项目名称:CloudStructureSetup,代码行数:101,代码来源:Home.aspx.cs

示例7: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            Button2.Visible = false;
            Database db = new Database(this);
            MySqlDataReader rdr=db.SelectDataFromDatabase("select name from compilertype");
            if (rdr.HasRows)
            {

                while (rdr.Read())
                {
                    //Label6.Text = "Data Result" + rdr.GetString(0);
                    DropDownList1.Items.Add(rdr.GetString(0));
                }

            }
        }
开发者ID:suman1234567890,项目名称:CloudStructureSetup,代码行数:16,代码来源:Home.aspx.cs


注:本文中的Database.SelectDataFromDatabase方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。