Wednesday, April 15, 2009

replace is an unknown xslt function

I'm working client side and found that I couldn't use the replace function in the xslt value arguments. For all of those looking for a workaround, you can use the translate function. To find out more, please visit http://www.w3.org/TR/xpath#function-translate

Monday, February 23, 2009

Making extra money as a programmer on the side

Ok, I've been programming for years, so not much shocks me anymore. But, every once in a while I wonder how I can make more money without having to work more hours. At some points, it seems as though, as a developer, I may spend the rest of my life in "crisis mode" for clients.

Anyway, lately, I've been investigating some strategies. I've found that if I were to choose the ultimate job, it would consist of the following... unlimited number of clients, make money when I'm not working, create residual money, no extreme deadlines.

From what I've seen so far, it looks like affiliate marketing is the way to go. I've been working with it for a short time now. No big successes yet. But, considering this economy, companies are scrambling for these marketers.

If you want to continue on that journey with me, or learn more, please visit http://www.awealthyaffiliatemember.com for more information. On a side note, the group within this "university" also needs developers as they have their own job board.

Thursday, February 19, 2009

How can I tell if a stored procedure is taking too long to run

A lot of times, we are called in a panic if something crashes. A lot of times, it could be because something crashed, in some cases, a stored procedure. Here is a good article with a solution: http://www.databasejournal.com/features/mssql/article.php/3500276/Identifying-Long-Running-SQL-Server-Agent-Jobs.htm

Thursday, February 12, 2009

A severe error occurred on the current command. The results, if any, should be discarded.

Error message:
A severe error occurred on the current command. The results, if any, should be discarded.
A severe error occurred on the current command. The results, if any, should be discarded.

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.Exception: A severe error occurred on the current command. The results, if any, should be discarded.
A severe error occurred on the current command. The results, if any, should be discarded.

Error Message in DB:
The connection has been dropped because the principal that opened it subsequently assumed a new security context, and then tried to reset the connection under its impersonated security context. This scenario is not supported. See "Impersonation Overview" in Books Online

Solution:
Implement coding workaround, non-dba issue.
Issue: Web.config setting for connection strings "Connection Reset" does not work for newer versions of .NET2.0. This issue starts once .NET 2.0 SP1 or greater is installed on the application server machine. You'll have to change your code where you are impersonating someone.

Immediate solution:
In your web.config database connection string turn off pooling, Pooling=false;

Thursday, December 18, 2008

javascript focus doesn't work

Had this issue working with .net and javascript. I had the issue where I was trying to set focus on a text box. But, for some reason, I couldn't set focus. I could set focus on drop down boxes in the same window.

Solution, instead of using .focus, I used .select. I still haven't figure out the reasoning behind it, but select worked, focus did not.

Monday, March 17, 2008

How do I have a select distinct and a top x in the same query

Ah, this one puzzled me. I had to go to the internet, and I still didn't quite get it. But, here is the solution.

SELECT
distinct top 3 y.*
FROM
(Select topicid, max(posted) as posted from yaf_Message Group by topicid) y

Order By Posted DESC

How does it work?
Ok, the initial select defines the top values returned.
The From creates another table with only those values that I need. So, when the first select looks in the table, it is looking in a filtered table.

Thursday, March 13, 2008

How to access masterpage values from a page

Ok, had this issue. The site allows you to log in and set some preferences. One of these preferences changes the links in the top navigation. So, when it was being set in the preferences page, it wasn't updating the top navigation.

Here's some background as to why. When the preferences were set in the sub page, it would load up the master page first, then set the value. That is the first issue. So, how do I update the master page after the fact. Well, after some quick discovery, I found this article. It saved me. Took 5 minutes after I read this article.

http://www.thescripts.com/forum/thread343203.html