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

推荐订阅源

Blog — PlanetScale
Blog — PlanetScale
Y
Y Combinator Blog
G
Google Developers Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
L
LangChain Blog
S
SegmentFault 最新的问题
J
Java Code Geeks
V
Visual Studio Blog
H
Help Net Security
Stack Overflow Blog
Stack Overflow Blog
aimingoo的专栏
aimingoo的专栏
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
Tailwind CSS Blog
Microsoft Azure Blog
Microsoft Azure Blog
博客园_首页
H
Hackread – Cybersecurity News, Data Breaches, AI and More
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - Franky
B
Blog RSS Feed
The Cloudflare Blog
MyScale Blog
MyScale Blog
月光博客
月光博客
Microsoft Security Blog
Microsoft Security Blog
美团技术团队

博客园 - nametmp

【转】Resource与Resx的区别 - nametmp - 博客园 异步调用过程 Winform用匿名方法新建线程的方法 enum枚举用法笔记 对C#委托的理解 对using的新认识 视频文件信息读取器 【转贴】GridView里面的HYPERLINK数据邦定 【转贴】数据邦定语法 - nametmp - 博客园 TableAdapter、Dataset与BindingSource的关系 webform 可视化在gridview中加入其它控件 WinForm 加入登陆窗体(c#) winform 中的 datagridview 添加 progressbar列 和 calendar 列 远程删除Kaspersky(被Kaspersky搞了一天) SqlServer2000登陆角色的具体权限 终于用sqlcmd连上sqlserver2005express了 sqlserver操作摘录 [转]SQL Server 2005中的SQLCMD工具使用 [转]sqlserver2005(Express版)的配置
琐碎记录
nametmp · 2008-01-05 · via 博客园 - nametmp

1、为什么表的ID列已经是“[bigint] IDENTITY(1,1) NOT NULL”了,在datasource中的不能自动生成update、delete?
答:须加“[PRIMARY]

2、如何将gridview的时间列的“时分秒”隐藏,只保留“年月日”?
答:<asp:BoundField DataField="csrq" HeaderText="出生日期" DataFormatString="{0:yy-M-d}" HtmlEncode="False" />

3、给gridview的“删除”按钮弹出确认筐?
(1)将“删除”列转为template。(gridview右上角的小三角-编辑列-选中“删除”列-点击“将此字段的转为templatefield”)
(2)给“删除”列的LinkButton控件加属性:OnClientClick="javascript:return confirm('您确定删除吗?')"

4、读取ConnectionString
在vs.net 2005 beta 2开始,如果你在web.config中使用了数据库连接字符串的配置,那么应该按如下的方法去写:
<connectionStrings>
<add name="NorthwindConnectionString" connectionString="Data Source=LIAO;Initial Catalog=Northwind;User ID=sa;Password=xxxx" providerName="System.Data.SqlClient"/>
</connectionStrings>

读取:
方法一:SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["AppConnectionString1"].ConnectionString);

方法二:string connString = System.Web.Configuration.WebConfigurationManager.ConnectionStrings["sqlConnectionString"].ToString();

5、c#中的base与this
this 代表当前类,base代表当前类的父类。
很多情况下不写this也可以,写出来是为了代码的可读性,容易被人理解。
在子类和父类的属性或方法名有重复的时候就必须用this或base指名是用的谁的属性及方法。