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

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hacker News: Front Page
P
Palo Alto Networks Blog
T
ThreatConnect
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
T
True Tiger Recordings
P
Privacy & Cybersecurity Law Blog
B
Blog
IT之家
IT之家
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
C
Comments on: Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
N
News and Events Feed by Topic
NISL@THU
NISL@THU
腾讯CDC
雷峰网
雷峰网
Security Latest
Security Latest
李成银的技术随笔
M
Microsoft Research Blog - Microsoft Research
L
LangChain Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Check Point Blog
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
博客园 - Franky
N
News | PayPal Newsroom
V
V2EX
A
About on SuperTechFans
The Register - Security
The Register - Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
MyScale Blog
MyScale Blog
Cisco Talos Blog
Cisco Talos Blog
Vercel News
Vercel News
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
爱范儿
爱范儿
A
Arctic Wolf
L
LINUX DO - 最新话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

博客园 - 奚彧

Siverlight 导出Excel (经测试通过 Vs2010 ,silverlight5 ) 打印代码片段 部署silverlight ria 程序 备忘 - 奚彧 刚学 silverlight 问题遇到一堆 2010 微软难道抛弃了ado.net data service openfire 安装 关于DataSet.merge 问题的答案。 .net常用代码 (收藏) - 奚彧 - 博客园 碰到一个巨郁闷的情况! - 奚彧 - 博客园 关于连接池问题 删除确认按钮 - 奚彧 - 博客园 水晶报表自动插入空白行 也谈如何缩小SQL SERVER日志文件 新年第一帖,祝大家新年快乐! vs2005什么时候能出正式版 《WEB打印的相关技术分析》 web打印2 web打印 权限设置问题!(比较着急)
关于merge
奚彧 · 2006-06-11 · via 博客园 - 奚彧

关于DataSet 合并问题,搜了下,也没解决.下面是一个可以合并,而且可以update 的程序.

        public   DataSet   CreateCmdsAndUpdate(DataSet   myDataSet,string   myConnection,string   mySelectQuery,string   myTableName)     
        
{
            OleDbConnection   myConn   
=   new   OleDbConnection(oleDbConnection2.ConnectionString);   
            OleDbDataAdapter   myDataAdapter   
=   new   OleDbDataAdapter();   //没数据
            myDataAdapter.SelectCommand   =   new   OleDbCommand(mySelectQuery,   myConn);   
            OleDbCommandBuilder   custCB   
=   new   OleDbCommandBuilder(myDataAdapter);   
    
            myConn.Open();   
            DataSet   custDS   
=   new   DataSet();   
            myDataAdapter.Fill(custDS,myTableName);
   
            
新增的代码,完成生成一个新的DataSet并和老的merge在一起   
    
            myDataAdapter.Update(custDS,   myTableName);   
            myConn.Close();   
            
return   custDS;   
        }
 

上述newData 是在程序中创建的,并且填充的数据,一切正常.但是如果将该newData 的数据填充方法换成
OleDataAdapter 从数据库读数据填充,再merge ,则update 执行失败,不能达到预想的效果进行合并.
到底是什么原因呢,请各位高手指点.