惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

U
Unit 42
Help Net Security
Help Net Security
The Hacker News
The Hacker News
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
G
GRAHAM CLULEY
Simon Willison's Weblog
Simon Willison's Weblog
V
Vulnerabilities – Threatpost
A
Arctic Wolf
T
Tor Project blog
Jina AI
Jina AI
C
CXSECURITY Database RSS Feed - CXSecurity.com
C
Cyber Attacks, Cyber Crime and Cyber Security
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Spread Privacy
Spread Privacy
Security Latest
Security Latest
Latest news
Latest news
Last Week in AI
Last Week in AI
博客园 - 司徒正美
P
Privacy International News Feed
T
Tenable Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
腾讯CDC
博客园 - 聂微东
Scott Helme
Scott Helme
爱范儿
爱范儿
P
Proofpoint News Feed
C
CERT Recently Published Vulnerability Notes
I
Intezer
博客园 - Franky
酷 壳 – CoolShell
酷 壳 – CoolShell
L
LINUX DO - 热门话题
有赞技术团队
有赞技术团队
S
Secure Thoughts
WordPress大学
WordPress大学
The Cloudflare Blog
AWS News Blog
AWS News Blog
B
Blog RSS Feed
Cyberwarzone
Cyberwarzone
S
Security Affairs
Recent Commits to openclaw:main
Recent Commits to openclaw:main
The Register - Security
The Register - Security
L
LINUX DO - 最新话题
博客园_首页
C
Cybersecurity and Infrastructure Security Agency CISA
博客园 - 【当耐特】
T
Troy Hunt's Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
S
Securelist
S
Schneier on Security
Application and Cybersecurity Blog
Application and Cybersecurity Blog

博客园 - Blue

个已实现的例子:通过Javascript在页面中直接调用Office Communicator API - Blue cmd脚本(C# 清缓存) - Blue - 博客园 isql脚本编写创建数据库(SQL Server2000) 怎样踢mstsc占用者 copy:键盘按键和键盘对应代码表 Thread简单概念 转:ListView 中添加大数据量解决屏幕刷新“闪”的现象 Regsvr32命令全攻略 一个字段存很多枚举值,然后从字段取出的方法 關於泛型的資料 索引器的两种用法 在建表时使用DEFAULT是很有用的 关于web service的验证 SQL中计算月初和月末 临时表有时很有用 在GROUP语句中还可以增加很多内容 注意insert语句写法 case的用法 尽量减少使用游标
导入导出CVS文件遇到的问题 - Blue - 博客园
Blue · 2007-07-02 · via 博客园 - Blue

1.在导出的时候,拼出cvs串:数字直接逗号分隔,字符要加引号
"\""+indexdata.DataValue.ToString()+ "\"," + "\r\n";  换行
写入文件的时候用下面的写法没问题,不然会出现:不根据逗号分开,excel打开文件串存储在一个column中。
using (StreamWriter sw = new StreamWriter(filePath))
{
sw.Write(GenerateExportString());
sw.Close();
}

2.导入写法

public DataSet ConnectCSVFile(string fileName ,string path)
{
System.Data.Odbc.OdbcDataAdapter obj_oledb_da;
DataSet ds =
new DataSet();
try
{
string strConnString="Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq="+path.Trim()+";Extensions=asc,csv,tab,txt;Persist Security Info=False";
string sql_select;
System.Data.Odbc.OdbcConnection conn; 
//Create connection to CSV file
conn = new System.Data.Odbc.OdbcConnection(strConnString.Trim());
// For creating a connection using DSN, use following line
//conn = new System.Data.Odbc.OdbcConnection(DSN="MyDSN");
//Open the connection
conn.Open();
//Fetch records from CSV
sql_select = "select * from ["+ fileName +"]";
obj_oledb_da =
new System.Data.Odbc.OdbcDataAdapter(sql_select,conn);
//Fill dataset with the records from CSV file
obj_oledb_da.Fill(ds,"dc_indexdata");
//Close Connection to CSV file
conn.Close();
}
catch(Exception er) //Error
{DcService.MessageService.ShowError(er.Message);}
return ds;
}