Saturday, December 27, 2008

Customize the SendTo Windows Extension in Vista

Start run, and this is the place...

%APPDATA%\Microsoft\Windows\SendTo

Router Madness - it's not that hard

So I recently signed up for Comcast, and I went out and bought a motorolla modem and a router.
The comcast tech support guy reminded me of a very basic troubleshooting step to get everything working.

1-Unplug both the router and the cable modem from the power.

2-Unplug all ethernet connections from both the router and the cable modem.

3-Plug the power back into the cable modem. Connect the internet cable back into the cable modem.

4-Plug in the router's power. Connect the cable modem to the router.

5-Start connecting each PC to the router. This allows the DCHP to give each PC a valid IP address and thus be able to get on the network.

Friday, December 19, 2008

C# Hello World Console

//Built using VS 2005, C# Console
// A simple hello world in C#


using System;
using System.Collections.Generic;
using System.Text;
namespace CSharpConsoleCodeTesting
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World"); // output text to the console.
Console.ReadLine(); // wait for user to hit enter to close console.
}
}
}

Left margins on controls in webpages

Sometimes, you want to place a left margin on a control on a webpage that is in flow layout.
Here is something that works nicely. Example....

style="margin-left: 20px"

I noticed that this style does not work inside the tr's and td's of a table.
I could be wrong though.

Selecting the column names of a sql table

Order defaults to alpha..

SELECT name FROM syscolumns WHERE id = (SELECT id FROM sysobjects WHERE name= 'MyTable')

Order set to column order..

SELECT name FROM syscolumns WHERE id = (SELECT id FROM sysobjects WHERE name= 'MyTable')ORDER by colorder

Selecting an item in an asp.net dropdownlist programmatically

myDropDownList.SelectedIndex = myDropDownList.Items.IndexOf(myDropDownList.Items.FindByValue(value))

It might even be easier to do this...

myDropDownList.Items.FindByValue(value).Selected = True

Reseting the increment id back to 1 in SQL

Let's say you have a summary table, and everynight you have either an executable or a sql job that deletes all rows and then inserts new ones. If that table has an increment id column, you may want to reset it back to 1. Here is how you do that. Just replace 'mytable' with the actuall table.

DBCC CHECKIDENT('mytable', RESEED, 0);