I want to bind 2 different datatable to gridview and ignore when have error "does not contain a property with the name" can ignore this error and let textbox value still null
<asp:TemplateField ItemStyle-Width="60px">
<ItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Width="100%" Text='<%# Eval("total_df") %>' CssClass="har"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
protected void GrAdd()
{
if (stat == "1")
{
try
{
conn = new SqlConnection();
conn.ConnectionString = strconn;
conn.Open();
string sql1 = "select * from testresultdetailfix where poid = '" + poid + "'";
SqlDataAdapter da;
dtgradd = new DataTable();
da = new SqlDataAdapter(sql1, conn);
da.Fill(dtgradd);
GridAdd.DataSource = dtgradd;
GridAdd.DataBind();
conn.Close();
}
catch (Exception)
{
}
}
else if (stat == "2")
{
conn = new SqlConnection();
conn.ConnectionString = strconn;
conn.Open();
string sql1 = "select * from testdetailfix where poid = '" + poid + "' and fix_time = " + ftime + " order by poid,productid,color,size";
SqlDataAdapter da;
dtgradd = new DataTable();
da = new SqlDataAdapter(sql1, conn);
da.Fill(dtgradd);
conn.Close();
GridAdd.DataSource = dtgradd;
GridAdd.DataBind();
conn.Close();
}
}