学习型 ASP/PHP/ASP.NET 主机 30元/年全能 ASP/PHP/ASP.NET 主机,支持月付专业 MSSQL 数据库空间,支持月付专业 MySQL 数据库空间,支持月付
轻松建立自己的群组,招兵买马   
发新话题
打印

[转帖]将SQL Server中的数据导入到Excel

怎么做的

TOP

...

..........................

TOP

关键字变色!

关键字变色!
OleDbConnection adc = DB.CreateDb();
        adc.Open();
        OleDbCommand adccmd = new OleDbCommand("select * from shoplist where provins like '%" + this.TextBox1.Text + "%' or city like '%" + this.TextBox1.Text + "%' or linker like '%" + this.TextBox1.Text + "%' or phone like '%" + this.TextBox1.Text + "%' or faxmail like '%" + this.TextBox1.Text + "%' or address like '%" + this.TextBox1.Text + "%'", adc);
        OleDbDataAdapter oda1 = new OleDbDataAdapter();
        DataSet ds1 = new DataSet();
        int y = Convert.ToInt32(adccmd.ExecuteScalar());
        oda1.SelectCommand = adccmd;
        oda1.Fill(ds1);
        if (this.TextBox1.Text == "")
        {
            Response.Redirect("Default.aspx");
        }
        string tmp = this.TextBox1.Text;
        for (int i = 0; i < ds1.Tables[0].Rows.Count; i++)
        {
                for (int j = 0; j < ds1.Tables[0].Columns.Count; j++)
                {
                        ds1.Tables[0].Rows[i][j] = ds1.Tables[0].Rows[i][j].ToString().Replace(tmp, "<font color=red ><strong>" + tmp + "</strong></font>");
                }
        }
        this.GridView1.DataSource = ds1.Tables[0];        
        this.GridView1.DataBind();
        adc.Close();

TOP

hello
你不能让所有人都满意,因为不是所有人都是人!

TOP

正好想了解!

TOP

dddddddddddddddddddddddd
也许我没有明天,但是我拥有现在

TOP

到类里是不是一样的

TOP

kankan xian !!

TOP

谢谢了

TOP

不错

看看看看

TOP

发新话题