| Jerry Dausman's profileThere's an answer to you...BlogLists | Help |
|
There's an answer to your question.Questions raised by students or myself while participating in a Microsoft course. May 05 ASP to Excel Zip Code FormatSo we had a problem today. We were trying to create, from an .asp page, an Excel spreadsheet that users could download. One of the columns carried zip codes, but the leading zeros of the zip codes were dropped, since Excel thought of these as numbers. Well, there's a lot of complicated things you can do, such as <meta> tags and such, but what's the easiest way to get this data into Excel, and have it display correctly? Just write the data in an HTML style table and use a style tag that Excel recognizes.
The example below is a simple spreadsheet, saved with the .xls extension for Excel. It has only two cells, both with the zip code value "02139" included. Notice that the second cell has a class attribute of "txt" however. That makes all the difference.
January 24 Searching for AnswersI can't believe I haven't added anything to this blog in 11 months! Somebody wake me up!
On my new job I wrote a script to help me find specific text in files. I know what you're going to say: there's a built in feature in Windows that will do the same thing. True, but it only gives me a list of files. I want more! And I got more. The script below does the following:
The script uses a list (Reports.txt) as an input list of files to scan. You can create this list by using the directory command at the "C:>" prompt as follows:
Here's the code for the script that does the work:
Hope this is helpful for you! February 26 Forgotten DependanciesCorrect me if I'm wrong, but I believe past versions of SQL Server used to show all dependancies for all types of objects. Today I had to find out in which stored procedures a certain view was used. I ran sp_depends on the name of the view and all I got was the tables that the view depended upon. Knowing that the view was used in at least one stored procedure I proceeded to investigate the system table sysdepends. Lo and behold, there was no information for that stored procedures relationship to the view in sysdepends! What to do? Write my own procedure that I'll call spDependsAlso:
Of course, you may want to create this as a function instead. And it would certainly work faster if we used the 'CONTAINS' function in the WHERE clause ... but then we'd have to use Search Service and regularly update the search indexes. I find this version works well enough for me.
January 25 New JobWhat would you say to to the same hours, but more pay?
A good friend and neighbor dropped an offer in my lap last November. So not wanting to turn down a big raise and a challenging position I accepted. I am now working for Dynamics Research Corporation on a contract with the Department of Homeland Security, Citizenship and Immigration Services. My official title is Senior Staff IT Analyst.
But wait! There's more!
Two and a half weeks into the job my new boss gets an offer he can't refuse! So who gets to take his old job? It's offered to me ... and I took a second raise and promotion (effective February 1).
Call now! Operators are Standing By!
I will continue with this blog ... for several reasons: 1) my job still involves teaching, albeit a lot less; 2) I intend to continue on as retain my MCT certification; and 3) I seem to like sharing what I learn!
September 28 Sharing Session between ASP and ASP.NETOne of my students in my recent Upgrading to ASP.NET class wanted to know how to share Application and Session variables between .asp and .aspx pages. The manual says you can't do it directly. Two minutes after the last student left I found good answers from Microsoft MVP Peter A. Bromberg's site.
There are two ways you can share the information. We discussed one of the ways in class: create a COM object that you use in place of a session object. When you save a session variable you would use both the session id (which you can retrieve from ServerVariables) and a key to store the value. Since you can use COM objects in both .asp and .aspx pages, each would have access to the information. The COM object would typically use a database to store the data on the back end. The second way the MVP suggested was to store the data in both Session variables and hidden <input> tags, posting them across from .asp to .aspx, and vice versa.
A detailed discussion and accompanying code can be found at http://www.eggheadcafe.com/articles/20021207.asp and
|
||||||||||||||||||||||
|
|