excel 导入到access时
protected void Button1_Click(object sender, EventArgs e)
{
string file = "Sheet1";
string conn = " Provider = Microsoft.Jet.OLEDB.4.0 ; Data Source =" + Server.MapPath("excel.xls") + ";Extended Properties='Excel 8.0;HDR=NO;'";
OleDbConnection thisconnection = new OleDbConnection(conn);
thisconnection.Open();
string Sql = "select * from [" + file + "$]";
OleDbDataAdapter mycommand = new OleDbDataAdapter(Sql, thisconnection);
System.Data.DataSet ds = new System.Data.DataSet();
mycommand.Fill(ds, "[" + file + "$]");
thisconnection.Close();
//string conn1 = "User ID=sa;Data Source=127.0.0.1;Password=;Initial Catalog=Lecture;Provider=SQLOLEDB.1;";
OleDbConnection thisconnection1 = new OleDbConnection(ConfigurationManager.AppSettings["strConn"].ToString() + System.Web.HttpContext.Current.Server.MapPath(ConfigurationManager.AppSettings["dbPath"]));
thisconnection1.Open();
int count =
相关问答:
Dbgrid连接access 显示数据时拖动滚动条死机?怎么解决啊?
机器太差了吧?
是不是你数据量太大了啊
你数据少一些看看还死机吗?
数据很少啊 就一页。
我在BCB6下做过不少 DBGRID+ACCESS ,从来没有遇到 ......
在阿帕奇的web access log中,有一个是用户名选项,默认是域用户名。如果我用的是form 方式登陆,想把这个用户名写到access log中怎么实现?
楼上的, 现在的access log 是这样的
2009-07-04 02:16:37 110.110 ......
delphi 2007 + access 2007 +odbc +TADODataset,TADOConnection,TADOCommand
//删除数据
procedure TCDSSelectTools.DeleteMachine(byMachineID: string);
tmpCmd := TADOCommand.Create(ni ......
我写了一个软件,要用到ACCESS数据库,我再访问ACCESS的时候,我需要从表里读出一行数据,我的程序是这样写的,SQLSTRING="SELECT * from '" &ME.TEXTBOX1.TEXT &"' WHERE ID = '"& ......