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,
Ïà¹ØÎĵµ£º
ÒÑÖªÓÐÒ»¸öXMLÎļþ£¨bookstore.xml£©ÈçÏ£º
<?xml version="1.0" encoding="gb2312"?>
<bookstore>
<book genre="fantasy" ISBN="2-3631-4">
&n ......
´´½¨Ò»¸öWinformÓû§¿Ø¼þ UserControl1
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.Reflection;
namespace MyActiveT ......
1¡¢C/C++³ÌÐòÔ±Çë×¢Ò⣬²»ÄÜÔÚcaseÓï¾ä²»Îª¿Õʱ“ÏòÏÂÖ´ÐД¡£
2¡¢ÖµÀàÐͺÍÒýÓÃÀàÐÍÖ®¼äµÄÇø±ð£ºC#µÄ»ù±¾ÀàÐÍ£¨int£¬charµÈ£©¶¼ÊÇÖµÀàÐÍ£¬ÊÇÔÚÕ»Öд´½¨µÄ¡£¶ø¶ÔÏóÊÇÒýÓÃÀàÐÍ£¬´´½¨ÓÚ¶ÑÖУ¬ÐèҪʹÓùؼü×Önew¡£
3¡¢ÔÚC#ÖÐͨ¹ýʵÀý·ÃÎʾ²Ì¬·½·¨»ò³ÉÔ±±äÁ¿ÊDz»ºÏ·¨µÄ£¬»áÉú³É±àÒëÆ÷´íÎó¡£µ«ÊÇÎÒÃÇ¿ÉÒÔͨ¹ýÉùÃ÷ËûÃÇ ......
private void MakeLegend(IActiveView activeView,IPageLayout pageLayout)
{
//¶¨ÒåͼÀýUID¶ÔÏó
UID uid = new UIDClass();
&n ......
C#¶ÁÈ¡ExcelÓöµ½ÎÞ·¨¶ÁÈ¡µÄ½â¾ö·½·¨£º
1.ÔÚµ¼ÈëÊý¾ÝÁ¬½Ó×Ö·û´®ÖУ¬½«IMEX=1¼ÓÈ룬“Provider=Microsoft.Jet.OLEDB.4.0;Data Source="C:\Data.xls";Extended Properties="Excel 8.0;HDR=Yes;IMEX=1; ”£¬ÕâÑù¾Í¿ÉÒÔ¡£
C#¶ÁÈ¡ExcelÐèҪעÒâµÄ£º
IMEX=1£º»ìºÏģʽ
HDR=Yes; ÊÇ·ñÈõÚÒ»ÐÐ×÷ΪÁÐÍ·
Á½Õß±ØÐëÒ»Æ ......