Thursday, September 30, 2010

Import / Using Directive for no code behind

<%@ Import Namespace="System.Configuration" %>

Friday, September 24, 2010

Random FN and Data Generator

CREATE TABLE jk_RecoveryTest (
ident INT IDENTITY (1, 1)
, cInt INT DEFAULT 0
, cFloat FLOAT DEFAULT 0
, cDatetime DATETIME DEFAULT GETDATE()
, cChar CHAR (4)
, cVarChar VARCHAR (128)
, cVarCharMax VARCHAR (MAX)
, cStart DATETIME DEFAULT GETDATE()
, cEnd DATETIME DEFAULT GETDATE()
, iteration INT DEFAULT 0
, uDate DATETIME DEFAULT GETDATE()
, crDate DATETIME DEFAULT GETDATE()
)

GO

CREATE TABLE jk_RecoveryStats (
cVarChar VARCHAR (1023)
, cStart DATETIME DEFAULT GETDATE()
, cEnd DATETIME DEFAULT GETDATE()
, iteration INT DEFAULT 0
, uDate DATETIME DEFAULT GETDATE()
, crDate DATETIME DEFAULT GETDATE()
)

GO

CREATE VIEW dbo.vRandNumber
AS
SELECT RAND() RandNumber

GO

CREATE FUNCTION RandNumber()
RETURNS float
AS
BEGIN
RETURN (SELECT RandNumber
FROM dbo.vRandNumber)
END

GO

CREATE FUNCTION RandNumberRng(@Min int, @Max int)
RETURNS float
AS
BEGIN
RETURN @Min
+ ( SELECT RandNumber
FROM dbo.vRandNumber)
* (@Max-@Min)
END




TRUNCATE TABLE jk_RecoveryTest

TRUNCATE TABLE jk_RecoveryStats

-- SELECT * FROM jk_RecoveryTest

SET NOCOUNT ON

DECLARE @iter INT = 1
, @outerIter INT = 1
, @stop INT = 10000--0
, @outerStop INT = 10--00 0
, @tDate DATETIME = GETDATE()
, @tString VARCHAR (128) = 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwx'
, @tInt INT = 0

WHILE (@outerIter <= @outerStop)
BEGIN

WHILE (@iter <= @stop)
BEGIN

INSERT jk_RecoveryTest (
cInt
, cFloat
, cDatetime
, cChar
, cVarChar
, cVarCharMax
, cStart
, cEnd
, iteration
)
SELECT
CAST(dbo.RandNumberRng (0, 9) AS INT)
, dbo.RandNumberRng (0, 9)
, DATEADD(dd, dbo.RandNumberRng (0, 28), @tDate)
, LEFT (@tString, dbo.RandNumberRng (0, 4))
, LEFT (@tString, dbo.RandNumberRng (0, 128))
, LEFT (@tString, dbo.RandNumberRng (0, 128))
, @tDate
, @tDate
, @iter

SET @iter += 1
END

--SELECT 'Inserts'
--, DATEDIFF (ss, @tDate, GETDATE())
--, DATEDIFF (ms, @tDate, GETDATE()) % 1000
--SET @tDate = GETDATE()

SET @iter = 1

WHILE (@iter <= @stop)
BEGIN

SELECT @tInt = AVG(cFloat)
-- SELECT AVG(cFloat)
FROM jk_RecoveryTest
WHERE cInt % @iter = 2

SET @iter += 1

END

--SELECT 'Seeks'
--, DATEDIFF (ss, @tDate, GETDATE())
--, DATEDIFF (ms, @tDate, GETDATE()) % 1000

--INSERT jk_RecoveryStats (
-- cVarChar
-- , cStart
-- , cEnd
-- , iteration
-- )
--SELECT
-- 'FULL - Seeks'
-- , @tDate
-- , GETDATE()
-- , @outerIter

--SET @tDate = GETDATE()

SET @iter = 1

WHILE (@iter <= @stop)
BEGIN

UPDATE jk_RecoveryTest
SET cInt = dbo.RandNumberRng (0, @iter)
WHERE ident = @iter

SET @iter += 1

END

--SELECT 'Updates'
--, DATEDIFF (ss, @tDate, GETDATE())
--, DATEDIFF (ms, @tDate, GETDATE()) % 1000

--INSERT jk_RecoveryStats (
-- cVarChar
-- , cStart
-- , cEnd
-- , iteration
-- )
--SELECT
-- 'FULL - Updates'
-- , @tDate
-- , GETDATE()
-- , @outerIter

--SET @tDate = GETDATE()

SET @iter = 1

WHILE (@iter <= @stop)
BEGIN

DELETE
FROM jk_RecoveryTest
WHERE ident = @iter

SET @iter += 1

END

--SELECT 'Deletes'
--, DATEDIFF (ss, @tDate, GETDATE())
--, DATEDIFF (ms, @tDate, GETDATE()) % 1000

INSERT jk_RecoveryStats (
cVarChar
, cStart
, cEnd
, cDiff
, iteration
)
SELECT
-- 'FULL - Deletes'
'FULL'
, @tDate
, GETDATE()
, DATEDIFF (ms, @tDate, GETDATE())
, @outerIter

SET @tDate = GETDATE()

SET @iter = 1

SET @outerIter += 1

END


SELECT cVarChar, AVG(cDiff)
FROM jk_RecoveryStats
GROUP BY cVarChar

DB Info

exec sp_helpdb

Thursday, September 23, 2010

Where Are the Constraints?

SELECT
CAST (DATEPART(yyyy, so.crdate) AS VARCHAR) + ' - '
+ CAST (DATEPART(mm, so.crdate) AS VARCHAR) + ' - '
+ CAST( DATEPART(dd, so.crdate) AS VARCHAR) so_crdate
, su.name so_schema
, so.name so_name
, scc.name sc_name
, sct.text sct_constraint
FROM sysobjects so
JOIN syscolumns scc
ON so.id = scc.id
LEFT OUTER JOIN sysusers su
ON so.uid = su.uid
LEFT OUTER JOIN sysconstraints sc
ON so.id = sc.id
AND scc.colid = sc.colid
LEFT OUTER JOIN syscomments sct
ON sc.constid = sct.id
WHERE so.type = 'U'
AND so.crdate > '2010-07-09'
AND so.name NOT LIKE '%bak%'
AND so.name NOT LIKE '%junk%'
AND so.name NOT LIKE '%sav%'
AND su.name = 'dbo'
AND sct.text IS NOT NULL
ORDER BY
so.crdate
, so.name
, scc.name DESC

Wednesday, September 22, 2010

Add Default Value to Existing Column

ALTER TABLE zeroTest WITH NOCHECK
ADD CONSTRAINT DF_Zero DEFAULT 0 FOR c

Thursday, July 29, 2010

Remove Items in a Select Box, IE compliant

function showAllDates() {

var findSel = new Object();
findSel = document.getElementById("idHAllDates")

if (findSel) {
if (findSel.value != 1){
RemoveDates();
}
}
else {
// default
RemoveDates();
}
}

function RemoveDates(){
var nowDate = new Date();
var nowDate2 = new Date(nowDate.getYear(), nowDate.getMonth(), nowDate.getDate());
var findSel = document.getElementById("idSelPEDate");
var tempString = "";

if (findSel)
{

// This does not work in IE
// for (var i = 1; i < findSel.options.length; i++) {

// leave the first option empty
for (var i = findSel.options.length - 1; i >=1; i--) {

// yy/mm/dd : input is in the form of mm/dd/yy
tempString = findSel.options[i].value;
tempString = tempString.substring(0, 2) + "/"
+ tempString.substring(3, 5) + "/"
+ "20" + tempString.substring(6, 8);

var compDate = new Date(tempString);
// alert(nowDate2 + " " + compDate + " " + tempString + " " + findSel.options[i].value);

if (compDate > nowDate2){
alert("bigger: " + compDate);
findSel.remove(i);
}
}
}
}

Thursday, July 15, 2010

ctrl home opens find and replace

[tools] [options] [general] - turn off the "Navigation for Word Perfect users" checkbox

Wednesday, July 14, 2010

Explorer.exe Customization

Target: %SystemRoot%\explorer.exe /n, /e, /select, D:\Temp\Joe\Code\

Start in: %HOMEDRIVE%%HOMEPATH%

Tuesday, July 13, 2010

Space of All Tables In DB

EXEC sp_MSforeachtable @command1="EXEC sp_spaceused '?'"

ASP and .Net BE DLLs Interop

Check out, optionally version #.

If changing #, change # for namespace, assembly and default namespace.

Build

Copy to [server] C:\Web_DSS_Files\DLLs>

Put in GAC
C:\Web_DSS_Files\DLLs>gacutil /if PMMaccr09.dll

Register for COM Interop
C:\Web_DSS_Files\DLLs>regasm PMMaccr09.dll /tlb:PMMaccr09.dll

Test

Thursday, July 8, 2010

Debugging Classic ASP With Visual Studio 2008 SP1 and 3.5 Framework

http://blogs.bitwizards.com/Kevin_Grohoske/post/2009/04/30/Debugging-Classic-ASP-With-Visual-Studio-2008-SP1-and-35-Framework.aspx


Thursday, April 30, 2009 06:22 | posted by: kevin

As much as I’d like never to debug complicated classic ASP code again, the fact is it’s everywhere in the enterprise today. Here is one way that I have found to speed up the process of supporting classic ASP w/ VS 2008 SP1/3.5.

At the last User Group meeting, I presented the features in the VS08 SP1 and 3.5 Framework. One topic/feature was only lightly covered in the documentation, but really jumped out at me, was that with Visual Studio 2008 SP 1 and 3.5 Framework VS 2008 can debug classic ASP code (script). I tried to find more information online, but the details were hard to find.So after a bit of research and trial and error I am sharing what I learned with you!

Here’s How:

1. Allow Server Side Debugging inside IIS Manager for the web site.

IIS Manager Settings

2. Open the Web Site in VS 2008 IDE by File - Open - Web Site and browsing to the directory that the IIS’s web is pointed to.

Open Web Site

3. Accept FrameworkUpgrade Warning (if prompted).

Framework Upgrade Warning

4. Configure Web Site Startup Properties to open correct website through IIS url (http://localhost/…)

Web Site Properties

5. Run Web Site in Debug Mode (F5) and accept Web.Config warning.

Allow .NET Debugging

6. In VS 2008 IDE Debug Menu select Attach To Process and choose the dllhost.exe process

Attach to dllhost.exe process

7. Begin Debugging By Setting Breakpoints in the IDE.

Visual Studio 2008 Debugging

That’s is !!! Ok so what changes were made to the original process?

When you exit the it VS 08 will prompt you to save a solution file.

And… A web.config for the .NET Debugger will be created in the root of the web. You should remove it when you deploy to production.

IIS Log and Last Stop - Restart

Log:

IIS - Site properties - Web Site - Log Properties
C:\WINDOWS\system32\LogFiles nad then the specific site file name w3svcxyz\abc.log

Last Stop - Restart

Event Viewer - System - Filter for IISCTLS

Last Time Server Was Rebooted

net statistics server

Wednesday, July 7, 2010

Command Line Process and IIS Tips

http://todotnet.com/post/2006/07/02/TipTrick-List-Running-ASPNET-Worker-Processes-and-KillRestart-them-from-the-command-line-a-better-way.aspx

Recycle Ap Pool and others ...

Tip/Trick: List Running ASP.NET Worker Processes and Kill/Restart them from the command-line [a better way]
by Sander Gerz July 02, 2006 19:37

Scott Guthrie posts a trick on a quick way to kill a process on your system, or kill and restart an ASP.NET or IIS worker process. I tried to post a comment on his trick, but the commenting system is not working. So I'll give my opinion here, leaving me with a bit more room to elaborate.

Scott's suggesting that you use taskkill to kill a process running the application pool. That's all nice and neat, but how do you know what process to kill? If you have multiple application pools, you might just kill the wrong one. A much better solution is to use the little known iisapp command. In fact, iisapp is a vb-script located in %winnt%\system32. Run it from the command prompt without parameters, and you get a list of application pools with their associated process ids.

C:\WINDOWS\system32>iisapp
W3WP.exe PID: 3328 AppPoolId: DefaultAppPool
W3WP.exe PID: 232 AppPoolId: AppPool ASPNET2.0

The command IIsApp /a DefaultAppPool /r will recycle the specified application pool. Not only is this a lot easier, it's less error prone, thus safer to use. What if you kill the wrong process? I.e. by mistyping or by the fact that after you listed your processes, the application pool has recycled already.

There are a few other commands that few are aware of. E.g.

issweb /query

This will give you a list of configured websites, their status, port number and hostheader. You can also use iisweb to create, pause, stop, start and delete websites. iisvdir will do something similar for virtual folders.

With iisback you can backup and restore the IIS configuration. In fact, if you do a listing of .vbs-files from within %winnt%\system32 you may find some other hidden gems.

Hope this helps... too.

Sander

Find Process Locking DLL

http://blogs.msdn.com/b/winclient/archive/2004/07/08/177947.aspx

tasklist /m thelocked.dll

Thursday, July 1, 2010

Register DLL's - Old School

C:\WINNT\system32>regsvr32 dss270_new.dll

Friday, May 21, 2010

Merge - Upsert

MERGE INTO mergeD AS d
USING mergeS AS s
ON s.a = d.a
WHEN matched THEN
UPDATE SET d.achar = s.achar
WHEN NOT MATCHED THEN
INSERT (achar) VALUES (achar);

Quick Find Tables w/ Column Name Like

-- Utility: Quick Find Tables w/ Column Name Like
SELECT
'SELECT * FROM '
, t.TABLE_NAME
, 'WHERE Username LIKE ''kellyjo%'''
, ' -- '
, c.COLUMN_NAME
FROM INFORMATION_SCHEMA.TABLES AS t
JOIN INFORMATION_SCHEMA.COLUMNS AS c
ON t.TABLE_CATALOG = c.TABLE_CATALOG
AND t.TABLE_SCHEMA = c.TABLE_SCHEMA
AND t.TABLE_NAME = c.TABLE_NAME
WHERE t.TABLE_TYPE = 'BASE TABLE'
AND t.TABLE_CATALOG = 'foo'
AND c.COLUMN_NAME LIKE '%bar%'

Tuesday, May 18, 2010

Pre and Post pend Text to String

Sub preNPost()

' pre and post pend text to a line

Dim StartLine, EndLine, CurrentLine

StartLine = DTE.ActiveDocument.Selection.TopLine
DTE.ActiveDocument.Selection.EndOfDocument(True)
EndLine = DTE.ActiveDocument.Selection.BottomLine
DTE.ActiveDocument.Selection.StartOfDocument()
CurrentLine = DTE.ActiveDocument.Selection.CurrentLine

While (CurrentLine < EndLine)

DTE.ActiveDocument.Selection.StartOfLine(vsStartOfLineOptions.vsStartOfLineOptionsFirstText)
DTE.ActiveDocument.Selection.Text = "+ zzzz "
DTE.ActiveDocument.Selection.EndOfLine()
DTE.ActiveDocument.Selection.Text = " yyyy"
DTE.ActiveDocument.Selection.LineDown()
CurrentLine = DTE.ActiveDocument.Selection.CurrentLine

End While

End Sub

Friday, May 14, 2010

ASP 0131 Disallowed Parent Path

http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q226/4/74.asp&NoWebContent=1


When you use relative paths in include statements with Microsoft Active Server Pages (ASP), browsing a Web page may return an error message similar to the following:
Active Server Pages, ASP 0131
Disallowed Parent Path
The Include file '../' cannot contain '..' to indicate the parent directory.
//, line
Back to the top
CAUSE
This is caused by disabling ASP's "parent paths" for a Web site or application...
This is caused by disabling ASP's "parent paths" for a Web site or application while using relative parent paths in an include statement.

Relative parent paths in include statements use the following form:




Back to the top
RESOLUTION
The best solution to the problem is to use absolute virtual paths from the root...
The best solution to the problem is to use absolute virtual paths from the root of the Web site instead of relative paths.

For example, if you use an include file named "mycode.inc" at the root of your server, the virtual path would be "/mycode.inc." If you use the same include file in a virtual directory named "/includes" on your server, the virtual path would be "/includes/mycode.inc."

The syntax example below illustrates how to implement virtual paths:





An alternative to using absolute virtual paths is to enable parent paths; however, this is not the preferred method. (See the notes in the More Information section for details.) This is accomplished for your default Web site by using the following steps:
Back to the top
Internet Information Services 7.0

1. Start Internet Services Manager.
2. Click Default Web Site, and then click Properties.
3. Double-click ASP in the Features pane.
4. Expand Behavior.
5. Click Enable Parent Paths.
6. Click True for Enable Parent Paths.
7. Click Apply.

Back to the top
Internet Information Services 6.0

1. Open the Internet Services Manager in the Microsoft Management Console (MMC).
2. Right-click on your Default Web Site and select Properties.
3. Click the Home Directory tab.
4. Click the Configuration button.
5. Click the App Options tab.
6. Click to select the Enable Parent Paths checkbox.
7. Click the OK button until you return to the MMC.

Back to the top

Utility: Quick Find Tables w/ Column Name Like

SELECT
'SELECT * FROM '
, t.TABLE_NAME
, 'WHERE Username LIKE ''kellyjo%'''
, ' -- '
, c.COLUMN_NAME
FROM INFORMATION_SCHEMA.TABLES AS t
JOIN INFORMATION_SCHEMA.COLUMNS AS c
ON t.TABLE_CATALOG = c.TABLE_CATALOG
AND t.TABLE_SCHEMA = c.TABLE_SCHEMA
AND t.TABLE_NAME = c.TABLE_NAME
WHERE t.TABLE_TYPE = 'BASE TABLE'
AND t.TABLE_CATALOG = 'Budget'
AND c.COLUMN_NAME LIKE '%user%'

Wednesday, May 12, 2010

How to Find the Process ID for the IIS Ap Pool

C:\WINDOWS\system32>cscript.exe iisapp.vbs

Note that if the process is not hosting any threads (or instances of a site) at that moment then will/may not show.

Debug Process to Attatch to

Particularly useful when traipsing through (inherited) project-less sites with embedded C# (no code-behind)...

For remote debugging of managed code

aspnet_wp.exe - XP

w3pw.exe - Vista / 2k3+

(Note that msvsmon.exe must be running on remote machine)

And for the JS attach to the client process (say IE) (especially when you cannot use something like FireBug because corp. only wants to support IE).

Friday, May 7, 2010

SQL Server 2008 Linked Servers

2005
http://www.sqlmusings.com/2009/03/11/resolving-a-network-related-or-instance-specific-error-occurred-while-establishing-a-connection-to-sql-server/

2008
http://mssqltips.com/tip.asp?tip=1673

Linked Server

EXEC sp_addlinkedserver
'J9gfrb101',
N'SQL Server'

Schema Syntax

SELECT COUNT (*)

FROM INFORMATION_SCHEMA.TABLES AS t

WHERE t.TABLE_TYPE = 'BASE TABLE'

AND t.TABLE_CATALOG = 'foo'

Thursday, May 6, 2010

DIR All

DIR /S - all files w/ subs, grouped

DIR /S /B - all files w/ subs, listed

Tuesday, May 4, 2010

MSC Commands from the Command Line i.e. AD Users

Thanks to Mitch Tulloch www.mtit.com/mitch/ and his link to :

http://www.windowsnetworking.com/kbase/WindowsTips/Windows2003/AdminTips/Admin/LaunchAdminToolsfromtheCommandLine.html

AD Domains and Trusts
domain.msc

Active Directory Management
admgmt.msc

AD Sites and Serrvices
dssite.msc

AD Users and COmputers
dsa.msc

ADSI Edit
adsiedit.msc

Authorization manager
azman.msc

Certification Authority Management
certsrv.msc

Certificate Templates
certtmpl.msc

Cluster Administrator
cluadmin.exe

Computer Management
compmgmt.msc

Component Services
comexp.msc

Configure Your Server
cys.exe

Device Manager
devmgmt.msc

DHCP Managment
dhcpmgmt.msc

Disk Defragmenter
dfrg.msc

Disk Manager
diskmgmt.msc

Distributed File System
dfsgui.msc

DNS Managment
dnsmgmt.msc

Event Viewer
eventvwr.msc

Indexing Service Management
ciadv.msc

IP Address Manage
ipaddrmgmt.msc

Licensing Manager
llsmgr.exe

Local Certificates Management
certmgr.msc

Local Group Policy Editor
gpedit.msc

Local Security Settings Manager
secpol.msc

Local Users and Groups Manager
lusrmgr.msc

Network Load balancing
nlbmgr.exe

Performance Montior
perfmon.msc

PKI Viewer
pkiview.msc

Public Key Managment
pkmgmt.msc

QoS Control Management
acssnap.msc

Remote Desktops
tsmmc.msc

Remote Storage Administration
rsadmin.msc

Removable Storage
ntmsmgr.msc

Removalbe Storage Operator Requests
ntmsoprq.msc

Routing and Remote Access Manager
rrasmgmt.msc

Resultant Set of Policy
rsop.msc

Schema management
schmmgmt.msc

Services Management
services.msc

Shared Folders
fsmgmt.msc

SID Security Migration
sidwalk.msc

Telephony Management
tapimgmt.msc

Terminal Server Configuration
tscc.msc

Terminal Server Licensing
licmgr.exe

Terminal Server Manager
tsadmin.exe

UDDI Services Managment
uddi.msc

Windows Mangement Instumentation
wmimgmt.msc

WINS Server manager
winsmgmt.msc

Monday, May 3, 2010

logMe

namespace Util
{
public class util
{
public static void logMe(string msg, string usr, string fPath)
{
try
{
using (System.IO.StreamWriter file = new System.IO.StreamWriter(fPath, true))
{
DateTime dNow = DateTime.Now;
file.WriteLine(dNow + " | " + usr + " | " + msg);
}
}
catch (Exception ex)
{
Debug.WriteLine (ex.ToString());
throw;
}
}
}
}

Monday, April 26, 2010

Registering DLLs, .Net w/ COM

old: regsvr32 LC_Pro08.dll

.Net C:\Web_DSS_Files\DLLs>gacutil /i PMMaccr08.dll
C:\Web_DSS_Files\DLLs>regasm PMMaccr08.dll /tlb:PMMaccr08.dll

Friday, April 23, 2010

Start Explorer.exe with Folder View

Target: %SystemRoot%\explorer.scf vs. %SystemRoot%\explorer.exe

When You Cannot Find "Users and Computers"

lusrmgr.msc

foo

foo

Tuesday, January 13, 2009

IIS & Port Errors: IIS Cannot create a file when that file already exists

IIS & Port Errors: IIS Cannot create a file when that file already exists

Same port numbers must use same protocol, even with different IP’s

For example:

10.0.0.11:333 (http) 10.0.0.11:444 (https)
10.0.0.12:444 (http) 10.0.0.12:333 (https)

Will result in the below error:



Also: "iis cannot create a file when that file already exists"

If using a seperate/alternate IP make sure that the "SecureBindings" and "ServerBindings" values have both been written to the metabase correctly.

I.E.:
SecureBindings="10.102.169.24:443:"
ServerBindings="10.102.169.24:80:"

Vs.:
ecureBindings=":443:"
ServerBindings="10.102.169.24:80:"

Wednesday, December 17, 2008

listbox/combobox value

Object population:
private void button4_Click(object sender, EventArgs e)
{

cb1.Items.Clear();
IList lstData = new List();
for (int i = 1; i < 10; i++)
{
int j = i * 10;
Console.WriteLine("\t{0}", i.ToString());
spSite spItem = new spSite(i.ToString(), j.ToString());
lstData.Add(spItem);
}
cb1.DisplayMember = "name";
cb1.ValueMember = "guid";
cb1.DataSource = lstData;
}

Retrieve member value (not display text):
private void button5_Click(object sender, EventArgs e)
{
Console.WriteLine(cb1.SelectedValue.ToString());
}

Class def:
public struct spSite
{
private string _name;
private string _guid;

public spSite(string name, string guid)
{
_name = name;
_guid = guid;
}

public string guid
{
get { return _guid; }
}

public string name
{
get { return _name; }
}

public void setName (string name)
{
_name = name;
}

public void setGuid (string guid)
{
_guid = guid;
}
}

Tuesday, December 9, 2008

Good text to hex / hex to text converters

http://centricle.com/tools/ascii-hex/

http://scarlethamster.com/binary.html

Friday, November 14, 2008

Port Scanner

http://www.radmin.com/products/utilities/portscanner.php

Monday, November 10, 2008

DFS - DO_NOT_REMOVE_NtFrs_PreInstall_Directory

stop FileReplicationService then restart

Thursday, October 30, 2008

AA Errors

select top 30 * from tbAm_errorlog order by cast(exceptionmanager_timestamp as datetime) desc

Tuesday, October 28, 2008

CREATE NONCLUSTERED INDEX

CREATE NONCLUSTERED INDEX ncli_foo_a ON foo (a)

Wednesday, October 22, 2008

Unblock Port in Firefox

1) go to about:config in the Firefox address bar
2) right click, choose new->string
3) enter the name network.security.ports.banned.override and the value 1-65535
4) there is no step 4

Tuesday, October 21, 2008

wrong version of project dll’s invoked

c:\inetpub\AAv6 (production – baseline & QW1)
c:\inetpub\AAv7 (UAT – QW2)
c:\inetpub\AAv8 (Dev – QW3)

Debugging v7 on my box was actually picking up the v8 version of SOME of the files (not sure if the v8 versions were put into the released binaries or the v7, primary (UI) binaries were v7 else I would have noticed a lot sooner). Primary offender was AAClasses.

This led to all sorts of “No, that can’t happen”, “Shit”, “That’s impossible”, “wtf”, “omg” & “huh?” behaviours.

Solution:

1.) Close IDE
2.) Reboot (even w/ IDE closed (and killing all iis-related processes) there are still file locks on some of the dll’s & it was taking forever to identify these processes)
3.) DO NOT start IDE
4.) (didn’t help, but for giggles) kill the pdb files in the solution’s bin folders
5.) rd /s /q all dirs under C :\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\root
rd /s /q "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\root\"
a.) this will removed the cached binaries
b.) will make the first run of your project take forever so run through the whole thing once before you try to do any tracing/debugging
6.) Rename the root directory to make sure the ap does not find those binaries (Note – searching project and solution manifests revealed no references to the incorrect files)
7.) Test – you should now be playing with what you intended.

Wednesday, October 1, 2008

GAC Location

C:\%windows%\assembly

Monday, September 29, 2008

City of Flummoxed

http://flummoxed.myminicity.com

quick ref: JS Javascript find form element & value

var o = document.getElementById('txtUserName');

if ((o == null) || (undefined == o))
{ //alert ('UN Null'); return false; }
else {

Tuesday, September 23, 2008

Some Instances of IE Not Allowing Access to Secure Site

Per: http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/ea7cd846-33da-49c9-927f-d4e76d6309ac.mspx?mfr=true

But what it does not say is … if you have a complex site w/ differing directory permissions on different levels you must specify the “NTAuthenticationProviders” property on root as well as the subdirectories. (Note- this is not available via the IIS UI)

Anonymous access (“Allow” checkbox) will override this so it can be set on all subdirs.

In English, the following should be included in the node definition

NTAuthenticationProviders="NTLM"

Else some IE browser will try to use Kerberos authentication (vs. integrated) & you will get a “Cannot access page” error w/ no detail whatsoever.

A quick test of whether or not Kerberos is mucking w/ you can be done using WFetch (screenshot sample below). You want to look for “Authentication:Negotiate” in the response stream. If it is there then IIS is trying to use Kerberos authentication and the above fix will force integrated/NTAuth.

Monday, September 22, 2008

Index and count must refer to a location within the string ...

See if you are tossing error text in the querystring - as in, if the error text being pass is too long for the get/post q-string context this will occur and mask the true error (AA Specific)

Friday, September 19, 2008

AD Error - Access Denied

if using the IADSUser interface to set a user's password in AD, if the password contains the string "test" it will return the error "Access Denied".

Thursday, September 4, 2008

Error while trying to run project: Unable to start debugging on the web server ...

Check the web config file for unescaped "--" (double dash) characters, especially if not part of a comment (VS 2003)


type or namespace amwebservice cannot be found

if you just re-added it make sure you prefix the namespace with AUtil

AAUtil.AAClasses.AMWebService

Alter Table Alter Column Syntax

ALTER TABLE UserPWChangeRequest ALTER COLUMN domain VARCHAR (512)
GO

Friday, August 29, 2008

Unable to connect to the remote server

The underlying connection was closed: Unable to connect to the remote server.

Check, double-check and triple-check the URI for the web service.

Then DNS/hosts/lmhosts


Thursday, August 28, 2008

string to bool

bool bvalue = (svalue == "1" ? true : false);

Friday, August 22, 2008

txt2Hex hex2Txt

/ / JK - for psuedo-encrytping the user entered password to hex
public static string txt2Hex(string arg)
{
string retval = "";
try
{
foreach (char c in arg)
{
int tmp = c;
retval += String.Format("{0:x2}",
(uint)System.Convert.ToUInt32(tmp.ToString()));
}
}
catch (Exception ex)
{
LogUtil.logMeLogic ( "Error : txt2Hex : |" + arg + "| : " + ex.ToString(),
false )
return "-1";
}
return retval;
}

// JK - for decyrpting the psuedo-encrytped the user entered password from hex
public static string hex2Txt(string arg)
{
string retval = "";
try
{
if (arg.Length % 2 != 0)
{
throw new Exception();
}
while (arg.Length > 0)
{
retval += System.Convert.ToChar(System.Convert.ToUInt32(arg.Substring(0,
2), 16)).ToString();
arg = arg.Substring(2, arg.Length - 2);
}
}
catch (Exception ex)
{
LogUtil.logMeLogic ( "Error : txt2Hex : |" + arg + "| : " + ex.ToString(),
false )
return "-1";
}
return retval;
}
}

// Partial source: http://www.testingreflections.com/node/view/5635

Tuesday, August 5, 2008

That damn SELECT INTO syntax

SELECT * INTO fubert FROM foo WHERE 1 = 2

Wednesday, July 30, 2008

System copy of hidden VS projects - Shadow Cache

Start from here ...

C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\root

for instance: C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\root\73352469\2f0068c5\assembly\dl2\574c6e1d\ff77148d_a2f2c801\foo.dll

System copy of hidden VS projects

Start from here ...

C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\root

Account Admin ApConfig Error on Dep to AltEnv

Check WS path in ap config file

i.e. https://xyz/mgmt/errorMessage.aspx?error=System.Web.Services.Protocols.
SoapException%3a+Server+was+unable+to+process+request.+---%3e+System.Runtime.
InteropServices.COMException+(0x80072030)%3a+There+is+no+such+object+on+the+
server%0a+++at+AAUtil.AAClasses.ADTools.CreateADGroup(MCEDirectoryEntry+
ParentEntry%2c+String+groupName%2c+String+description%2c+AD_GROUP_TYPE+
groupType)%0a+++at+AccountManagement.AMWebService.ADWebService.
CreateExternalGeographicGroup(String+GroupName%2c+String+Description)+
in+c%3a%5cinetpub%5caccountadminv5-2003%5caa_webservice%5cadwebservice.
asmx.cs%3aline+378%0a+++---+End+of+inner+exception+stack+trace+---

System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Runtime.InteropServices.COMException (0x80072030): There is no such object on the server at AAUtil.AAClasses.ADTools.CreateADGroup(MCEDirectoryEntry ParentEntry, String groupName, String description, AD_GROUP_TYPE groupType) at AccountManagement.AMWebService.ADWebService.CreateExternalGeographicGroup(String GroupName, String Description) in c:\inetpub\accountadminv5-2003\aa_webservice\adwebservice.asmx.cs:line 378 --- End of inner exception stack trace ---

Saturday, July 26, 2008

Canoe Trip, July 2008

For the whole Black Magic Crew & friends, enjoy ...

(some photos digital, some old school ...)









































Thursday, July 24, 2008

Use Firefox to Debug Visual Studio (2003)

Set focus on project, go to File, Browse With. Select Firefox, Set As Default, Close.

Project Properties, Configuration Properties, Debugging, Always Use IE = False

http://codebetter.com/blogs/peter.van.ooijen/archive/2004/10/25/29621.aspx

Monday, July 14, 2008

Solution to "An error occurred in the secure channel support" - VS 2003 & https redirection



A.) (Blow away/move) the application’s dll (i.e. [bin]\[foo.dll]). Note – if you just do a rename you will get and assembly binding error.

---------

Case (global.asax):

protected void Application_BeginRequest(Object sender, EventArgs e)
{
if(!(Request.Url.ToString().ToLower().StartsWith("https://")))
Response.Redirect(Request.Url.ToString().Replace("http://", "https://"));
}

On a dev box that does not support ssl (& if you are using ports that is another issue).

Compiles fine.

Close & reopen devenv & project …

Upon load, the devenv parses the ap_load dll to contact the web server (2003 uses IIS, 2005 uses Casini and may not demonstrate the same issues) however now the ap_load is redirecting the URI (protocol) the ap uses to go the web server, cannot find the site and barfs.

You are now left with a “You can’t get there from here” (http://www.mathacademy.com/pr/minitext/infinity/index.asp) situation.

By removing the compiled version of the project, the site (existence) is not validated at dev time but rather run time (which then at least allows you to still modify the code, say do a conditional redirection based on environment).



Thursday, July 10, 2008

Microsoft® Visual C#® Default Keybindings (Shortcuts)

http://download.microsoft.com/download/e/7/9/e79cce22-b196-4b9f-9ea7-b1a21f5342e9/VCSharp_2005_color.pdf

Alternative ones:
http://www.microsoft.com/downloads/details.aspx?familyid=C15D210D-A926-46A8-A586-31F8A2E576FE&displaylang=en

Wednesday, July 2, 2008

Internet Explorer Developer Toolbar

http://www.microsoft.com/downloads/details.aspx?FamilyID=E59C3964-672D-4511-BB3E-2D5E1DB91038&displaylang=en


Overview

The Internet Explorer Developer Toolbar provides several features for exploring and understanding Web pages. These features enable you to:

  • Explore and modify the document object model (DOM) of a Web page.
  • Locate and select specific elements on a Web page through a variety of techniques.
  • Selectively disable Internet Explorer settings.
  • View HTML object class names, ID's, and details such as link paths, tab index values, and access keys.
  • Outline tables, table cells, images, or selected tags.
  • Validate HTML, CSS, WAI, and RSS web feed links.
  • Display image dimensions, file sizes, path information, and alternate (ALT) text.
  • Immediately resize the browser window to a new resolution.
  • Selectively clear the browser cache and saved cookies. Choose from all objects or those associated with a given domain.
  • Display a fully featured design ruler to help accurately align and measure objects on your pages.
  • Find the style rules used to set specific style values on an element.
  • View the formatted and syntax colored source of HTML and CSS.

    The Developer Toolbar can be pinned to the Internet Explorer browser window or floated separately.
  • Tuesday, June 24, 2008

    ASP.NET Worker Process

    ASP.NET Worker Process

    aspnet_wp.exe for Windows 2000

    w3wp.exe for Windows 2003.

    Wednesday, June 18, 2008

    Update Trigger Syntax

    CREATE TABLE dbo.foo
    (
    ID INT IDENTITY (1, 1) PRIMARY KEY NONCLUSTERED
    , DomainValue VARCHAR (126) UNIQUE NOT NULL
    , DomainType CHAR (1) NOT NULL
    , Active BIT DEFAULT 1 NOT NULL
    , Created DATETIME DEFAULT GETDATE()
    , Modified DATETIME DEFAULT GETDATE() -- TRIGGER
    )

    GO

    CREATE CLUSTERED INDEX cliDomainType ON Foo (DomainType)

    GO

    CREATE TRIGGER tru_Foo ON dbo.Foo
    FOR UPDATE
    AS
    BEGIN
    UPDATE t
    SET t.Modified = GETDATE()
    FROM Foo AS t
    WHERE t.ID =
    (
    SELECT ID FROM INSERTED
    )
    END

    Scott Guthrie's ASP.NET 2.0 Tips, Tricks, Recipes and Gotchas

    http://weblogs.asp.net/scottgu/pages/ASP.NET-2.0-Tips_2C00_-Tricks_2C00_-Recipes-and-Gotchas.aspx

    Tuesday, June 17, 2008

    Visual Studio 2003 Deployment

    Project / Copy Project

    Do not use FPS rather use the UI to XCOPY to a local (pre-made) site, only files needed for this project.

    NOTE: ANY ERROR IS FATAL TO THE DEPLOYMENT OF THE APPLICATION BUT IT WILL NOT ROLLBACK, IT WILL PARTIALLY DEPLOY. ALWAYS DEPLOY TO A STAGE DIRECTORY (and, of course, test this stage deployed version first) (LOCAL TO TARGET) AND THEN XCOPY OVER.

    I discovered this three ways (perhaps because I can be particularly obtuse @ times ...)

    1.) Code I rolled did not do what it should ... (Gee, duh ... (and yes, I was staging it))

    2.) Funny thing how the VS deployment tool would finish so quickly after encountering an error (i.e. it took 30 seconds when an XCOPY took 2 minutes or more ...)

    3.) Hmmm ... My local solution has a rather complex file hierarchy but ... I only see first level hierarchy (and for the immediate sub-levels there are no contents) ... Not sure about the priority/pattern of XCOPY (about which I am guessing the VS 2003 IDE is trying to obfuscate) but ... isn't it funny that if "img21.jpg" & "img22.jpg" (of a second level directory) are there but it bombs (modal) on "img23.jpg" (which it turns out is missing in source but is in VSS manifest) and then "img24.jpg" is not in the subdirectory of the deployed/stage solution (after one hits "OK" on the modal) (but it is in the source directory ...)

    Point: Not sure about the exact order of a VS "Copy Project" deployment but if there is an error it is fatal, does not rollback and can leave you with a partial/mixed deployment if you don't stage (use good practices).

    Change Source Control Bindings (VSS & Visual Studio 2003)

    On Project root, open mssccprj.scc and edit path for project and solution "SCC_Project_Name" values

    Force Delete Files, Including System/VSS Bindings

    del *.scc /F /S /A S

    (& vspscc files)

    MetaBase Location

    C:\WINDOWS\system32\inetsrv\MetaBase.xml

    Monday, June 16, 2008

    2003 to 2005 Conversion: "Unable to start debugging on the web server"

    Make sure your project did not inherit a port that is configured for 1.1 (i.e. start project properties, web tab, "Use Visual Studio Development Server")

    Visual Studio - Just Cannot Get Those Reference Paths Right ...

    Given:

    C:\Inetpub\dir1.1\resources\foo.dll (i.e. 1.1 version)
    and
    C:\Inetpub\dir2.0\resources\foo.dll (i.e. 2.0 version)

    You want to add the latter (the 2.0 version in dir2.0) to your project references but, after you do so and you go back and check the properties of foo.dll in your project you see that it is pointing to the former (the 1.1 version in dir1).

    Check "Project Properties", the "Reference Paths" tab values and remove the paths to any unused directories. These act similarly to path variables and if foo.dll is found in one of them then that is the file that will be used regardless of the fully qualified path that you explicitly specified.

    (specific to VS 2005)

    Friday, June 13, 2008

    Compiler Error Message: CS0006: Metadata file could not be found

    Try deleting the c:\winnt\microsoft.net\framework\v1.1.4322\temporary asp.net files

    Access is denied: ‘ICSharpCode.SharpZipLib’.

    Turn off (stop) the indexing service

    Wednesday, June 11, 2008

    ALTER TABLE ADD FOREIGN KEY Syntax

    ALTER TABLE bistroProjectTaskRelation
    ADD CONSTRAINT fkProject
    FOREIGN KEY (projectID)
    REFERENCES bistroProject (projectID)

    More on Secure Channel Support

    Visual Studio 2003 (.Net 1.1)

    "Secure Channel Support" errors have occurred quite frequently. Common resolutions have been:

    + (Deployment) use XCOPY, not FPS
    + (IDE) change port, make sure to change definitions in solution file and web.info file (I think this file is specific to 1.1/2003)

    Resolution for this instance of the debacle ... one of the eight project files (in the solution) I had converted to 2005 (the only indication being the rather obtuse error). "Secure Channel Support" errors were evident prior to any 2005 conversion efforts and (from what I gather online) have been the bane of many. Discovery of the difference was made with line-by-line analysis of each project manifest file and noting that one of the property value of one of the elements referred to "CodeBehind" versus "Inline", a feature (that if I recall correctly) was fully implemented in 2005 (with the introduction of partial classes).

    Thursday, May 29, 2008

    .Net 1.1 Deployment "An error occured in the secure channel support"

    Try removing the destination files, especially if you are "re"deploying a project.

    Wednesday, May 21, 2008

    There was an error loading ...

    WSE032: There was an error loading the microsoft.web.services2 configuration section.

    Wrong version of assembly specified in web.config

    Tuesday, May 20, 2008

    Fix for Developers not being able to send email from their box (programmatically)


    Check if virus software installed, particularly port 25. aka "Prevent mass mailing worms from sending mail"
    (MacAfee instructions below)

    Thanks to DavidG @ http://www.systemwebmail.com/faq/4.2.9.aspx

    "... Now from David This might be too specific an issue, but I'll mention it anyway. Setting SmtpMail.SmtpServer using the server name gives:
    Could not access 'CDO.Message' object.
    innerexception: The transport failed to connect to the server.
    Setting SmtpMail.SmtpServer using the IP address gives:
    Could not access 'CDO.Message' object.
    innerexception: The message could not be sent to the SMTP server. The transport
    error code was 0x800ccc15. The server response was not available
    I tracked this issue down to McAfee VirusScan Enterprise 8.0 VirusScan Console, Access Protection, Properties, Port-Blocking tab, Rule:"Prevent mass mailing worms from sending mail" This blocks outbound access to any port 25 on the network. Edit button shows a list of excluded processes to which new processes can be added. Regards, DavidG ... "








    Monday, May 12, 2008

    Good SQL Server PerfMon Videos

    Author: Kevin Kline Strategy Manager for SQL Server Solutions at Quest Software

    " ... In part 1 of this series on "PerfMon counters for the SQL Server DBA," SQL Server MVP Kevin Kline walks you through significant PerfMon counters for tracking Windows memory। In this screencast, you'll learn the maximum numbers to watch for when using PerfMon counters as a method to avoid memory pressure in your SQL Server system। ..."

    Friday, May 2, 2008

    File Size Disk Utility

    "Every hard disk is too small if you just wait long enough. TreeSize Free tells you where precious space has gone to. TreeSize Free can be started from the context menu of a folder or drive and shows you the size of this folder, including its subfolders. You can expand this folder in Explorer-like style and you will see the size of every subfolder. Scanning is done in a thread, so you can already see results while TreeSize Free is working. The space, which is wasted by the file system, can be displayed and the results can be printed in a report. TreeSize Free is freeware for Windows 9x/2000/XP/Vista..."

    http://www.jam-software.com/freeware/index.shtml

    MySql Cheat Sheet

    http://www.pantz.org/software/mysql/mysqlcommands.html

    Thursday, April 24, 2008

    Syntax for Output Parameter C#

    protected void RolesToBeMade(int RoleID, int DepartmentID)
    {

    string strConnString = ConfigurationManager.ConnectionStrings["jk_devConnectionString"].ConnectionString;
    SqlConnection conn = new SqlConnection(strConnString);
    try
    {
    errMsg.Visible = false;

    conn.Open();

    SqlCommand DBCmd = new SqlCommand("insDepartmentRole", conn);
    DBCmd.CommandType = CommandType.StoredProcedure;

    SqlParameter paramRID = new SqlParameter("@_RoleID", SqlDbType.Int, 10);
    paramRID.Value = RoleID;

    SqlParameter paramDID = new SqlParameter("@_DepartmentID", SqlDbType.Int, 10);
    paramDID.Value = DepartmentID;

    SqlParameter sqlOut = new SqlParameter("@_result", SqlDbType.Int);
    sqlOut.Direction = ParameterDirection.ReturnValue;

    DBCmd.Parameters.Add(paramRID);
    DBCmd.Parameters.Add(paramDID);
    DBCmd.Parameters.Add(sqlOut);

    DBCmd.ExecuteNonQuery();

    Int32 intI;

    intI = (Int32)DBCmd.Parameters["@_result"].Value;

    if (intI != 0)
    {
    throw new ArgumentException("Database Error");
    }
    }
    catch (Exception err)
    {
    util.logging.Log2file(err.Message.ToString(), Server.MapPath("~") + "
    \\Logging.log", 10000);
    errMsg.Visible = true;
    errMsg.Text = "Sorry, an error occurred. Please try your request again at another time.";
    }
    finally
    {
    conn.Close();
    }
    }

    How to use VS 2003 on Vista

    Notes:
    1.) Visual Studio 2003 is not supported on Vista (per M$). While VS2k3 binaries will run on Vista and VS2k3 code can/will compile on Vista, Vista in not a suitable OS for a VS2k3 development machine. Use 2k Pro+ or XP Pro+
    2.) This document is specific to web projects
    3.) Version of Vista was/is 64 bit Ultimate (only relevant to a few steps)


    Prerequisites:

    1.) .Net Framework 1.1
    2.) .Net Framework 1.1 (Very important – otherwise you will get a rather obtuse error)
    1.) Ensure "c:\Windows\Microsoft.NET\Framework\v1.1.4322\mscorsvr.dll" is version 1.1.4322.2032 or higher
    2.) IIS 6.0 or later (7.0 comes w/ Vista versions Premium and above)



    Detailed: (Source: URL_1)

    1.) Enable IIS 6.0 compatibility
    · Open "Control Panel"
    · Double-click "Programs and Features"
    · Expand "Internet Information Services"
    · Expand "Web Management Tools"
    · Check "IIS 6 Management Compatibility"

    2.) Register v1.1 with IIS
    · Open a CMD prompt
    · Change your directory to c:\Windows\MIcrosoft.net\Framework\v1.1.4322
    · Run "aspnet_regiis -ir -enable"
    · "ir" registers v1.1 with IIS but doesn't change any existing script mappings
    · "enable" marks aspnet_isapi.dll as "Allowed" under "ISAPI and CGI Restrictions"
    · aspnet_regiis should also create a new AppPool under "Application Pools" called "ASP.NET 1.1" that is configured with the "Classic" pipline, and "Enable32BitAppOnWin64" set to true if a 64-bit OS.

    3.) Make the new "ASP.NET 1.1" appPool the default.
    · Open the IIS manager
    · Select the "Web Sites" folder.
    · Under "Actions" on the upper right, click "Set Web Site Defaults..."
    · Change the "Application Pool" setting to "ASP.NET 1.1"

    4.) Setup your user account as a local admin (you want to be in the Debugger User group but this will take care of that) URL_2

    5.) Switch off the "user account control" (optional) [msconfig] [tools] [Disable UAC] URL_3

    6.) IIS – make sure “Front Page Extentions” installed (under WWW Services) (via Add / Remove Windows components)

    7.) IIS – make sure “IIS 6.0 Compatibility” installed (under WWW Services) (via Add / Remove Windows components)

    8.) Make sure WWW Services service is running (and IIS, while you’re at it…)

    9.) IIS – server level – “ISAPI & CGI restrictions” – ensure ASP v1.1 enabled (may be able to set at application level and skip step 13 but I did not try)

    10.) New virtual directory
    a. ASP properties – allow client and server side debugging (even though you won’t be able to debug anyway)
    b. Authentication – Windows

    11.) Verify web site started

    12.) Make project, verify web.config value for debug = true (even though you won’t be able to debug anyway)

    13.) Reset any 2.0 sites to use “Default Application Pool” (2.0) in IIS

    14.) If you get an error like “URL is in the internet zone” change your project properties to local host

    a. From “http://netbios and domain/WebApplication1
    b. To “http://localhost/Web Appliation1/

    Other/Related items

    #1.) New boxes from IT may be missing some web hosting components (hear head banging on desk now)
    (Note I am on Vista 64 bit, IIS 7.0)
    a.) Under add/update/remove Windows components, under IIS, under wwws (world wide web services) there are several options – check them all. I think in other OS’s that wwws is on the same level, not under, iis. I’ve isolated it to this level (but not the exact subcomponent). My solution also worked for Mike who is on XP. Symptom is that IIS cannot serve up any kind of asp(x) page, only htm(l) will work

    #2.) (SQL Server) While the 32 bit client tools for 2K (except for EM) work well with 2K5 (and are much lighter weight) the 32 bit 2K tools (query analyzer) does not work with 2K5 64 bit



    URL_1 http://blogs.iis.net/brian-murphy-booth/archive/2007/03/09/how-to-setup-asp-net-v1-1-visual-studio-net-2003-projects-on-iis7-vista.aspx

    URL_2 http://citruslime.blogspot.com/

    URL_3 http://technet2.microsoft.com/WindowsVista/en/library/0d75f774-8514-4c9e-ac08-4c21f5c6c2d91033.mspx?pf=true

    Debugging client JavaScript in VS 2005

    http://www.developerfusion.co.uk/show/5918/

    "...One of less known features of Visual Studio 2005 is Script Explorer, hidden in Debug menu where appears only when the debugger is running. This great tool allows easily debug JavaScripts..."

    SQL Server 2005 Long Varchar Storage

    2k vs. 2k5 difference – 2k5 will allow table content to exceed 8060 chars – it puts in a 24 bit ref. & stores the offending data in a different page. Not a great idea but it does prevent the app from breaking.

    SQL Server 2005 Security Option

    Had an ap all of a sudden just stop working today …

    Logon Error: 18487, Severity: 14, State: 1. Logon Login failed for user 'loginname'. Reason: The password of the account has expired. [CLIENT: ]

    Then the password for the login used in your web application has expired. SQL Server 2005 introduced 'Enforce password policy' and/or the 'Enforce password expiration' configurations which use the local policies for password length, complexity and expiration. Depending on how Active Directory, the local policies and your rights are setup, these parameters can be reviewed and changed to dictate how SQL Server uses configurations.

    Differences in SQL Profiler 2000 & 2005

    Between Sysobject changes and changes in the UI for SQL Profiler you may run into some unexpected results when trying to trace DB commands (especially if you are trying to trace on only a specific db (recommended – profiler is a rather heavy tool)).

    You may find the below chart of assistance. Note – in the 2005 version of profiler there is a checkbox on the “Filter” dialogue called “Exclude rows that do not contain values” (this does not exist for the 2000 version). Your filters will not be applied unless this box is checked. Additionally this option is not available when using 2005 tools on a 2000 DB.

    Cascading add sub-dirs to vss project

    If, when you dnd from root, when the comment dialogue comes up select the “Recursive” check box. Then all of the sub-dirs will be included.

    Intermittent .Net Errors

    “ … If you run Index Server (Cisvc.exe), then Index Server may rescan the Temporary ASP.NET Files directory while it requests a Microsoft ASP.NET page. Cisvc.exe then holds a lock on the Temporary ASP.NET Files directory for one to five minutes. The length of time of the lock depends on the size of the directory that causes the Aspnet_wp.exeprocess (or W3wp.exe process for applications that run on Microsoft Internet Information Services [IIS] 6.0) to not load the particular DLL. …”

    http://support.microsoft.com/default.aspx?scid=kb;en-us;329065

    FYI - Insert From SP Example

    USE ...

    GO

    ALTER PROC foobar
    AS
    SELECT clientID, Nm FROM client

    GO

    CREATE TABLE #foos (clientID INT, Nm VARCHAR (255))

    GO

    INSERT #foos (clientID, Nm)
    EXEC foobar

    SELECT * FROM #foos

    -- DROP TABLE #foos

    Web.Config vs. Ap.Config Findings

    Goal: when are changes to config file picked up automagically?

    ∆ Web.Config (a) ∆ App.Config (b)

    Simple KVP∆
    (a) Picked up
    (b) Not picked/up

    ∆ Web.config
    (a) appSettings file value Picked up
    (b) (hot swappable)

    Recycle Ap Pool
    (a) Picked up
    (b) Picked up






    Whack VB IDE Hostile Takeover of Focus

    Tools/Options/Editor Uncheck "Auto Syntax Check"

    VSxxxx 2005 Visual Studio Can't use IE to debug with VSxxxx (asp.net)

    Check hosts file for localhost entry (lmhosts did not have entry)

    C:\WINDOWS\system32\drivers\etc\hosts

    Bad (in my case): xxx.xxx.xxx.24 localhost

    Good: 127.0.0.1 localhost

    Or just delete the line and let it default to the loopback address

    VSxxxx 2003 Visual Studio Tips for Ambiguous Errors

    Tips for ambiguous errors

    Reference Issues - can not be found
    P: C:\Inetpub\ApName\list.aspx.cs(26): The type or namespace name 'ToolBarControl' could not be found (are you missing a using directive or an assembly reference?)
    A: Remove and re-add the references

    Server Application Unavailable

    P: The web application you are attempting to access on this web server is currently unavailable. Please hit the "Refresh" button in your web browser to retry your request. Administrator Note: An error message detailing the cause of this specific request failure can be found in the application event log of the web server. Please review this log entry to discover what caused this error to occur.
    A: Are you running locally when the ap needs to run in the McCann domain? (i.e. accessing a web service


    Q.) Not a valid solution/project file

    A.) Make sure you are using VS 2003 (and double check the site is using 1.1)


    Q.) Messed up paths for solution after you open projects


    A.) Create a new solution, importing the projects from $/dir/ApplicationName

    Q.) Error: “Machine to Application” ('MachineToApplication')

    A.) Make sure that the Ap directory under root is configured as an application



    Q.) Error: “The 'type' attribute must be set to a valid type name. (C:\Inetpub\ApName\web.config line 241)“ when AP tries to invoke the web service

    A.) Missing DLL – try Microsoft.Web.Services2.dll” to the bin directory and other projects in the solution ref it


    Q.) Error: The type or namespace name 'SomeRef' could not be found (are you missing a using directive or an assembly reference

    A.) Remove and re-add the project reference for 'SomeRef’ to project



    Q.) Error: The Type Or Namespace Name 'SomeRef’ cannot be found

    A.) Make sure that the project SubName is in the solution, build it, in add a reference to its output for ParentProj

    Q.) Error: The type or namespace name 'IISPWCHGLib' cannot be found

    A.) Add reference to inter-op component Interop.IISPWCHGLib.dll.

    Q.) Error: The type or namespace name ADSSECURITYLib cannot be found

    A.) Add reference to inter-op component Interop.ADSSECURITYLib.dll


    Q.) Error: Object reference not set to an instance of an object
    1. Object reference not set to an instance of an object.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

    Source Error:
    if(ApPart.HasRight(Session,"Full Control") || Session["Role"].ToString() == " Administrator") {…

    A.) Make sure that there is a copy of Microsoft.Web.Services2 in the bin directory for Ap (even if the reference is included in the project it appears not to be included in the project. Alternatively register this file in the GAC.)

    B.) Make sure that “Allow Anonymous Access” is turned off @ the site level for the web site. [Website] [Properties] [Directory Security] [Edit] [Authentication Methods] uncheck [“Enable anonymous access”]


    Q.) Error: A project of type class library cannot be started directly

    A.) Set Ap as startup project and select a page (say, mgmt\addEmail.apsx) as the start page


    Q.) Unable to open ApWebService

    A.) Check the config (web.config & Ap.config) settings for the WS against a working version (say stage)

    Q.) No error output, cannot debug

    A.) Change web.config values for detailed errors and trace enabled to “true”

    Q.) ICSharpCode.SharpZipLib

    A.) http://www.icsharpcode.net/OpenSource/SharpZipLib/ may be required for some projects. (see $/ApName/Ancillary)


    Q.) WSE 2

    A.) Requires Web Services Enhancements 2.0


    Q.) module 'Session' is : An error occurred during the processing of a configuration file required to service this request added again – The module session is already in the application

    A.) cscript.exe adsutil.vbs SET /W3SVC/UploadReadAheadSize 512000

    B.) Reboot



    Q.) FPSE – Front Page Server Extensions

    A.) Not needed



    Q.) ASP.Net on local machine …

    A.) Make sure aspnet (local machine) has access to c:\windows\temp\ per
    http://msdn2.microsoft.com/en-us/library/aa302396.aspx


    Q.) DLL defined multiple places (also – the type attribute must be set to a valid name)

    A.) – Erase all content (project output) from the bin directory

    B.) “The problem is that you may have other assemblies .i.e. dlls resulting form previous compiles.
    You may have renamed your assemblies and thus you may have several name spaces visible.
    The .NET framework cannot tell which namespace you are referring to in your \bin directory.
    By deleting the offending .dlls (previous named assemblies) you will no longer get this error”


    Q.) ASP .Net Version (1.0)

    A.) Your IIS directory maybe set to 2.0 – change it to 1.1


    Q.) Other & possibly “The remote name could not be resolved”

    A.) May have a different hosts file that may/will cause issues trying to connect to remote servers via NetBios vs. IP address.



    Q.) The type or namespace name 'ToolBarControl' could not be found (are you missing a using directive or an assembly reference?)

    A.) Remove (delete) and re-add the project references. Also verify that the reference paths are for your local machine and not the values retrieved from VSS


    Q.) In order to add this reference … ReferencePath property



    A.) Say “Yes”



    Q.) Error: “web application you are attempting to access on this web server is currently unavailable. Please hit the Refresh” or “Internal Server Error”

    A.) Double check IIS set to 1.1, Reboot your machine


    Q.) Deployment or “Secure Channel Support”

    A.) To deploy I deployed to a local drive (only required files), then shared a dir on the Stage machine, copied the site output with xcopy, undid the share and worked remotely


    Q.) Deployment & type attribute must be set to a valid type name.

    A.) Use pre-existing stage config files

    B.) Copied Microsoft.Web.Services2.dll to bin



    Q.) SELECT permission denied on object 'ASPStateTempApplications' (SQL Session State)

    A.) Need to enable SQL Server Session State for this login on this database

    http://support.microsoft.com/kb/311209

    If server is already configured for ss session state, add that (your) user as dbo for the [ASPState] db and [db_datareader] and [db_datawriter] for [tempDB]

    SSRS 3 How to export a report

    How to export a report ... navigate to report - [Properties] [Edit] [Save

    SSRS2 Faster SSRS Performance

    SSRS Tip

    If you RDC to the actual server to make changes (via http) the ui is about twice as fast (makes sense if you think about

    SSRS User does not have rights / permissions to view report properties

    Joe: I'm having problems granting permissions to an AD group in ssrs, namely even though they are in there (the group "admins", and the group is in ssrs) and all the ssrs roles are attributed to the group members of the group can not access report properties

    Sal: I think, cause I have seen similar things they have to be added to the top level and then revoked from the other folders

    Joe: k- on the "Home" level?

    Sal: yes, home, using the web app

    : )