グリッドビューへのデータバインディング中に何も取得できません。誰も助けることができますか?データベースからグリッドビューにデータを取得しません
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" Width="1000px" AllowPaging="True" PageSize="8" `CssClass="Grid" AlternatingRowStyle-CssClass="alt" PagerStyle-CssClass="pgr">
<AlternatingRowStyle CssClass="alt"></AlternatingRowStyle>
<PagerStyle CssClass="pgr"></PagerStyle>
</asp:GridView>
C#
SqlCommand cmd1 = new SqlCommand("SELECT cars.carid, cars.make, cars.model, cars.condition, cars.amount, img.img FROM cars INNER JOIN img ON cars.carid = img.imgid where model = '" + mod + "' and make = '" + mak + "' and variant = '" + var + "' and color = '" + col + "' and condition = '" + cond + "'",con);
SqlDataAdapter sda1 = new SqlDataAdapter(cmd1);
DataTable dt = new DataTable();
sda1.Fill(dt);
GridView1.DataSource = dt;
GridView1.DataBind();
は間違いがありますか? dtにデータが表示されますか? – Sajeetharan
エラーはありません..空白のページにはまだ何も表示されていない – Samsam