c#中sda.Fill(ds)中提示错误对象名 'z_GoodsInfo' 无效
intid=int.Parse(this.TextBox1.Text);stringsql=string.Format("select*fromz_GoodsInfowh...
int id = int.Parse(this.TextBox1.Text);
string sql = string.Format("select * from z_GoodsInfo where Goods_ID ={0}", id);
using (SqlConnection conn = new SqlConnection(dbhelper.connetString))
{
conn.Open();
SqlCommand selectcommand = new SqlCommand(sql, conn);
SqlDataAdapter sda = new SqlDataAdapter(selectcommand);
DataSet ds = new DataSet();
sda.Fill(ds);//这里提示 错误对象名 'z_GoodsInfo' 无效
GridView1.DataSource = ds;
GridView1.DataBind(); 展开
string sql = string.Format("select * from z_GoodsInfo where Goods_ID ={0}", id);
using (SqlConnection conn = new SqlConnection(dbhelper.connetString))
{
conn.Open();
SqlCommand selectcommand = new SqlCommand(sql, conn);
SqlDataAdapter sda = new SqlDataAdapter(selectcommand);
DataSet ds = new DataSet();
sda.Fill(ds);//这里提示 错误对象名 'z_GoodsInfo' 无效
GridView1.DataSource = ds;
GridView1.DataBind(); 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询