|
|
|
ฟ้อง error ตัวนี้ค่ะ Column '' does not belong to table tbMAgent. asp.net c# |
|
|
|
|
|
|
|
พยายามจะส่งค่าไปหน้า crystalreport.rpt ค่ะแต่ฟ้อง error Column '' does not belong to table tbMAgent. ค่ะ
ช่วยดูตรง code นี้หน่อยค่ะ
Code (C#)
protected void Button2_Click(object sender, EventArgs e)
{
string StrConn3 = WebConfigurationManager.ConnectionStrings["BaseMungthai"].ToString();
SqlConnection Conn3 = new SqlConnection(StrConn3);
Conn3.Open();
string sqlProduct3;
sqlProduct3 = " SELECT tbMAgent.AgentCode,tbMAgent.AgentName,tbMAO.AoCode,tbMAO.AoName FROM tbMAgent INNER JOIN tbMAO ON tbMAgent.AgentID = tbMAO.AoID where tbMAgent.AgentCode = '" + TextBox1.Text + "' ";
SqlDataAdapter da3 = new SqlDataAdapter(sqlProduct3, Conn3);
DataSet ds3 = new DataSet();
da3.Fill(ds3, "tbMAgent");
//string a;
// Session["AgentID"] = Label1.Text;
CrystalDecisions.CrystalReports.Engine.ReportDocument rpt =new CrystalDecisions.CrystalReports.Engine.ReportDocument();
rpt.Load(Server.MapPath("CrystalReport1.rpt"));
rpt.SetDatabaseLogon("NID-67D182B", "thai");
rpt.SetDataSource(sqlProduct3.ToList()); //ฟ้อง error ตรงประโยคนี้ค่ะ ว่า Column '' does not belong to table tbMAgent
}
ผิดตรงไหนและแก้ตรงไหนค่ะ
Tag : .NET, Ms SQL Server 2005, Ms SQL Server 2008, C#
|
|
|
|
|
|
Date :
2011-06-10 12:15:36 |
By :
mushroomsn |
View :
1917 |
Reply :
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 02
|