Hello I recieve following error when I want show Image in gridview :
""A field or property with the name 'Imagess' was not found on the selected data source.""
<asp:GridView ID="GridView1" runat="server" Font-Names="Tahoma">
<Columns>
<asp:ImageField DataImageUrlField="Imagess" ControlStyle-Width="100"
ControlStyle-Height = "100" HeaderText = "Preview Image">
<ControlStyle Height="100px" Width="100px"></ControlStyle>
</asp:ImageField>
</Columns>
</asp:GridView>
protected void Button1_Click(object sender, EventArgs e)
{
DataTable dt;
string conStr = ConfigurationManager.ConnectionStrings["cConnectionString"].ConnectionString;
using (var sqlCon = new SqlConnection(conStr))
{
sqlCon.Open();
using (var scCommand = new SqlCommand("Cstored",sqlCon))
{
scCommand.CommandType = CommandType.StoredProcedure;
scCommand.Parameters.Add("@dp1Mas", SqlDbType.Int).Value = TextBox3.Text;
scCommand.Parameters.Add("@dp2Emk", SqlDbType.Int).Value = TextBox4.Text;
scCommand.Parameters.Add("@dp3Tar", SqlDbType.Int).Value = TextBox5.Text;
scCommand.Parameters.Add("@dp4Gho", SqlDbType.Int).Value = TextBox6.Text;
scCommand.Parameters.Add("@dp5Etm", SqlDbType.Int).Value = TextBox7.Text;
scCommand.Parameters.Add("@dp6Cha", SqlDbType.Int).Value = TextBox8.Text;
scCommand.Parameters.Add("@dp7San", SqlDbType.Int).Value = TextBox9.Text;
scCommand.Parameters.Add("@dp8Eim", SqlDbType.Int).Value = TextBox10.Text;
scCommand.Parameters.Add("@GB", SqlDbType.VarChar).Value = CheckBoxList1.SelectedValue;
scCommand.Parameters.Add("@Start", SqlDbType.Int).Value = TextBox1.Text;
scCommand.Parameters.Add("@End", SqlDbType.Int).Value = TextBox2.Text;
using (SqlDataAdapter sda = new SqlDataAdapter(scCommand))
{
dt = new DataTable();
sda.Fill(dt);
GridView1.DataSource = dt;
GridView1.DataBind();
}
}
}
}