Blog Archives

IIS6 Change Framework Version without restart of W3SVC service

browse to the location of the folder containing the version of asp_net regiis such as:
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319

run aspnet_regiis -lk to get the virtual path you will need in the next command. to see which ID matches your website launch IIS manager and under websites you will see a column called “identifier”.

run the command:
aspnet_regiis.exe -norestart -s “W3SVC\1398789133”

done.

IBM RSA rational software architect eclipse plugin rename change project location

This one evaded me at first and is very simple. Experienced Eclipse users are already familiar with its’ small intricacies, but for a Microsoft Visual Studio Developer who is not on Eclipse often, it is easy to forget your way weaving through the maze of perspectives, windows and views.

Lets say you created a new model, and accidentally placed it in the wrong location.

I’ve used Eclipse quite a bit in the past with PHP, so my first thought was to simply “refactor”/”move”. However, this would not solve my problem.

The resolution is quite simple. First, right click on the project, close it, then delete it.

After deleting. Select file->import->existing projects into workspace->(next).

Browse to the new root location and then continue through (finish).

That’s it! Hope this helped! 8)

change last row cell style in css and javascript cross browser compatibility issues

There are various approaches to achieve this functionality with equally different levels of compatibility across browsers. Here are some of the ways.

Javascript Approach (most compatible. you may recognize this code from another one of my articles.):

function ChangeTableCellStyle(tableid,cellnumber,mystyle) {
if (document.getElementById)
{
var selectedElement = document.getElementById(tableid);
selectedElement.className = style;
//change style on end cell by drilling into table. this will eventually become completely replaced by css3
if (selectedElement.tagName.toLowerCase()=="table")
{
var tbody = selectedElement.lastChild;
if (tbody!=null)
{
if (tr.nodeType!=1) {
tr.tbody.getElementsByTagName("td");
tr[cellnumber].className+= ' ' + mystyle;
} } } } }

HTML col tags and hardcoded inline style overrides (easy, but messy IMO. also definitely not a good approach for styling lots of similar looking pages)

<table>
<col style="background-color: #6374AB; color: #ffffff" />
<col span="2" style="background-color: #07B133; color: #ffffff;" />
<tr>

<td style="background-color: #000000">First TD of first TR</td>
[... etc ...]
<tr style="background-color: #6374AB;"> // second TR

CSS3 last child (super clean and awesome but unfortunately not well supported by browsers)

p:last-child {
  ⋮ declarations
}

jQuery Approach (this also has good compatibility and much cleaner than your own JS function, but requires an external jquery library reference which may be overkill unless you’re already using it):

$(document).ready(function() {
    $('table.class tr:last-child').addClass('ClassName'); //can also speciy firstchild etc
});

Some of the snippets above are quoted snippets directly from references below. See the reference links for more information on a specific approach.

As the above examples have illustrated there are many ways to achieve what you need each varying depending on your implementation. Hope this article helped! Enjoy.

References
CSS fixed table approachhttp://stackoverflow.com/questions/359821/styling-the-last-td-in-a-table-with-css
HTML col tags approach, http://www.quirksmode.org/css/columns.html
css3 approach, http://reference.sitepoint.com/css/pseudoclass-lastchild
jQuery approach, http://stackoverflow.com/questions/5850835/jquery-selector-to-last-row-first-column

Change default MSSQL Port and Connect

Changing default port of Microsoft SQL Server differs depending on the version. The following is for the latest version of MSSQL only.

If you’re using 2005, the steps are similar to those below, but the area you need to go is the SQL surface area configuration instead.

If you’re using 2000, it’s time to upgrade. 2000 is pretty out of date. We’ll probably be looking at something newer than SQL 2008 before long.

MSSQL 2008:
1) Goto: SQL Server Configuration Manager > SQL Server Services > (right click on your server instance) > Stop

2) Goto: SQL Server Configuration Manager > SQL Server Network Configuration > Protocols for [Instance Name] > Right click TCP/IP (make sure it’s enabled) > IP Addresses Tab

3) Once you’re at this tab find the IP that corresponds to the address of your network adapter that is connected to the router (IP1 in my case though on servers this could easily be variable).

4) Remove 0 from “TCP Dynamic Ports” and set the “TCP Port” field to the number you want (default is 1433). If you scroll to the bottom you will also note there is an “IPAll” which I also did the same for.

5) Change any firewall rules that may block the connection (add a new port in Windows firewall).

6) Restart service instance. (step 1)

Some blogs and articles I came across mention starting the SQL Server Browser, however, I would like to mention that although you should have this service running for a couple reasons, the above configuration works without the browser and doesn’t technically need it to connect remotely if you know exactly which port you’re connecting to.

To connect remotely on different port make sure TCP/IP is enabled for the server instance in configuration manager, and in management studio or your application connection string specify:
servername,portnumber\instancename

Note that a different port number is specified using a comma, not a : like you may have expected.

References
Microsoft KB, http://support.microsoft.com/kb/914277
SQLServerPedia, http://sqlserverpedia.com/blog/sql-server-tutorial/how-do-i-change-a-sql-port-number/

Reset Password from Command Prompt in Server 2008

For a developer or IT admin working in Windows Server 2008 environment, you may have noticed ctrl+alt+del does not work over remote connection and you can no longer change your password from control panel.

The best solution to this in my opinion, that will likely work far into the future, is the command line.

Also keep in mind you are a server admin and disable much functionality for your remote users, sometimes these permissions don’t always apply to command line variants and the latter can be used for privilege escalation in the event of a workstation or user profile compromise.

net user user_name * /domain

net user user_name  new_password

ex.
net user Bob 12bdir5$

References
Microsoft Support, “How to Change User Password at Command Prompt”,