sql
SQL Server 2008 Installation
Today I had the task of installing SQL Server 2008 on some new Windows Server 2008 Boxes. At first things seemed to go fine, installing updates here and there, but when it came to installing SQL Server there seemed to be a problem:
System Configuration Checker had this error:
Windows Server 2008 is supposed to come with PowerShell, why would this server not have it? It turns out that Windows Server 2008 has PowerShell built-in, but it's not installed yet (at least not for me).
This is what i had to do to get it working:
The next snag was caused by us not having a good enough password set, fixed by using a better password.
Here is the next error:
After these small issues installation went fine and everything is now working.
Asp.net Nested Repeater with Linq2sql
Using nested repeaters with Linq2Sql is very easy as it turns out.
Here is a short example of how it can be done.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | <asp:Repeater runat="server" ID="rptCategories"> <HeaderTemplate> <dl> </HeaderTemplate> <ItemTemplate> <dt> <strong><%# Eval("CategoryName") %></strong> </dt> <asp:Repeater runat="server" DataSource='<%# Eval("Products") %>'> <ItemTemplate> <dd> <%# Eval("ProductName") %> </dd> </ItemTemplate> </asp:Repeater> </ItemTemplate> <FooterTemplate> </dl> </FooterTemplate> </asp:Repeater> |
Then in the codebehind somewhere we have to get our data.
For this example I used the Northwind Database.
1 2 3 4 5 6 7 8 9 | NorthwindDataContext dc = new NorthwindDataContext(); var data = (from c in dc.Categories select new { CategoryName = c.CategoryName, Products = c.Products }); rptCategories.DataSource = data; rptCategories.DataBind(); |
Here are the results, as you can see the categories are listed out with the products listed under them.
This concludes the post on nested repeaters.