前面的aspx基本上就一个<asp:DataGrid
id=DataGrid1
runat=Server/>
后面的,我不知道怎么减了
id=DataGrid1
runat=Server/>
后面的,我不知道怎么减了
解决方案 »
- javascript用window.close()关闭窗口,那.net用什么啊
- asp.net 中GridView的问题,请各路高手看看
- 简单提问
- ASP.NET从数据库读取数据并生成一下格式的XML文件?在线等~~
- 无刷新联动总是显示错误?我是在CSDN上查询的!
- 用localhost就出现这个 问题,但是用我的IP就没有问题
- e.Row.Cells[3].Text =Convert.ToDateTime(e.Row.Cells[3].Text).ToShortDateString();出现的问题
- 如何在一个服务器按钮控件提交前显示模式对话框~~~???
- 最近网站经常出现 未能加载文件或程序集错误
- 斑竹,思归,江雨你们在吗?请教一个关于session的问题
- 求《C#字符串和正则表达式参考手册》电子书
- 请问怎么在DataGrid 的中间插任意行啊?
{
// 在此处放置用户代码以初始化页面
if (!IsPostBack)
{
}
this.sqlConnection1.Open();
System.Data.SqlClient.SqlDataReader dr;
dr = this.sqlCommand1.ExecuteReader();
this.DataGrid1.DataSource=dr;
DataGrid1.DataBind();
dr.Close();
this.sqlConnection1.Close(); }
谢谢楼上的,已经解决,结贴!
谢谢
以后会尽量照这个方法做
dr = this.sqlCommand1.ExecuteReader();DataGrid1.DataSource = dr; //加上这一句就行了DataGrid1.DataBind();