连接数据库 第 1 行: 'form' 附近有语法错误
cs文件---------------protectedvoidPage_Load(objectsender,EventArgse){getDate();}publicv...
cs文件
---------------
protected void Page_Load(object sender, EventArgs e)
{
getDate();
}
public void getDate()
{
SqlConnection cn = new SqlConnection("server=localhost;database=BSM;user=dili;password=110;");
SqlCommand cmd = new SqlCommand("select * form SS_USER ", cn);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds,"SS_USER");
this.GridView1.DataSource = ds.Tables[0].DefaultView;
this.DataBind();
}
------------------
aspx文件
<body>
<div>
<form runat="server" id="form1">
<asp:GridView ID="GridView1" runat="server">
</asp:GridView>
</form>
</div>
</body>
-------------------
程序调试错误 展开
---------------
protected void Page_Load(object sender, EventArgs e)
{
getDate();
}
public void getDate()
{
SqlConnection cn = new SqlConnection("server=localhost;database=BSM;user=dili;password=110;");
SqlCommand cmd = new SqlCommand("select * form SS_USER ", cn);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds,"SS_USER");
this.GridView1.DataSource = ds.Tables[0].DefaultView;
this.DataBind();
}
------------------
aspx文件
<body>
<div>
<form runat="server" id="form1">
<asp:GridView ID="GridView1" runat="server">
</asp:GridView>
</form>
</div>
</body>
-------------------
程序调试错误 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询