GridView

<add name="connStr" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\Example.mdb" providerName="System.Data.OleDb"/>

|DataDirectory|的使用,太酷了!

摘自:http://www.cnblogs.com/huangjianhuakarl/archive/2009/02/03/1381710.html

查找到|DataDirectory|的相关资料

By default this variable will be expanded as:

默认情况下,DataDirectory会被解释为以下三种路径
•For a local Application this will be the Assembly (App's .exe) folder;

对于WinForm应用程序,解释为App's .exe所在的文件夹
•For ClickOnes running Apps it will be a special data folder created by ClickOnes;


•For ASP.NET App it will be App_Data folder.

网页程序,解释为App_Data文件夹;
Because the |DataDirectory| is a property of App domain, you can change its value by doiung
AppDomain.CurrentDomain.SetData("DataDirectory", newDataPath);

摘自:http://zhaojie.blog.51cto.com/1768828/932235

GridView的DataKeyNames、DataKeys、Rows、Cells、Controls的概念与用法,在这里:http://www.pengzhiyong.com/blog/6.html 写的不错;

摘要:

如何绑定主键值,最直接的方式就是:

1
<ASP:GRIDVIEW id=gvTest datakeynames="KEYNAME" runat="server"></ASP:GRIDVIEW>

代码中的KEYNAME是指数据源中的主键列名,然后GridView会自动将数据源中的主键值绑定于GridView中。另外,还有自定义主键值的方式:

1
gridview.DataKeyNames=new string[] {"主键名"}

PS:上面自定义主键值的代码一定要放在Page_Load中,否则Delete事件找不到主键,会出错。

*获取主键值的方式:DataKeys[行数],如:DataKeys[e.NewEditIndex](获取编辑行的主键值)、DataKeys[e.NewSelectedIndex](获取选中行的主键值)

[A1.ASP-NET]Gridview控件高效异步更新与实验(翻译) 

摘自:http://blog.csdn.net/jsyczf/article/details/5284171

摘要:

http://www.ajaxmatters.com/,这应该是英文原文地址;

 最下面是源程序,该程序的代码写的太好了;

尤其是hyp = null;这一句,让人开心的笑了。

posted @ 2013-01-17 16:41  xyzyyj  阅读(206)  评论(0编辑  收藏  举报