富贵资源网 Design By www.hznty.com
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.OleDb;
public partial class html_Test_Execl : System.Web.UI.Page
......{
static string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + HttpContext.Current.Server.MapPath("~/html/") + "new.xls;Extended Properties=Excel 8.0;";
protected void Page_Load(object sender, EventArgs e)
......{
}
protected void btnADONET_CreateExecle_Click(object sender, EventArgs e)
......{
OleDbConnection cn = new OleDbConnection( connectionString );
cn.Open();
OleDbCommand cmd = new OleDbCommand();
cmd.Connection = cn;
cmd.CommandText = "create table myTable(firstName char(255),lastName char(255))";
cmd.ExecuteNonQuery();
cmd.CommandText = "insert into myTable (firstName,lastName) values('liao','haibing')";
cmd.ExecuteNonQuery();
cmd.CommandText = "insert into myTable(firstName,lastName) values('廖','海兵')";
cmd.ExecuteNonQuery();
cmd.CommandText = "create table myTable2(姓名 char(255) , 住址 char(255))";
cmd.ExecuteNonQuery();
cn.Close();
}
protected void btnShowExecl_Content_Click(object sender, EventArgs e)
......{
ShowExeclContent();
}
private void ShowExeclContent()
......{
OleDbConnection cn = new OleDbConnection(connectionString);
OleDbDataAdapter dda = new OleDbDataAdapter("select * from [myTable]", cn);
DataSet ds = new DataSet();
dda.Fill(ds, "myTable");
DataGrid1.DataSource = ds.Tables["myTable"].DefaultView;
DataGrid1.DataBind();
}
protected void btnInsertExecl_Click(object sender, EventArgs e)
......{
InsertExeclDate();
ShowExeclContent();
}
private void InsertExeclDate()
......{
string executeString = "insert into myTable(firstName,lastName)values('" + this.txtFirstName.Text.Trim() + "','" + txtLastName.Text.Trim() + "')";
this.upDate_Insert_Delete_Operator(executeString);
}
protected void btnUpdateSelect_Click(object sender, EventArgs e)
......{
upDateSelect(this.txtFirstName.Text.Trim(), this.txtLastName.Text.Trim());
ShowExeclContent();
}
private void upDateSelect(string firstName,string lastName)
......{
string executeString = "update myTable set lastName = '" + lastName + "' where firstName = '" + firstName + "'";
this.upDate_Insert_Delete_Operator(executeString);
}
/**//**//**////删除操作进行不了,提示ISAM 不支持在链接表中删除数据。 不知道有没有什么办法可以解决这个问题
protected void btnDelete_Click(object sender, EventArgs e)
......{
Delete(this.txtFirstName.Text.Trim());
ShowExeclContent();
}
private void Delete(string firstName)
......{
string executeString = "delete from myTable where firstName = '" + firstName + "'";
this.upDate_Insert_Delete_Operator(executeString);
}
private void upDate_Insert_Delete_Operator(string executeString)
......{
OleDbConnection cn = new OleDbConnection(connectionString);
cn.Open();
OleDbCommand cmd = new OleDbCommand(executeString, cn);
cmd.ExecuteNonQuery();
cn.Close();
}
}
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.OleDb;
public partial class html_Test_Execl : System.Web.UI.Page
......{
static string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + HttpContext.Current.Server.MapPath("~/html/") + "new.xls;Extended Properties=Excel 8.0;";
protected void Page_Load(object sender, EventArgs e)
......{
}
protected void btnADONET_CreateExecle_Click(object sender, EventArgs e)
......{
OleDbConnection cn = new OleDbConnection( connectionString );
cn.Open();
OleDbCommand cmd = new OleDbCommand();
cmd.Connection = cn;
cmd.CommandText = "create table myTable(firstName char(255),lastName char(255))";
cmd.ExecuteNonQuery();
cmd.CommandText = "insert into myTable (firstName,lastName) values('liao','haibing')";
cmd.ExecuteNonQuery();
cmd.CommandText = "insert into myTable(firstName,lastName) values('廖','海兵')";
cmd.ExecuteNonQuery();
cmd.CommandText = "create table myTable2(姓名 char(255) , 住址 char(255))";
cmd.ExecuteNonQuery();
cn.Close();
}
protected void btnShowExecl_Content_Click(object sender, EventArgs e)
......{
ShowExeclContent();
}
private void ShowExeclContent()
......{
OleDbConnection cn = new OleDbConnection(connectionString);
OleDbDataAdapter dda = new OleDbDataAdapter("select * from [myTable]", cn);
DataSet ds = new DataSet();
dda.Fill(ds, "myTable");
DataGrid1.DataSource = ds.Tables["myTable"].DefaultView;
DataGrid1.DataBind();
}
protected void btnInsertExecl_Click(object sender, EventArgs e)
......{
InsertExeclDate();
ShowExeclContent();
}
private void InsertExeclDate()
......{
string executeString = "insert into myTable(firstName,lastName)values('" + this.txtFirstName.Text.Trim() + "','" + txtLastName.Text.Trim() + "')";
this.upDate_Insert_Delete_Operator(executeString);
}
protected void btnUpdateSelect_Click(object sender, EventArgs e)
......{
upDateSelect(this.txtFirstName.Text.Trim(), this.txtLastName.Text.Trim());
ShowExeclContent();
}
private void upDateSelect(string firstName,string lastName)
......{
string executeString = "update myTable set lastName = '" + lastName + "' where firstName = '" + firstName + "'";
this.upDate_Insert_Delete_Operator(executeString);
}
/**//**//**////删除操作进行不了,提示ISAM 不支持在链接表中删除数据。 不知道有没有什么办法可以解决这个问题
protected void btnDelete_Click(object sender, EventArgs e)
......{
Delete(this.txtFirstName.Text.Trim());
ShowExeclContent();
}
private void Delete(string firstName)
......{
string executeString = "delete from myTable where firstName = '" + firstName + "'";
this.upDate_Insert_Delete_Operator(executeString);
}
private void upDate_Insert_Delete_Operator(string executeString)
......{
OleDbConnection cn = new OleDbConnection(connectionString);
cn.Open();
OleDbCommand cmd = new OleDbCommand(executeString, cn);
cmd.ExecuteNonQuery();
cn.Close();
}
}
富贵资源网 Design By www.hznty.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
富贵资源网 Design By www.hznty.com
暂无评论...
稳了!魔兽国服回归的3条重磅消息!官宣时间再确认!
昨天有一位朋友在大神群里分享,自己亚服账号被封号之后居然弹出了国服的封号信息对话框。
这里面让他访问的是一个国服的战网网址,com.cn和后面的zh都非常明白地表明这就是国服战网。
而他在复制这个网址并且进行登录之后,确实是网易的网址,也就是我们熟悉的停服之后国服发布的暴雪游戏产品运营到期开放退款的说明。这是一件比较奇怪的事情,因为以前都没有出现这样的情况,现在突然提示跳转到国服战网的网址,是不是说明了简体中文客户端已经开始进行更新了呢?