Allen Buckley's Blog

August 2006 Entries

Recycle Bin fixed Read-Only Error on Sql-Express DB

Yesterday, I was trying to hook my Asp.Net 2.0 website up to IIS.  The problem I was having though is that my Update commands would give me read-only errors.  I checked the permissions to make sure the .MDF and the .LOG files had the correct permissions.  I then checked to make sure that the read-only checkbox was unchecked and it was for both files.  So I googled the problem and tried multiple solutions and nothing fixed the error.  Finally, I tried to delete the .LOG file (I had a backup) to see if that would fix the problem and I received an error from not having the .LOG file.  So I decided to take the .LOG file out of the Recycle Bin and put it back into the APP_DATA and then ran the solution to see if the Recycle Bin effected any of the permissions and sure enough problem solved.  I have no idea how exactly the Recycle Bin fixed the .LOG file, but if anyone has an idea I'm curious to know?

Two Books I’m Reading

Recently, I added two books to my collection.  The two books are Programming Role Playing Games with DirectX and Pro C# 2005 and the .Net 2.0 Framework.

 

 

Programming Role Playing Games has really helped out a beginner like me when it comes to programming video games.  This book walks you through just about every area of creating a role playing game from writing the story to designing a simple game.  As a novice this book has been a great resource for me.  The one drawback for me is that this book has been out for a while so it uses DirectX 8 while I am trying to learn how to make games with DirectX 9. At times I have to look up the corresponding code from the book in DirectX 9, but I’m at least learning what that specific chunk of code is doing.  So my official review:  This book rocks!

 

Pro C# 2005 and the .Net 2.0 Framework is a great book for experienced .Net programmers.  This book is great to use as a reference at work when you are trying to find a way to incorporate generics in to your code or learn about a Namespace like System. Reflection.  In no way was this book meant for programmers who are just starting out in C#.  Pro C# 2005 and the .Net 2.0 Framework has been the best .Net book I’ve found so far when it comes to content.  The author crams about as much as you possibly can of C# in this book.  My official review:  If you’re a good C# programmer then this book is worth getting!

Replace text area in DetailsView with a DDL

This inline code is used to insert a dropdownlist into a datagrid/detailsview control in place of a given text area when using the InsertItemTemplate.  The reason for doing this is to force the user to submit a answer out of options you choose to give, rather then letting them enter an open ended answer which you might not need or want.

The BoundField is Title.

<asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" />


InsertItemTemplate

<InsertItemTemplate>
<
asp:DropDownList ID="DropDownList1" runat="server" SelectedValue='<%# Request.Querystring("testid") %>'  DataSourceID="SqlDataSource2" DataTextField="Title" DataValueField="QuizID">

</
asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:quizConnectionString %>"SelectCommand="SELECT [Title], [QuizID] FROM [Quiz]">
</asp:SqlDataSource>
</InsertItemTemplate>