Wednesday, September 19, 2007

Choosing the right Firewall

I find there are quite a few people out there not too familiar with exactly what a firewall does or how to pick the best one for their situation.

Here's a nice link that talks on some points when choosing what kind of firewall to get.

Sunday, September 16, 2007

ASP.NET - Placeholder web control

One way to dynamically show data one by one in a list is through the use of a placeholder. As the name suggests it is a web control that contains other web controls.

You can dynamically add other controls to the placeholder whenever needed.

Monday, September 10, 2007

ASP.NET and MS SQL Server 2005 - Bit / Boolean Type

Ok, I'm not a hardcore programmer, so today I found something that was quite wierd to me at least.

Now I have MS SQL Server 2005 as my backend database. I created a simple type with a couple fields, one being of type "bit", which can hold the values of 1, 0, or null. Since there isn't any boolean type, then this is what should be used for true and false data.

Now, I am programming in ASP.NET which communicates with the database. I was trying to do a simple INSERT command into this table and for awhile I couldn't figure out why it wasn't writing into it.

For example my SQL statement in ASP.NET could be like this:
Ex1. INSERT table1 (x1, x2, y1, y2) VALUES ('hello', 'there', True, False);

Or say I have a couple radio buttons R1 and R2 somewhere:
Ex2. INSERT table1 (x1, x2, y1, y2) VALUES ('good', 'bye', R1.Checked, R2.Checked);

In SQL Server: x1 and x2 are nchar(10), y1 and y2 are bit

Both statements did not work. If I actual values like 1 or 0, those will work.
Ex3. INSERT table1 (x1, x2, y1, y2) VALUES ('good', 'bye', 1, 0);

The only way to get Ex1 and Ex2 to work is to put bound the True or False by single quotes like a string.
Ex4. INSERT table1 (x1, x2, y1, y2) VALUES ('hello', 'there', 'True', 'False');

To me that is very confusing. But that's how SQL Server takes it.

Dreamweaver - Centering Layouts

This is quite easy to do, but was hard to find out how. If you want your website to always be centered no matter what monitored is being used. Do the following:

1. Make a new table.
[Rows = 1, Columns = 1, Width = 100%, Cell Padding = 0, Cell Spacing = 0, Border = 0]

2. Check inside the table and set: Horizontal align to "center", Verticle align to "middle"

3. Now make another table of any size inside the one you just made and it will always be centered.

MS SQL - Reseting IDENTITY value

If you want to reset your identity field to a certain number, use the following statement:

DBCC CHECKIDENT ('tablename', RESEED, new identity value)

Saturday, September 8, 2007

Viewing .aspx pages in IIS 6 using ASP.NET

Ok, this was super annoying, and it showed me that I don't know jack shit about setting up ASP.NET on IIS to work properly.

The problem I was having was trying to connect to MS SQL Server 2005 using ASP.NET. This did not work as I was getting HTTP Error Code 403. This pretty much means that you lack the permission to access whatever you are trying to access. In this case, I had created an .aspx file that will access SQL Server.

So after fiddling around for like an hour I tried accessing .aspx files in IIS first. Sure enough, I got an error. This time a bit more specific. HTTP Error 403.1 - Forbidden: Execute access is denied. After another hour of searching for an answer as to why my pages won't display, I finally found the answer, which made me feel really stupid.

In anycase, ASP.NET pages are a scripting language, they run code in the background that "talks" to the backend servers. Now, by default, all websites created in IIS having the scripting permissions taken off for security purposes. Well, that's the problem right there. Turn this option on and you are set.

Go to "Properties" of the website in question, click on the "Home Directory" tab, and change the option "Execute permissions" to "Scripts only" or "Scripts and Executables".

What a waste of time! Definitely feel dumb today.

Monday, September 3, 2007

Rebuilding a Windows 2003 Server Domain Controller from scratch

I couldn't find any advice or help on this particular topic, even though I was pretty sure I knew how to do it. The task was to reinstall a domain controller with it being the only domain controller in the domain. Meaning that when it goes down, there will be no authentication between computers in the network.

The obvious way would be to install another DC so that it can be up while the other is down. But for this situation, another computer is out of the question. So the best way to do this is to completely remove the hard drive and put in a brand new one and install a fresh new version of the OS. After the OS has been installed and updated, perform a dcpromo and make all settings exactly the same as the old DC.

Adobe Flash - Nested communication

When working with Adobe Flash, communicating with various movie clips and swf files can be a pretty stressing.

For nested SWF files, it goes as follows:

1. First SWF (level 0) loads another SWF file into a different level using either loadMovie or loadMovieClip function.

2. The loaded SWF file can then refer to the first SWF by referring to it through "_level0"

For nested movie clips, _root, _parent, this, "instance name of movie clip" can all be used.

_root refers to main timeline
_parent refers to the calling movie clip