protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
getControls();
}
}
public void getControls()
{
string connn = ConfigurationManager.ConnectionStrings["RiskRegisterDBConnectionString"].ConnectionString;
DataTable ds = DB.GetDataTable("Select * from ControlTable", connn);
// GridView11.DataSource = ds;
GridView11.DataBind();
}
我试过使用AutoGenerationColumn
作为“true”和“false”,但是在运行程序时,我无法在浏览器中显示gridview。
<asp:GridView ID="GridView11" runat="server"
AutogenerateColumns="False" Cellpadding="4"
CssClass="auto-style6" DataKeyNames="Control_ID"
DataSourceID="SqlDataSource1"
Forecolor="#333333" Gridlines="None" Width="1124px" >
1条答案
按热度按时间kq0g1dla1#
尝试你的代码说这样: