asp.net的一点简单的问题,编译时总是提示:行 24 sda.Fill(ds,"article");错误,大神们,求助啊
usingSystem;usingSystem.Collections;usingSystem.Configuration;usingSystem.Data;usingS...
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
public partial class DataSet : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
SqlConnection sqlcon = new SqlConnection();
DataSet ds = new DataSet();
sqlcon.ConnectionString = "Data Source=localhost;Initial Catalog=test;Integrated Security=True;";
sqlcon.Open();
SqlDataAdapter sda = new SqlDataAdapter();
sda.SelectCommand = new SqlCommand("select * from article",sqlcon);
sda.Fill(ds,"article");
sqlcon.Close();
}
} 展开
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
public partial class DataSet : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
SqlConnection sqlcon = new SqlConnection();
DataSet ds = new DataSet();
sqlcon.ConnectionString = "Data Source=localhost;Initial Catalog=test;Integrated Security=True;";
sqlcon.Open();
SqlDataAdapter sda = new SqlDataAdapter();
sda.SelectCommand = new SqlCommand("select * from article",sqlcon);
sda.Fill(ds,"article");
sqlcon.Close();
}
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询