On the road again...

The life of a .NET commuter.
Sharepoint Experts: Strange Problem with SharePoint Designer

I've seen documentation regarding modifying pages within a site using SharePoint Designer.  This has worked well.  

But...

We've seen all modifications we've made to the base pages completely disappear.  Has anyone experienced this issue?  How can I prevent these definitions from resetting?

 

Posted: Mar 05 2010, 11:00 AM by du8die | with no comments
Filed under: ,
A "Web 2.0" background stripe generator.

Found this excellent tool today. 

http://www.stripegenerator.com

Posted: Sep 03 2008, 11:52 PM by du8die | with 1 comment(s)
Filed under: ,
Funny Wallpaper???

So, what is this funny wallpaper thing that seems to be spamming this site?  

"Pingback from  funny wallpaper » Create HotKey combinations with jQuery"

I've seen it on pretty much every post on this site for the past month or so. 

Interestingly enough, every single post on this site (yes I went...  virtual machine)... starts with...

mswanson wrote an interesting post today on
Here’s a quick excerpt

(wrong name incidentally).  

Anyway.  Does this bug anyone else but me?

Posted: Aug 22 2008, 04:55 PM by du8die | with 4 comment(s)
Filed under:
Create HotKey combinations with jQuery

Here's a great little script that allows you to easily map hot-key combinations using the jQuery library.

http://code.google.com/p/js-hotkeys/wiki/about

If you haven't seen the jQuery libray yet, check it out.

Case-Sensitivity in ASP.NET (VB)

Note to self, and anyone else who cares...

ViewState("ReferrerURL") is not the same as ViewState("ReferrerUrl").

Same with Cache object names.  Apparently VB does *kinda* care about case sensitivity...

 

Changing your IP settings with Batch File

My router at home isn't serving IP addresses to my machine anymore.  So, rather than figure out what is wrong, or buying a new one (the simple things), I found this helpful gem.

It's a way to set the IP config of your computer from a batch file. 

Eric Burcham's IP Configuration Batch File

 

Finding and Deleting Duplicate records in SQL Server

So, I have a situation where I have some duplicate records in a SQL Server.  This is a result of a bad decision I made about 3 months ago.  That's another story.  I needed to find out how to find those records in my database easily.

http://blogs.techrepublic.com.com/datacenter/?p=372

 Here's the crux:

 

SELECT * | DELETE FROM table

WHERE uniquefield IN

(SELECT uniquefield

FROM table

WHERE EXISTS(

SELECT NULL

FROM table AS tmptable

WHERE table.field1 = tmptable.field1

[AND table.field2 = tmptable.field2

[AND ...]]

HAVING table.uniquefield > MIN(tmptable.uniquefield)

)

)

So, I'm running it on my database.  It's taking a while since I have close to 2 million rows in the table that I'm trying to match.  Crossing my fingers.  :)  
 

Posted: Jun 10 2008, 02:58 PM by du8die | with 2 comment(s)
Filed under:
ASP.NET and Images on a Network Share

 The school district I work for had an idea for an application.  The need comes from several angles.  First of all, lunch counts are all done by paper.  Attendance is taken on paper, then it is sent to the Health Room, where tallies are made, and then everything is recorded into our Student Management System (SMS for short), and our Food Service app.  Most (if not all) of our elementary class rooms will have Smart Boards next year.  So we decided to write an app that would allow the students to "check in" in the morning on the smart board.  The kids can go up to the board and select their lunch choice, and do attendance all at once.

 Getting the app to work was the easy part.  Our SMS keeps all of the students photos on a drive.  I wanted to use those photos directly off of the SMS server, rather than copy them locally.  So, I shared the folder that contained the pictures.  Then I mapped a drive on the server, and voila.  Everything didn't work. 

 Apparently, there are security restrictions that prevent a web app from using files on a network share.  It took a lot of iterations to get where I wanted.  I can post details if of the process if need-be.

 Here's what I ended up with.

In SQL 2005, there is a little gem.  OpenRowSet.

SELECT BulkColumn as 'Photo' FROM OPENROWSET(BULK N'p:\test.jpg', SINGLE_BLOB) AS Photo

This returns a single column with blob datatype.  So, I can then bring it into an image handler and go crazy.

Well, I mapped my drive, and then ran that command, and got an access denied error.  I realized that SQL Server runs under the local system account ("NT AUTHORITY\SYSTEM").  The mapped drive didn't exist under that identity.  So, I then found a reference somewhere (I forget the link) that says you can map a drive to the system account if you schedule a command to run with the AT command.

 
So, I created a batch file that mapped the drive with the remote machine's authentication:

net use p: \\10.10.xx.xx\pics remotemachinepassword /user:remotemachinename\remotemachineuser

Then, I scheduled the AT command to run the batch file:

at 20:00 c:\mapit.bat

This forced the system local account to have the mapped drive.  I then ran my SQL in my app that pulled the images over, and PERFECT!

So, using a little SQL Server magic and a mapped drive to the system local user, you can in fact, use a resource from a remote machine in an ASP.NET app.

I want to test the mapped drive without the SQL Server stuff.  I'll get to that on Monday.
 



 

Posted: May 16 2008, 09:58 PM by du8die | with 2 comment(s)
Filed under: , ,
app_offline.htm

This is probably old news, but if you temporarily need to take an ASP.Net Application offline, simply drop a file called app_offline.htm into the root directory of the app. This could be helpful when upgrading a live app.  That way, you don't get the ugly app errors that often crop up.  Like I said, old news to most of you, but still a helpful reminder. 

Posted: Mar 13 2008, 09:53 AM by du8die | with 3 comment(s) |
Filed under: , ,
Render the contents of a ReportViewer control directly to PDF.

Rendering the output of a ReportViewer control (SQL Reporting Services) directly to PDF is fairly easy. It involves simply rendering the Report Viewer output to a byte array, and then pushing it to a MemoryStream object and writing to the Output Stream. Code below:

Dim warnings As Warning() = Nothing

Dim streamids As String() = Nothing

Dim mimeType As String = Nothing

Dim encoding As String = Nothing

Dim extension As String = Nothing

Dim bytes As Byte()

bytes = ReportViewer1.ServerReport.Render("PDF", Nothing, mimeType, encoding, extension, streamids, warnings)

Dim
ms As New System.IO.MemoryStream(bytes)

Response.ContentType = "Application/pdf" 

Response.BinaryWrite(ms.ToArray())

Response.End()

More Posts Next page »