JS said:void GridView1_OnRowCreated(object sender, GridViewRowEventArgs e)
{
string connectionString = "ConnectionStrings:ConnectionString";
System.Data.SqlClient.SqlConnection sqlconnection = new System.Data.SqlClient.SqlConnection(connectionStri ng);
System.Data.SqlClient.SqlDataAdapter ad = new System.Data.SqlClient.SqlDataAdapter("SELECT * FROM [posters]", sqlconnection);
DataSet ds = new DataSet();
ad.Fill(ds);
return ds;
DataRow dr = ds.Tables[0].Rows[0];
Label blah = (Label)GridView1.FooterRow.FindControl("Label7");
blah.Text = dr["Units"].ToString();
}
jackybaby said:ive done that before abd it returns the error i had right from the begginning
DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'Units'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'Units'.
Source Error:
Line 14: </FooterTemplate>
Line 15: <ItemTemplate>
Line 16: <asp:Label ID="Label7" runat="server" Text='<%# Eval("Units") %>'></asp:Label>
Line 17: </ItemTemplate>
Line 18: </asp:TemplateField>
Source File: c:\Documents and Settings\jak\Desktop\JacksPosterShop\Basket.ascx Line: 16
Stelly said:you dont need Text='<%# Eval("Units") %>'