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

推荐订阅源

Attack and Defense Labs
Attack and Defense Labs
T
Threatpost
C
Cybersecurity and Infrastructure Security Agency CISA
H
Hackread – Cybersecurity News, Data Breaches, AI and More
I
Intezer
C
Cyber Attacks, Cyber Crime and Cyber Security
The Register - Security
The Register - Security
量子位
Security Latest
Security Latest
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
大猫的无限游戏
大猫的无限游戏
小众软件
小众软件
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
C
CXSECURITY Database RSS Feed - CXSecurity.com
MyScale Blog
MyScale Blog
J
Java Code Geeks
Apple Machine Learning Research
Apple Machine Learning Research
Google DeepMind News
Google DeepMind News
WordPress大学
WordPress大学
Spread Privacy
Spread Privacy
Jina AI
Jina AI
博客园 - 【当耐特】
P
Palo Alto Networks Blog
Last Week in AI
Last Week in AI
SecWiki News
SecWiki News
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
G
GRAHAM CLULEY
宝玉的分享
宝玉的分享
Hacker News - Newest:
Hacker News - Newest: "LLM"
T
The Blog of Author Tim Ferriss
V
Vulnerabilities – Threatpost
有赞技术团队
有赞技术团队
T
Tor Project blog
H
Hacker News: Front Page
A
Arctic Wolf
NISL@THU
NISL@THU
A
About on SuperTechFans
云风的 BLOG
云风的 BLOG
Engineering at Meta
Engineering at Meta
V
V2EX
N
News and Events Feed by Topic
Webroot Blog
Webroot Blog
Know Your Adversary
Know Your Adversary
P
Privacy International News Feed
I
InfoQ
D
Docker
L
LINUX DO - 最新话题
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
U
Unit 42

博客园 - 迷路中的路人甲

sqlserver 创建 aspstate的方法 双网卡只有一个能ping通的解决办法 yum 快速安装 Rabbitmq for CentOS6 存储过程提示临时表字段不存在的解决办法--直接修改临时表的名称,用唯一值作为名称 强制删除TFS的签出文件办法 sqlserver 2005 查找对象引用或者依赖的存储过程。 js运算BUG doubanclaim7fc6594541441a59 Excel 导入数据库的问题 C# 执行存储过程返回小数的输出值的设置方法 IE 无法显示JPG格式图片 Jquery选择器 记录 - 迷路中的路人甲 - 博客园 TED 中文视频收集 Jquery 验证插件formValidator 一点问题。 Select在IE7中的一个bug,多个Select互相重叠的问题 Google wave 发送中..... 这是什么样子的天气呀。 Office 2010 Beta 安装成功 msn9强制更新(版本:14.0.8089.726)后的 2003下的解决办法 。
DataTable 2 Sql Table
迷路中的路人甲 · 2013-03-16 · via 博客园 - 迷路中的路人甲

2013-03-16 21:50  迷路中的路人甲  阅读(249)  评论()    收藏  举报

        public void ExecuteDataTable2Table(DataTable dt,string tbName)
        {
            SqlBulkCopy sbc = new SqlBulkCopy(conn);
            sbc.DestinationTableName = tbName;
            DataTable dtFields = this.ExecuteDataTable("select * from dictionary_V where pcode='" + tbName + "_Fields'");
            string guid = Guid.NewGuid().ToString();
            dt.Columns.Add(new DataColumn("GUIDStr"));
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                dt.Rows[i]["GUIDStr"] = guid;
            }
            for (int i = 0; i < dtFields.Rows.Count; i++)
            {
                sbc.ColumnMappings.Add(new SqlBulkCopyColumnMapping(dtFields.Rows[i]["name"].ToString(), dtFields.Rows[i]["code"].ToString()));   
            }

            sbc.ColumnMappings.Add(new SqlBulkCopyColumnMapping("GUIDStr", "GUID"));
            sbc.WriteToServer(dt);
        }