我不确定我的代码有什么问题。当我运行它时,我收到错误:SqlException is unhandled by user code。System.Data.dll 中出现“System.Data.SqlClient.SqlException”类型的异常,但未在用户代码中处理
附加信息:无效的对象名称“ProductionPlanFabric”。
这是什么意思?
谢谢 :)
private void displayPendingFabric()
{
string strConn = ConfigurationManager.ConnectionStrings
["ZZFashionIMSConnectionString"].ToString();
SqlConnection conn = new SqlConnection(strConn);
SqlCommand cmd = new SqlCommand("SELECT ProductionPlanID, FashionStyleID, FabricID, WarehouseID, PPStatus, PPFabricReqd, PPFabricIssued FROM ProductionPlanFabric WHERE PPStatus = 0 OR PPStatus = 2", conn);
SqlDataAdapter daPPFabric = new SqlDataAdapter(cmd);
DataSet result = new DataSet();
conn.Open();
daPPFabric.Fill(result, "ProductionPlanFabric");
DataView dvPPFabric = result.Tables["ProductionPlanFabric"].DefaultView;
conn.Close();
gvPPFabric.DataSource = dvPPFabric;
gvPPFabric.DataBind();
}