Wednesday, June 9, 2010

SQL Stored Procedures and ASP.net

This was suppose to be published last night but for some reason it wasn't...

Looking back, I think it is sort of silly how I put off learning how to use SQL parameters in my ASP.net Projects. It is so much easier than creating dynamic SQL statements in the vb.net code!

To create a dynamic SQL statement, you have to write the SQL statement and store it in a String variable. Then you have to replace the values with other variables in your vb.net and remember to include all the commas, quotations marks, etc that both vb.net and SQL needs to work. Some of my SQL statements can be quite complex and I usually have to spend some time figuring out where I'm missing the comma. Very frustrating.

However, with Stored Procedures and SQL Parameters, it splits up your long dynamic SQL statement into parts. This is so much easier to debug!

SQL Server Management Studio has a pretty good template for creating simple Stored Procedures. I managed to piece together the vb.net code from a few different sites I found via Google that I neglected to bookmark. I have my code to look back on, so I am not too worried.

My favorite page on the topic I found has to be one on the Microsoft site. It's a bit older but has some good tips on how to protect your database from SQL injection attacks.

I have implemented SQL Parameters in part of the Online Memberships Project and will fully test it out tomorrow morning. Now that I have gotten back on track, the project is going well. Still late, but it will be done!

Dogs in the Vineyard Character Creation

Monday night was Dogs in the Vineyard Character Creation. Two of my players had work/life emergencies come up and were not able to make character creation. Hopefully, they will both be at CastleHouse Games tonight, so we can get their character settled.

I putting a lot of focus on character creation for this game. I am planning on it being a long term campaign, so I want get an idea of what the players expect out of the game. It was a good thing I did, because there was an aspect of the setting that a few of the characters wanted to explore that I hadn't considered. Thus I am going to try to incorporate it into the game.

I created a "character questionnaire" for the players to fill out about the game. I was hoping it would give the players a chance to reflect quietly about their character and the game and put their ideas down on paper. Writing things down always helped me in my creative processes, so I curious to see if it would help my players.

I've seen questionnaires used before for LARPs, but I think it actually works out better for a smaller games. You really don't pay attention to all the answers if you have twenty questionnaires to read. Also, I think the questionnaire isn't as useful for players joining in game after it starts. The storyteller already has a plot going on and might not be able or willing to include many new elements.

But, I think I will have my players fill out a questionnaire after the first part of the game. I am curious about how their characters develop as time goes on.

One of my players, John, posted about character creation in his own blog.

Tuesday, June 8, 2010

Progress on the Membership Application

I made progress on the Membership Application this morning!

I managed to reclaim my source code by using a free program called Reflector by RedGate. This program de-compiles your .net classes.

So I made a copy of my old project and copied the updated code into it. I also copied the aspx page source from the published project and changed the page tag to include the code behind file and removed the compiled file from the inherits property.

Unfortunately, Reflector does not retrieve the cleanest code. Though it keeps the names of the methods and form control names, most of the variables are now "Item" or "Num". You also need to either import the VisualBasic Compiler Services or change the data type conversions in the class you copied over.

Since I only copied over the methods for my Form page, my project was now missing a lot of the back end code needed for form control events. I had to re-associate the form controls the event methods again. I was lazy and just double clicked on the form control and copied the code into the new method.

Now that my project is back to where it was at the end of May, I can move on. I am working on creating Stored Procedures in my test database to access as SQL parameters in my asp.net project.

I haven't used this technique before; my past projects have just used SQL, which leaves myself open to SQL injection attacks. None of those projects are live anymore, thankfully. But I am looking forward to learning something new!

Monday, June 7, 2010

My Project Plate

I’m done with school! Of course comes the question, “Now what?” I have decided to take a year to see where the winds of fate take me. But I need some sort of structure in my life. School use to provide that, but now that I am an adult *gasp* I need to learn how to do it on my own. Thus, this blog. I hope it will provide some accountability for my projects.

Membership Application (ASP.NET/vb.NET)
This is a work application that is about two weeks past its due date. I can give you a whole bunch of excuses why it is late, but the biggest one has to be my inability to code with constant interruptions. And of course, my somehow losing the source code. Luckily, I still have the compiled code and can bring it back.

SocialRoleplay.net (BuddyPress/php)
This is my personal project. A fellow roleplayer of mine is a WordPress Evangelist and infected me with the WordPress Fever. Of course, this site will be based more on BuddyPress, which is a social networking wordpress plugin. I won't post too many details about this project until I get the beta up and running.

Nwarpg.org (phpBB/Wordpress)
I was recently made admin on the NWARPG forums, a local organization of gamers based in Northwest Arkansas. I have been slowly installing new functionality to the forums and hope to move the index page of the site over to word press.

Dogs in the Vineyard Game (RPG)
This isn’t a programming project, but a RPG game I am running. This is my second attempt at running a long term campaign. Now that I am more experienced, I hope it will succeed.

Reading more Non-Fiction
I love reading non-fiction, especially biology and sociology books. Unfortunately, I don’t get to read enough of them. Thus I am making use of my local library again and checking out books.

Studying for GMAT
Not so sure about this because I am no longer sure I want to get my PHD. Well, I still want to get my PHD, but I am not willing to put myself into debt for it. I am horribly scared of debt and have student loans from my Masters Degree to pay off.

*Smacks Blogger*

So I am jumping on the bandwagon and re-purposing my blog for just about anything. I was supposed to be a photo blog, but it is much easier to post photos on Facebook/Flickr.

At first I thought about installing WordPress on my web hosting account but decided to just reuse this blog. I am lazy and don’t want to mess with WordPress for my personal blog. I don’t expect to make money off of it or have a wide audience. I also want to be able to post from my iGoogle page (see? Lazy!).

However, Blogger was having issues. You can set up the changes you want, but it won’t let you apply them. I finally managed to get my main google account added but was unable to redo my blog template.

So blah on you blogger! I will wait until tomorrow to get your act together and then I will go and install WordPress on my own web host!

Got it to work!

Finally got blogger added to my google account!