Yes, the version numbers match (1.0.2004.1).
This morning I loaded the solution, and this message appears in the task list:
The key 'Main.ConnectionString' does not exist in the appSettings configuration section.
VS is so odd at times. How would it know to generate a message like this? Why didn't it show this message yesterday? Why is it showing it now when I haven't even compiled anything? Weirdest of all is that this string is in my web.config file and of course app.config in the DAL project. Anyway, don't know if this has anything to do with my problem.
I do a rebuild solution, and the build succeeds, though this message stays in the task list. Then I run it, and again the grid doesn't show up.
Here's the complete code behind the form:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using MetaBuilders.WebControls;
using SD.LLBLGen.Pro.ORMSupportClasses;
using Newmont.DAL;
namespace Newmont
{
/// <summary>
/// Summary description for Departments.
/// </summary>
public class Departments : System.Web.UI.Page
{
protected System.Web.UI.WebControls.DataGrid DepartmentList;
protected System.Web.UI.WebControls.Button Add;
protected System.Web.UI.WebControls.Button Edit;
protected System.Web.UI.WebControls.Button Delete;
protected Newmont.DAL.CollectionClasses.DepartmentsCollection departmentsCollection1;
protected System.Web.UI.HtmlControls.HtmlInputHidden ClientMessage;
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Departments));
this.departmentsCollection1 = new Newmont.DAL.CollectionClasses.DepartmentsCollection();
//
// departmentsCollection1
//
this.departmentsCollection1.AllowEdit = false;
this.departmentsCollection1.AllowNew = true;
this.departmentsCollection1.AllowRemove = false;
this.departmentsCollection1.EntityFactoryToUse = ((SD.LLBLGen.Pro.ORMSupportClasses.IEntityFactory)(resources.GetObject("departmentsCollection1.EntityFactoryToUse")));
this.departmentsCollection1.MaxNumberOfItemsToReturn = ((long)(0));
this.departmentsCollection1.SortClauses = null;
this.departmentsCollection1.SupportsSorting = false;
this.departmentsCollection1.SuppressClearInGetMulti = false;
this.departmentsCollection1.Transaction = null;
this.departmentsCollection1.ValidatorToUse = null;
this.Load += new System.EventHandler(this.Page_Load);
this.departmentsCollection1.GetMulti(null);
}
#endregion
}
}
And here's the grid HTML
<asp:datagrid id=DepartmentList style="Z-INDEX: 101; LEFT: 16px; POSITION: absolute; TOP: 16px" runat="server" BorderWidth="1px" BorderStyle="None" Height="374px" AllowPaging="True" BackColor="White" Width="375px" AutoGenerateColumns="False" PageSize="16" BorderColor="#3366CC" CellPadding="4" DataSource="<%# departmentsCollection1 %>" DataKeyField="DepartmentID">
<FooterStyle ForeColor="#003399" BackColor="#99CCCC"></FooterStyle>
<SelectedItemStyle Font-Bold="True" ForeColor="#CCFF99" BackColor="#009999"></SelectedItemStyle>
<AlternatingItemStyle Font-Size="12px" Font-Names="Arial"></AlternatingItemStyle>
<ItemStyle Font-Size="12px" Font-Names="Arial" ForeColor="#003399" BackColor="White"></ItemStyle>
<HeaderStyle Font-Size="12px" Font-Names="Arial" Font-Bold="True" ForeColor="#CCCCFF" BackColor="#003399"></HeaderStyle>
<Columns>
<mbrsc:RowSelectorColumn HeaderText="Sel" SelectionMode="Single">
<HeaderStyle Width="20px"></HeaderStyle>
</mbrsc:RowSelectorColumn>
<asp:BoundColumn DataField="DepartmentID" HeaderText="ID">
<HeaderStyle Width="50px"></HeaderStyle>
</asp:BoundColumn>
<asp:BoundColumn DataField="Department" HeaderText="Department">
<HeaderStyle Width="250px"></HeaderStyle>
</asp:BoundColumn>
</Columns>
<PagerStyle Visible="False" HorizontalAlign="Left" ForeColor="#003399" BackColor="#99CCCC" Mode="NumericPages"></PagerStyle>
</asp:datagrid>