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

推荐订阅源

The Last Watchdog
The Last Watchdog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
S
Secure Thoughts
MongoDB | Blog
MongoDB | Blog
博客园 - Franky
T
Tor Project blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Google DeepMind News
Google DeepMind News
L
LINUX DO - 最新话题
博客园_首页
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Vercel News
Vercel News
Last Week in AI
Last Week in AI
月光博客
月光博客
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
P
Proofpoint News Feed
博客园 - 叶小钗
NISL@THU
NISL@THU
C
Check Point Blog
K
Kaspersky official blog
N
News and Events Feed by Topic
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
A
Arctic Wolf
T
Threatpost
GbyAI
GbyAI
L
LINUX DO - 热门话题
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
P
Privacy & Cybersecurity Law Blog
N
News and Events Feed by Topic
Scott Helme
Scott Helme
P
Privacy International News Feed
The Register - Security
The Register - Security
G
GRAHAM CLULEY
Recorded Future
Recorded Future
Apple Machine Learning Research
Apple Machine Learning Research
C
Cybersecurity and Infrastructure Security Agency CISA
B
Blog
Project Zero
Project Zero
Cyberwarzone
Cyberwarzone
Webroot Blog
Webroot Blog
Microsoft Security Blog
Microsoft Security Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
D
DataBreaches.Net
J
Java Code Geeks
AWS News Blog
AWS News Blog
Help Net Security
Help Net Security
Engineering at Meta
Engineering at Meta
M
MIT News - Artificial intelligence
T
Threat Research - Cisco Blogs
Google DeepMind News
Google DeepMind News

博客园 - karoc

《重构-改善既有代码的设计》读书笔记 扩展GridView,增加单选按钮列 任务开始时间和完成时间 最大长度验证控件:MaxLengthValidator 又是关于AjaxControlToolkit的ModalPopup的问题 有个总结 使用svn的小插曲 今天发现一个VS2008中文版和英文版的差别 解决DocType引起AjaxTookit的ModulPopup显示异常问题的方法 Reporting Services 2005 常见问题解决方法(不断更新) 用VSTO开发Project插件心得 自定义MemberShipProvider和PersonalizationProvider使用WebParts实现个性化页面 在线修改KeyValue配置节 瞎搞八搞,另类PageBase 改造Duwamish中的Configuration 直接用Response输出可以加批注的Excel C#控制Windows Messenger和Windows Live Messenger窗口发送消息 一个读取扩展名为xml的资源文件的方法 用C#+WMI实现获取w3wp进程对应的应用程序池
开发小经验总结(不断更新)
karoc · 2009-03-31 · via 博客园 - karoc

1、修改dbml文件后,DBDataContext连接字符串变化的问题
方法:创建一个DataContextBase:

DataContextBase

然后设计dbml,让它生成的DataContext的Base Class是上面的类,这样子类怎么变化,都会使用父类的连接串
评价:有点BT,但是挺好用的

2、团队开发,使用本机数据库做开发数据库时,web.config里连接串的问题
方法:使用SqlServer增加客户端别名,这样在连接串里使用相同的别名,即使端口不一样也没关系
评价:需要每个人的用户名或密码设置相同的,或使用集成身份验证,才能保证连接串一致

3、批量执行数据库更新脚本
方法:创建一个总的脚本文件,里面使用下面的形式,把所有的更新脚本加进来:
:r .\script\20090305_1653_aaa.sql
:r .\script\20090309_1031_bbb.sql
然后,直接全部运行,或选中部分后运行
评价:脚本文件名称中间不能有空格;部分脚本会执行错误,单独打开执行则没问题

4、UpdatePannel与导出Excel冲突
问题:页面使用UserControl中的按钮导出包含在UpdatePannel中的GridView数据为Excel,UserControl里包含一些查询条件和查询按钮、导出按钮,希望在异步刷新的时候,只更新GridView。将包含GridView的UpdatePannel的PostBackTrigger设置为UserControl的时候,点击导出按钮就会报错,因为导出时服务器端运行了Response.Write。
方法:为该UpdatePannel设置两种Trigger,一种是异步的,ControlID为UserControl的ID,另一种是同步的,ControlID为UserControl的ID+”:"+导出按钮的ID
评价:无

 5、TransactionScope避免升级到MSDTC
即使是相同连接串的多个DataContext,TransactionScope还是回升级到MSDTC处理。为了避免这种情况,可以让多个DataContext共用一个DbConnection对象。