Hi ,
i modified the Solution it work fine
SqlConnection con = new SqlConnection(@"Data Source=.;Initial Catalog=TestDB;Integrated Security=True");
con.Open();
SqlDataAdapter daShow1 = new SqlDataAdapter("SELECT a.OID, a.PID, b.PName as PName, a.OPQuantity as OPQuantity, a.PPrice as PPrice, a.OPTotalPrice as OPTotalPrice FROM OrderProducts AS a LEFT OUTER JOIN Products AS b ON a.PID = b.PID WHERE (a.OID = '" + txtSearchOrderID.Text + "'", con);
DataSet dsShow1 = new DataSet();
daShow1.Fill(dsShow1);
gh1.DataSource = dsShow1.Tables[0];
gh1.DataBind();
<asp:GridView runat="server" ID="gh1" AutoGenerateColumns="false" EmptyDataText="No">
<Columns>
<asp:TemplateField HeaderText="Product Name">
<ItemTemplate>
<asp:Label ID="lbl1" runat="server" Text='<%# Eval("PName") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Quantity">
<ItemTemplate>
<asp:Label runat="server" ID="lbl2" Text='<%#Eval("OPQuantity") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Price">
<ItemTemplate>
<asp:Label runat="server" ID="lbl3" Text='<%#Eval("PPrice") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Total">
<ItemTemplate>
<asp:Label runat="server" ID="lbl4" Text='<%#Eval("OPTotalPrice") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
the Problem was
1 - in your sql statement .
2 - in your expression binding , you were binding like this
<asp:Label runat="server" ID="lbl1" Text='<%Eval("PName")%>'></asp:Label>
and you should do it like this one
<asp:Label ID="lbl1" runat="server" Text='<%# Eval("PName") %>'></asp:Label>
Hope it help you .
Best Regards
M.Mitwalli