最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
如何让DataGrid自动生成序号
时间:2022-06-30 10:45:31 编辑:袖梨 来源:一聚教程网
在DataGrid的第一列自动生成序号,如下图:
代码实现:
前台(WebForm1.aspx):
<%#GetCount()%>
后台(WebForm1.aspx.cs):
int count;
private void Page_Load(object sender, System.EventArgs e)
{
if(!IsPostBack)
{
SqlConnection cnn = new SqlConnection();
cnn.ConnectionString = "data source=localhost;initial catalog=Northwind;password=;"
+"persist security info=True;user id=sa;workstation id=APJ062;packet size=4096";
代码实现:
前台(WebForm1.aspx):
后台(WebForm1.aspx.cs):
int count;
private void Page_Load(object sender, System.EventArgs e)
{
if(!IsPostBack)
{
SqlConnection cnn = new SqlConnection();
cnn.ConnectionString = "data source=localhost;initial catalog=Northwind;password=;"
+"persist security info=True;user id=sa;workstation id=APJ062;packet size=4096";
相关文章
- 《QQ》恢复解散群教程 08-02
- Win11系统bug打不开设置面板怎么解决? 08-02
- 算力怎么知道-算力怎么看 08-02
- 《魔法少女小圆MagiaExedra》攻略大全 08-02
- 哈利波特魔法觉醒拼图寻宝格兰芬多塔楼线索位置攻略 08-01
- 金铲铲之战中秋挑战活动怎么玩?中秋双人大作战玩法介绍 08-01