c# 操作excel
OleDbConnection conn = null;
try
{
`string strConn;
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" +
"Data Source="+path+";"+
"Extended Properties='Excel 8.0;'";
conn = new OleDbConnection(strConn);
conn.Open();
string Sql = "select * from [list$]";
System.Data.OleDb.OleDbCommand cmd = new System.Data.OleDb.OleDbCommand();
OleDbDataAdapter ddp = new OleDbDataAdapter(Sql, conn);
DataSet ds = new DataSet();
ddp.Fill(ds);
//cmd.Connection = conn;
//在Excel的Sheet1的A3到H3处插入数据
//cmd.CommandText = "insert into [Sheet1$A3:H3] (F1,F2,F3,
相关文档:
(一)把文件内容写入Access数据库的OLE对象字段中:
if (File.Exists(txtBrow.Text) != false) // 文本框txtBrow中内容为文件路径及文件名
{
//获取文件后缀
FileInfo p = new FileInfo(txtBrow.Text.Trim());
F_str_Type = ......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Xml;
namespace WebApplication2
{
/// <summary>
/// XMLHelper XML文档操作管理器
&nb ......
通过xsl转换大xml文件
这几天在做这个,网上的几个方法我都试过了,汇总如下
方法一:
XPathDocument myXPathDoc = new XPathDocument(tbXMLFile.Text);
XslCompiledTransform myXslTrans = new XslCompiledTransform();
myXslTrans.Load(tbXSLFile.Text);
XmlTextWriter myWriter = new XmlTextWrit ......
public sealed class DbOper
{
///<summary>
/// DbOper类的构造函数
///</summary>
private DbOper()
{
}
......
//命名空间 using Microsoft.Win32;
private void checkBox2_CheckedChanged(object sender, System.EventArgs e)
{
if (checkBox2.Checked) //设置开机自启动
{
//MessageBox.Show ("设置开机自启动需要修改注册表","提示");
string path = Application.ExecutablePath;
RegistryKey rk = Registry.LocalMac ......