请问你的datagrid的visible的属性设置为true了吗?或者你有没有把datagrid放在别的控件内(该控件的visible?)?。我觉得一般不会看不见的。
解决方案 »
- replace不起作用
- 网站要做推荐功能,如何区分是哪个人推荐过来的
- 怎样实现只显示文件夹而不显示文件
- 密码不满足密码策略的要求。检查最小密码长度、密码复杂性和密码历史的要求
- 如何得到table中一行的数据
- 关于绿色软件的问题,高手们指点一下。
- 请教自定义事件问题
- 我有一vc6写的DLL,请问有何办法用.net打开里面进行重新编译呢
- 水晶报表,深夜求救~~~~~~~~~~~~~~~~~~~~
- 怎样判断两个日期之间的时间差是否是14天??
- 我想在页面关闭时记录下当时的时间等资料,可是ONUNLOAD事件在页面跳转和关闭时都会响应,我希望只在页面关闭时响应,如何是好啊!
- 域服务器上可以安装.net吗?
也就不是控件的问题了。你的代码八成没有帮定数据源,或数据为空。
并DataBind(). 然后Start without Debugging,但Datagrid在web下就显示不出来,同时也不报错? 为什么?(C#、VB#、J#都试过了)
其实就是在web页面上用DataGrid显示数据,没几句代码!public class Component1 extends System.ComponentModel.Component
{
private System.Data.SqlClient.SqlDataAdapter sqlDataAdapter1;
private System.Data.SqlClient.SqlCommand sqlSelectCommand1;
private System.Data.SqlClient.SqlCommand sqlInsertCommand1;
private System.Data.SqlClient.SqlCommand sqlUpdateCommand1;
private System.Data.SqlClient.SqlCommand sqlDeleteCommand1;
private System.Data.SqlClient.SqlConnection sqlConnection1;
/**
* Required designer variable.
*/
private System.ComponentModel.Container components = null; public Component1(System.ComponentModel.IContainer container)
{
// Required for Windows.Forms Class Composition Designer support
container.Add(this);
InitializeComponent(); //
// TODO: Add any constructor code after InitializeComponent call
//
} public Component1()
{
// Required for Windows.Forms Class Composition Designer support
InitializeComponent(); //
// TODO: Add any constructor code after InitializeComponent call
//
} public void FillDataSet(myDataSet dSet)
{
sqlDataAdapter1.Fill(dSet);
}----------------------------------public class WebForm1 extends System.Web.UI.Page
{
protected mywebform.myDataSet myDataSet1;
protected System.Web.UI.WebControls.DataGrid DataGrid1; protected Component1 myComponent = new Component1(); private void Page_Load(System.Object sender, System.EventArgs e)
{
// Put user code to initialize the page here
if (! get_IsPostBack())
{
myComponent.FillDataSet(myDataSet1);
DataGrid1.DataBind();
}
} protected void OnInit(System.EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer. Donot remove this.
//
InitializeComponent();
super.OnInit(e);
}
{
myComponent.FillDataSet(myDataSet1);
DataGrid1.DataBind();
}好像错了!
DataGrid1.DataBind();