SSIS FTP Error#

Connection can not be established.  Server name, port number, or credentials may be invalid.

I just got that message when trying to enter a perfectly valid set of connection/credential info into an SSIS package.  But testing the connection failed.

Turns out my issue, and maybe your issue too, is that SSIS doesn't remove white space from the server name textbox.  So if you pasted in the name of the FTP server, as I did, you might have fallen victim to the "trailing space" that is frequently copied with your text, and instead of trying to connect to "ftp.com" it tried to connect to "ftp.com " notice the extra space.

Categories:
Friday, May 22, 2009 3:41:28 PM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

Getting error reports when a SQL Reporting Subscription Fails#

If you are like me, you don't like the fact that the first time you realize that a data driven subscriptions in SQL Server Reporting Services has been failing is when someone comes up to you and says "Hey, I did XYZ and I never saw the server kick off an email." 

Really?  Let me check.... oh, looks like it has been broken for god knows how long.  What the heck?

Well, I wrote a script to notify you when there are errors on the report server.

First, you need to setup Database Mail.  Expand Management, and pick Database Mail.  For my script I used the name "Email Profile" for the "Email Profile" get it?

Then create a trigger on the ExecutionLogStorage table like this:

USE [ReportServer]
GO
/****** Object:  Trigger [dbo].[ExecutionLogStorage_Insert]    Script Date: 05/13/2009 10:20:44 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER TRIGGER [dbo].[ExecutionLogStorage_Insert]
ON [dbo].[ExecutionLogStorage]
AFTER INSERT
AS 
BEGIN
    DECLARE @sStatus AS NVARCHAR(32)
    SET @sStatus = (SELECT Status FROM inserted)
    
    IF(@sStatus <> 'rsSuccess')
    BEGIN
        DECLARE @sReportName AS NVARCHAR(425)
        DECLARE @sPath AS NVARCHAR(425)
        DECLARE @ReportId AS UNIQUEIDENTIFIER 
        DECLARE @sUserName AS NVARCHAR(260)
        DECLARE @sParameters AS NVARCHAR(4000)
        DECLARE @dTimeEnd AS DATETIME 
        DECLARE @iTimeProcessing as int
        
        
        SELECT 
          @sReportName = Name,
          @sPath =PATH,
          @ReportId = ReportId,
          @sUserName = username,
          @sParameters = (select CAST(ISNULL(ELS.Parameters,'') AS NVARCHAR(4000)) from ExecutionLogStorage ELS Where LogEntryId = Inserted.LogEntryId),
          @dTimeEnd = TimeEnd,
          @iTimeProcessing = ISNULL(TimeProcessing,0)
        FROM inserted INNER JOIN [Catalog] 
        ON inserted.ReportId = CATALOG.[ItemID] 
        
        DECLARE @sBody VARCHAR(8000)
        SET @sBody = 'Error with SQL Report ' 
                    + CAST(@sReportName AS VARCHAR(100))
                    + ' at path ' 
                    + CAST (@sPath AS VARCHAR(250))
                    + ' with ReportId ' 
                    + CAST(@ReportId AS VARCHAR(100)) 
                    + ' and username ' 
                    + CAST(@sUserName AS VARCHAR(100))
                    + ' Parameters ' 
                    + CAST(@sParameters  AS VARCHAR(5000))
                    + ' End time ' 
                    + CAST(@dTimeEnd AS VARCHAR(50))
                    + ' Status ' 
                    + CAST(@sStatus AS VARCHAR(50))
                    + ' Time Processing '
                    + CAST(@iTimeProcessing AS VARCHAR(50));
        
        DECLARE @sSubject VARCHAR(500)
        SET @sSubject = 'Error With Report ' + @sReportName
        
        EXEC msdb.dbo.sp_send_dbmail 
         @profile_name = 'Email Profile', 
         @recipients = 'email@address.com', 
         @body =  @sBody  ,
         @subject = @sSubject;

    END
    
END

Presto!

 

UPDATE: Added logic to get the status and parameters.

 

Categories:  |  |  |  |  | 
Wednesday, May 06, 2009 3:55:06 PM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

Finding if SP Parameters are Nullable#

I'm working on something where I wanted to know if some parameters to a SQL Server Stored Procedure were nullable (or, in otherwords, if they had a default value).

The API I was working with provided a way to find info about the SP, but the isNullable value was never accurate.

I tried working with with the MS DAABs which have a way to fetch SP parameter info, but this method also produced faulty information.

Looking into the code of the DAAB, it was internally calling:

Dim command As SqlCommand

SqlCommandBuilder.DeriveParameters(command)

Somewhere I came across some code for the DeriveParameters method (I think from the Mono project maybe?) which showed it calling this system SP:

sp_procedure_params_rowset

Which returns output fields,:

PARAMETER_HASDEFAULT

IS_NULLABLE

But, again, neither of these appear correctly.

However, I finally came across this thread where a MSFT poster indicates that this data is simply not available:

http://social.msdn.microsoft.com/forums/en-US/transactsql/thread/900756fd-3980-48e3-ae59-a15d7fc15b4c/

Instead, you need to parse the SP definition to see what the default parameter value is, which is a pain, but at least I know why these other methods kept not working.

 

Categories:  |  |  | 
Saturday, April 25, 2009 9:55:55 PM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

Avoid Overwriting Modified SPs With Code Generation#

One of the challenges of using code generation is to avoid overwriting your custom changes when you re-generate the code later.

This is a trick I am using to avoid overwriting my stored procedures if I update them manually.  The trick is to include a comment indicating that the SP has been code generated, and then to remove that comment if you update the SP.  So lets say that you generate:

CREATE PROCEDURE OrderDetails_Get
@OrderId as int
AS
-- CODE GENERATED
SELECT * FROM
OrderDetails
WHERE
OrderId = @OrderId

and you made some customizations to the SP so it now looks like this:

CREATE PROCEDURE OrderDetails_Get
@OrderId as int
AS
SELECT * FROM
OrderDetails
INNER JOIN
Orders ON
Orders.OrderId = OrderDetails.OrderId
WHERE
OrderId = @OrderId

The following code will help you when generating your SPs to avoid overwriting this change:

IF EXISTS(
  SELECT [definition] AS objectText 
  FROM sys.sql_modules 
  WHERE [object_id] = OBJECT_ID(N'OrderDetails_Get', 'P') 
  AND definition LIKE '%CODE GENERATED%')
BEGIN
   -- overwrite is ok
END

 

Categories:  |  |  | 
Saturday, April 18, 2009 8:37:55 AM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

Mozy ConnectionError1#

Do you frequently get ConnectionError1 when using Mozy?

Try this: change your scheduled backup time to something more random than 2:00am.  Try 2:09 or 2:41.

It's that simple.

Categories:
Thursday, April 09, 2009 8:13:51 AM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

I hate Verizon#

My lenovo came with Sierra Wireless MC5725 for use with Verizon's EVDO network.

VZAccess manager (Verizons POS software) told me today that there was a firmware update for my Sierra Wireless device.

This update failed, and now my device won't work.  I basically can't enable the device.  It doen't show up in my network list, and I can't turn it on using the fn+F5 screen.

Where can I get the firmware for this thing?  Sierra Wireless says they don't support these OEM devices, and Lenovo has nothing regarding firmware on their site, only drivers.

VZAccess Manager is one of the worst pieces of software I have ever had the chance to work with.  It never stops suprising me how crappy it can be, and yet I am still forced to use it every day.  I hate Verizon for doing this to me.

Categories:
Thursday, April 09, 2009 12:17:15 AM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

ASP.NET Apps Recycling Because of FCN Issues#

I have written before about some of the problems that a frequently recycling asp.net application can cause, espically if you are using session for anything.

ASP.NET Process Recycling Too Often

But I ran into a situation where the recycle was caused by the application itself for a client of mine.  I had bought and customized a asp.net application that allows my client to give THEIR clients access to a section of their site where they can upload/download/manage files very nicely.  But after moving to a new hosting environment, users kept losing their login sessions very quickly.

After some research, I found out that session was being used to track if the user was logged in, and session was being lost very quickly because the application was recycling.

I used the following code to help diagnose the cause for the application restarting:

(this goes in Application_End)

Dim runtime As HttpRuntime = GetType(System.Web.HttpRuntime).InvokeMember("_theRuntime", _
    BindingFlags.NonPublic Or _
     BindingFlags.Static Or _
    BindingFlags.GetField, _
    Nothing, Nothing, Nothing)

If runtime Is Nothing Then
    logger.Error("The application is closing at " & Now.ToShortDateString & " " & Now.ToLongTimeString)
    Return
End If

Dim shutDownMessage As String = runtime.GetType().InvokeMember("_shutDownMessage", BindingFlags.NonPublic Or BindingFlags.Instance Or BindingFlags.GetField, Nothing, runtime, Nothing)
'If shutDownMessage = "HostingEnvironment caused shutdown" Then
'    '*** this is normal, you can include this commented out section or not
'    Return
'End If
Dim shutDownStack As String = runtime.GetType().InvokeMember("_shutDownStack", BindingFlags.NonPublic Or BindingFlags.Instance Or BindingFlags.GetField, Nothing, runtime, Nothing)
'*** email this error
logger.Error(String.Format("The application is closing at " & Now.ToShortDateString & " " & Now.ToLongTimeString & " " & vbCrLf & vbCrLf & "_shutDownMessage={0}" & vbCrLf & vbCrLf & "_shutDownStack={1}", shutDownMessage, shutDownStack))


Dim log As New EventLog
log.Source = ".NET Runtime"
log.WriteEntry(String.Format(vbCrLf & vbCrLf & "_shutDownMessage={0}" & vbCrLf & vbCrLf & "_shutDownStack={1}", shutDownMessage, shutDownStack), EventLogEntryType.Error)

The cause was:

Directory rename change notification for 'APP PATH HERE.
Clients dir change or directory rename
HostingEnvironment caused shutdown

Because this app was now hosted with a 3rd party, I didn't have control over the environment to go see if there was an AV scanner or backup manager running that was touching the files.

However, I because I was able to reproduce the error in my dev environment, I was confident I could rule out those causes.

I eventually found that the problem was 2 fold:

1) The application allows the user to upload files/create folders that reside in subfolders of the application.  The app could think these changes require a recycle.

2) The application creates a temp folder for the user for each session under the root as well.  Changing folder structure can cause a recycle.

So what can be done?

Well, I adapted some code from a few places to turn off the FCN (File change notifications) for sub directories of the website.  This isn't easy to do if you don't have something to go off of, becaues you basically have to hijack your way into private methods on classes in the .net framework, using reflection to call methods that you shouldn't be accessing, in order to turn off specific behavior.

Here are the methods I created to help me do this.  I also have some log4net code in here, so you'll have to pull that out if you want to use this.

Private Sub TurnOffDirectoryMonitoring()
    Try
        Dim p As System.Reflection.PropertyInfo = GetType(System.Web.HttpRuntime).GetProperty("FileChangesMonitor", BindingFlags.NonPublic Or BindingFlags.Public Or BindingFlags.Static)
        Dim o As Object = p.GetValue(Nothing, Nothing)

        Dim f As FieldInfo = o.GetType.GetField("_dirMonSubdirs", BindingFlags.Instance Or BindingFlags.NonPublic Or BindingFlags.IgnoreCase)

        Dim monitor As Object = f.GetValue(o)

        Dim asdf As System.Reflection.MethodInfo() = monitor.GetType.GetMethods()

        Dim propIsMonitoring As System.Reflection.MethodInfo = monitor.GetType.GetMethod("IsMonitoring", System.Reflection.BindingFlags.Instance Or System.Reflection.BindingFlags.NonPublic)
        Dim bIsMonitoring As Boolean = propIsMonitoring.Invoke(monitor, Nothing)
        Dim logger As log4net.ILog = log4net.LogManager.GetLogger("File")
        logger.Info("Directory monitoring IsMonitoring was " & bIsMonitoring)


        Dim m As System.Reflection.MethodInfo = monitor.GetType.GetMethod("StopMonitoring", System.Reflection.BindingFlags.Instance Or System.Reflection.BindingFlags.NonPublic)

        Dim objArray() As Object = {}
        m.Invoke(monitor, objArray)

        logger.Info("Directory monitoring IsMonitoring after change is " & bIsMonitoring)

    Catch ex As Exception
        Dim logger As log4net.ILog = log4net.LogManager.GetLogger("File")
        logger.Error(ex) 
    End Try
End Sub

Private Sub CheckDirectoryMonitoring()
    Try
        Dim p As System.Reflection.PropertyInfo = GetType(System.Web.HttpRuntime).GetProperty("FileChangesMonitor", BindingFlags.NonPublic Or BindingFlags.Public Or BindingFlags.Static)
        Dim o As Object = p.GetValue(Nothing, Nothing)

        Dim f As FieldInfo = o.GetType.GetField("_dirMonSubdirs", BindingFlags.Instance Or BindingFlags.NonPublic Or BindingFlags.IgnoreCase)

        Dim monitor As Object = f.GetValue(o)

        Dim asdf As System.Reflection.MethodInfo() = monitor.GetType.GetMethods()

        Dim propIsMonitoring As System.Reflection.MethodInfo = monitor.GetType.GetMethod("IsMonitoring", System.Reflection.BindingFlags.Instance Or System.Reflection.BindingFlags.NonPublic)
        Dim bIsMonitoring As Boolean = propIsMonitoring.Invoke(monitor, Nothing)
        Dim logger As log4net.ILog = log4net.LogManager.GetLogger("File")
        logger.Info("In CheckDirectoryMonitoring, Directory monitoring IsMonitoring is " & bIsMonitoring)
    Catch ex As Exception
        Dim logger As log4net.ILog = log4net.LogManager.GetLogger("File")
        logger.Error(ex)
    End Try
End Sub

Private Sub CheckFCNMode()
    Try
        Dim p As System.Reflection.PropertyInfo = GetType(System.Web.HttpRuntime).GetProperty("FileChangesMonitor", BindingFlags.NonPublic Or BindingFlags.Public Or BindingFlags.Static)
        Dim o As Object = p.GetValue(Nothing, Nothing)

        Dim f As FieldInfo = o.GetType.GetField("_FCNMode", BindingFlags.Instance Or BindingFlags.NonPublic Or BindingFlags.IgnoreCase)

        Dim iFCNMode As Integer = f.GetValue(o) 
        Dim logger As log4net.ILog = log4net.LogManager.GetLogger("File")
        logger.Info("In CheckFCNMode, FCNMode is " & iFCNMode)
    Catch ex As Exception
        Dim logger As log4net.ILog = log4net.LogManager.GetLogger("File")
        logger.Error(ex)
    End Try
End Sub

These methods are not refactored or "best practice" at all, there is a lot of copy/paste code in here, but you'll get the idea of what I'm doing.

You can call these methods from the beginning on Application_Start. 

1 thing to note.  I found that my code that checks to make sure that logging was turned off, doesn't seem to report the right value the first time I check it.  But by the time the first session starts, it has indeed stopped monitoring.

Just try calling these methods from a few places after application_start and you can see what happens.

 

Categories:  |  | 
Thursday, April 02, 2009 12:27:04 PM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

Golden Rule of Winform Databinding#

Rocky Lhotka had this over on his site:

The Golden Rule of Windows Forms data binding

Never directly interact with a business object while it is data bound - only interact with the bindingsource

http://forums.lhotka.net/forums/thread/22990.aspx

I have to say, I am guilty of doing this, and I didn't even know it was considered a bad practice, but I do recall running into problems with the behavior in getting the UI to refresh as I would want it to.

I also found a nice article talking about how to speed up binding to the datagrid:
 
Categories:  |  | 
Monday, March 23, 2009 3:08:22 PM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

Why should you not use floats for actual decimal numbers?#

I don't think etrade has learned the lessons in my posts on floating point numbers/variables.

SQL Server Decimal/Money/Float datatypes

Javascript (and apparently other programming languages) can't do math

Click here for a screen shot of the full page.

Here is a link to the page where I found it. I hope they fix it soon. It's pretty sad.

But, on the other hand, I wonder what I will do with that extra .00000000000005 dollars?

Categories:
Monday, March 23, 2009 12:22:12 PM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

Trying to find the WIFI Switch on the HP Elitebook 8730w?#

It took me a while to figure out that I didn't have a driver problem.

I was looking everywhere to find the switch for the wifi on this HP Elitebook 8730w, but it turns out the LED icon in the upper left that shows the WIFI status IS the button, but clicking it does nothing.. why?

Well, b/c HP is using "LAN/WLAN switching" which means that it automatically turns off the wifi connection if you are plugged in.

Just unplug your network cable and your wifi card will enable! 

 

Categories:  | 
Sunday, March 22, 2009 10:28:44 PM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

SQL Reports RDLC Errors#

Ever get this error?

More than one data set, data region, or grouping in the report has 
the name 'SOMENAME'.  Data set, data region, and grouping names
must be unique within a report. 

Basically what happened was, somehow VS lost track of an existing datasource you were using, why I don't know. When you went to add a new field or change something it added a 2nd copy of the same datasource, and now you have 2 datasources with same name. You can't do that. To fix this, when you are editing the report, choose Report --> Data Sources from the menu and remove one of the duplicate datasource names.

In a related error, you may notice that you can't use some fields that are part of your dataset.  For example, in my app, I had a field called "CreatedDate".  This was a public property of my object, and it showed up in my data source that I was using to bind to the report, but the report refused to acknowledge it.

So in this case you need to delete the original datasource using the same steps as above, and do something to cause it to add a new copy of the correct datasource (like drag a field onto the report).

Categories:  | 
Sunday, March 22, 2009 4:32:16 PM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

Getting Started With OpenSTA#

I have been looking around for a quick easy load testing package.  Right now I'm trying out OpenSTA.  I can't say that it has been very direct, but I am still holding out hope that it will work.

This is the Getting Started Guide that I have been using.

Categories:  |  | 
Monday, March 16, 2009 1:19:16 PM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

Problems Upgrading VS Solutions to 2008 With CruiseControl.Net#

Problem:

We have a server that gets all files from TFS and uses Nant w/ Visual studio to compile our projects.  Basically nant issues a command line statement to get VS to build a given solution.

Everything was working great, until I upgraded our clients to 2008.

I went through and upgraded all our solutions.

I installed vs 2008 on the server.  But when I try to build from the command line, it tells me that the solution file "is from a previous version of this application and must be converted in order to build in this version of the application."

I tried directly copying my solution file (skipping the source control step) directly to the server but I get the same message.

If I try to build it from the command line with VS 2005 it tells me that the solution is too new!! 

So 2005 says the solution is too new, 2008 says it is too old!

The solution on the server has the "version 9" icon, just like on my laptop.

The solution file starts with:
Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008

Resolution:

Even thought I compared the solution files and found them to be exactly the same using a diff compare tool, I allowed the server to run the "upgrade" process on the solutions.  I didn't save any of the changes it made, but from then on it recognized those files as having been already upgraded.

I even replaced the "server upgraded" solution files with the old solution files that it didn't like and it continued to work just fine.

There must be some other files stored somewhere that made it think that it hadn't been upgraded yet.

This isn't a great solution, but it works at least.

 

Categories:  |  |  |  | 
Monday, March 16, 2009 9:43:30 AM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

Using Asyncronous Tasks In ASP.NET#

ASP.NET has a limited number of threads that it uses to service incoming requests.  Thes threads from the its thread pool, and when its collection of threads are busy, requests have to queue up waiting for an open thread.

But, what happens when you have threads that are blocking waiting for another process to complete?  This could we a database call, or a webservice call, or an IO operation etc.

Well, what happens is that the thread, while doing no real work, is unavailable to service requests.

So, if your database is crunching on some long queries, other simple web requests may be sitting in the queue unable to be handled, even though the webserver CPU is idle.

One solution to this is to use Async pages/methods in ASP.NET 2 or greater.

Async operations allow the thread to be returned back to the thread pool instead of blocking, while some process is executed.

 

There is more than 1 way to do async operations like this from asp.net pages. 

One is to use RegisterAsyncTask and the other to user AddOnPreRenderCompleteAsync as well as declare the page as Async="true".

I won't go into all the details, but AddOnPreRenderCompleteAsync is probably simpler, but you can't define a timeout, you can't call it multiple times in parallel, and in the EndAsyncOperation event handler you can't access things like the httpcontext object.

Here are 2 examples of pages that are asynchronously serving up a PDF document (which is itself served from a page DownloadPDF.aspx, which has a 5 second thread sleep in it to simulate the processing of the report on another server.

Using AddOnPreRenderCompleteAsync:

Imports System.Net
Imports System.IO

Partial Class AsyncServer
    Inherits System.Web.UI.Page

    Dim _request As WebRequest

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        AddOnPreRenderCompleteAsync(New BeginEventHandler(AddressOf BeginAsyncOperation), _
                                    New EndEventHandler(AddressOf EndAsyncOperation))
    End Sub

    Function BeginAsyncOperation(ByVal sender As Object, ByVal e As EventArgs, ByVal cb As AsyncCallback, ByVal state As Object) As IAsyncResult
        _request = WebRequest.Create(HttpContext.Current.Request.Url.Scheme & _
                                     "://" & HttpContext.Current.Request.Url.Authority & _
                                     Page.ResolveUrl("DownloadPDF.aspx"))
        Return _request.BeginGetResponse(cb, state)
    End Function

    Sub EndAsyncOperation(ByVal ar As IAsyncResult)
        Dim reportResponse As WebResponse = _request.EndGetResponse(ar)
        Dim reader As New BinaryReader(reportResponse.GetResponseStream())

        Dim buffer(reportResponse.ContentLength) As Byte
        buffer = reader.ReadBytes(buffer.Length)
        
        Response.Clear()
        Response.ClearHeaders()
        Response.ClearContent()
        Response.ContentType = "Application/pdf"
        Response.BinaryWrite(buffer)
    End Sub

End Class

 

But I prefer to use RegisterAsyncTask.  Now, keep in mind that many operations will already support async versions (webrequests, webservice calls, databases calls, file IO etc), but if there isn't already built in support for an async call, you can make your own method work in this framework with an async delegate.  Check out the commented code below for how you could do this, but because webrequests already support making the call in an asynchronous fashion, I don't need to.

Imports System.Net
Imports System.IO

Partial Class RegisterAsyncTaskServer
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Page.AsyncTimeout = New System.TimeSpan(0, 0, 8)
        Dim task As New PageAsyncTask(New BeginEventHandler(AddressOf BeginGetAsyncData), _
                                      New EndEventHandler(AddressOf EndGetAsyncData), _
                                      New EndEventHandler(AddressOf TimeoutGetAsyncData), "task1", True)

        RegisterAsyncTask(task)
    End Sub

    '*************** This is one way to do this if not using an async download method by creating an async delegate
    'Dim taskDelegate As AsyncTaskDelegate
    '' Create delegate.
    'Delegate Sub AsyncTaskDelegate()
    'Private Function BeginGetAsyncData(ByVal src As Object, ByVal args As EventArgs, ByVal cb As AsyncCallback, ByVal state As Object) As IAsyncResult
    '    Dim extraData As New Object
    '    taskDelegate = New AsyncTaskDelegate(AddressOf DownloadReport)
    '    Dim result As IAsyncResult = taskDelegate.BeginInvoke(cb, extraData)
    '    Return result
    'End Function
    'Private Sub DownloadReport()
    'End Sub

    Private reportRequest As WebRequest

    Private Function BeginGetAsyncData(ByVal src As Object, ByVal args As EventArgs, ByVal cb As AsyncCallback, ByVal state As Object) As IAsyncResult
        reportRequest = WebRequest.Create(HttpContext.Current.Request.Url.Scheme & "://" & _
                                          HttpContext.Current.Request.Url.Authority & _
                                          Page.ResolveUrl("DownloadPDF.aspx"))
        Return reportRequest.BeginGetResponse(cb, state)
    End Function


    Private Sub TimeoutGetAsyncData(ByVal ar As IAsyncResult)
        Response.Write("TIMEOUT")
    End Sub

    Private Sub EndGetAsyncData(ByVal ar As IAsyncResult)
        Dim reportResponse As WebResponse = reportRequest.EndGetResponse(ar)
        Dim reader As New BinaryReader(reportResponse.GetResponseStream())

        Dim buffer(reportResponse.ContentLength - 1) As Byte
        buffer = reader.ReadBytes(buffer.Length)

        Response.Clear()
        Response.ClearHeaders()
        Response.ClearContent()
        Response.ContentType = "Application/pdf"
        Response.BinaryWrite(buffer)
        Response.Flush()
    End Sub

End Class

Nice!

Categories:  |  |  | 
Friday, March 13, 2009 10:46:43 AM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

Verizon tried to bill me for Quick2Net service#

I spent over an hour arguing with people from Verizon about a charge on my bill for my EVDO card.

They charged me another 200 dollars for "minutes" used.  Clearly this is a mistake, as I don't use the chip embedded in my laptop like others use a cell phone.  It's impossible actually, seeing as how you hold a mobile phone up to your face and my device is embedded in my laptop :).

At first, they spent 20 minutes telling me that the extra charge was for VOIP calls.  This is a directly quote from the CSR: "For example, you can use Yahoo instant messenger to make VOIP calls where you talking to someone through your computer."

I continued to argue that they don't charge for VOIP traffic any differently than normal traffic.

3 times she told me that, yes, in fact they did, and it's right there in my contract.  I kept asking her to show me where that was in my contract, and of course there was nothing about it.

In fact, Verizon even advertises VOIP as on of the uses of getting an EVDO card and data plan.

Anyway... so eventually they changed their tune and started saying that it was because I was using their Quick2Net network.  I tried to get them to understand that making VOIP calls, and connecting to a different data network are nothing alike, but they continued to act as if they were 1 in the same.

After 45 minutes or so we were no longer arguing about Skype usage and were fully on the topic of the Quick2Net network.  The CSR couldn't even explain to me WHAT the Quick2Net network was, or HOW I could even connect to this network, IF I WANTED TO!

They had 2 times when they claimed I connected to the Quick2Net network for an extended period.  Both of these times conflicted with my local VZAccessManager logs of when I was connected to the BroadbandAccess Rev-A network, but the CSR didn't seem to care about the fact that my own logs conflicted with what they were trying to bill me for.

While I was on hold I did some research and found that the Quick2Net network is the ooooooooold data network that Verizon has.  It's speed is 14.4k, or about 100 times slower than the connection I already pay for.

In fact, when I found this screen shot, I remembered Quick2Net:

This was probably about 5 years ago when this option was available.  As you can see, you used to be able to click on Quick2Net (and it used to be free), but I haven't had that option available to me for years.

Finally, the CSR set me to her supervisor, who agreed to refund my charge, and setup my account so that I wouldn't connect to Quick2Net again.

But, not because I never really connected to quick to net, or because it was a billing error on their part, or because if I DID connect, it was through a fault of their software/network/switches.  No, they agreed because I wouldn't have "benefited" from the Quick2Net services (seeing as how I already pay for a 100x faster connection).  I made a point to let him know that I never connected to this service, but accepted the resolution.

If you are unfortunate as I was, and Verizon tries to bill you for this, good luck.

I didn't find anything online with people saying they had this same exprience, so I'm posting this in case others run into this same issue and are wondering what happened.

Categories:
Monday, March 09, 2009 11:25:06 AM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

NeatWorks vs Paperport#

I bought a cheap version of NeatWorks and downloaded a demo of Paperport from Nuance in an attempt to find a good option for digitizing all my mail.

My experience with NeatWorks isn't great.  It mostly works, but some problems have cropped up from time to time that make me have some concern.  For example, when I first installed the application it automatically searched for updates: it found one, and I installed the newer version of the app (newer that what was on the CD).

Well, it turned out over the next few days that much of the text that it would OCR would not make it into the search index.  So when you went to search for some keywords nothing would be found.

I contacted support and after walking me through a bunch of stuff, it turned out that there was a much newer version of the app available (but somehow their auto update didn't find it).  This new version seemed to fix this problem, but I basically had to rescan all my documents.  At that point, it was only a few, but what if I run into another problem after I have a few hundred scanned documents?

Speaking of a few hundred documents, right now I have 50 pages scanned and my database is 300MB.  This is insane!!  Even if you backup your data and compress it it ends up being like 500KB / page.  WAAAAAAY to large.  I guess it really isn't THAT big of a deal.  I mean if I end up with 5000 pages (100x what I have now) and my database is 30GB, it will really be stupid, but it won't really be a problem I guess. 

Another concern of mine with NeatWorks is lock-in.  What if I want to move to some other software product in the future?  How can I get my documents out of NeatWorks?  Well, it turns out not very easily.  You can export each document to a PDF, but you have to do it 1 at a time.  If you select multiple documents, it puts them into 1 giant PDF.  This is completely useless.  If you have 5000 pages and you want to start using some other PDF indexing product, it will take you forever to export all those files.  Also, you can only use the software with their scanners.

Also, last night I noticed that some receipt that I had scanned never showed up in my "inbox" (it goes from the Quick Scan to the Inbox).  This has me concerned.  I got no error message or any indication that something didn't work right.  It just never showed up.

Paperport has some nice pluses on its side.  It uses any scanner (not just 1 like w/ NeatWorks).  It stores all images as PDFs in a folder on your file system so you can manage them as you would any other file.

Reviews for PaperPort were not good, but others claimed the newer service pack fixed a lot of problems.  I did have it lock up on me once, but otherwise it seemed to work. 

The main problem with Paperport is it is trying to do to many things.  NeatWorks is for exactly what I am doing, Paperport is trying to be a fully featured Scanner software product, helping you to manage photos and stuff like that.  The UI is pretty poor also.

Basically though, the only reason I can't see myself using Paperport is that there is no way to attach and search by a date field.  I don't care about the date I scan a document (the file created date), I care about the date of the document.  So when I search for Mastercard statements, I can filter out what I want by date.  I didn't see any way to do this with Paperport.

Then when I went to submit a question to their support team asking about this, I was totally convinced to not buy their product (click for full size):

As many users have commented, it really does look like Paperport WAS a good product which has just morphed into a big, bloated, difficult to use product.

UPDATE: Now Nuance has changed me for the full product.  I'm guessing part of their trial is that they will automatically bill you for the software if you don't cancel your trial.  Wonderful, I am really glad I didn't pick Paperport: time to call and demand a refund.... again (they charged me 8 bucks for some BS extended download service on my free trial... these guys suck).

Categories:  |  | 
Tuesday, March 03, 2009 11:32:04 AM (Central Standard Time, UTC-06:00) #    Comments [3]  | 

 

The Pinocchio Paradox#

Think about it... :)

Categories:
Monday, March 02, 2009 4:17:49 PM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

SQL Server encountered error 0x80070422 (FIXED)#

Today we started getting this error when trying to do full text search with SQL Server 2008.

Msg 30046, Level 16, State 1, Procedure CodeMaster_GetCostCodesByCriteria_FullText, Line 47

SQL Server encountered error 0x80070422 while communicating with full-text filter daemon host (FDHost) process. Make sure that the FDHost process is running. To re-start the FDHost process, run the sp_fulltext_service 'restart_all_fdhosts' command or restart the SQL Server instance.

Google has NOTHING on this problem, except 1 other guy reporting it to MS, who tells him to go to some other forum.

Great.

If I find anything I will post it.

UPDATE:

Ok I figured this out.

The problem was that the actual FTS service was disabled (but not just that, so read on).

So go into your services and make sure that this one is running:

SQL Full-text Filter Daemon Launcher (MSSQLSERVER)

But even after I set this up running things weren't working.  More research led me to find out that there was an issue with the fact that we run our SQL Server under a domain account and the full text search was not running as that same user.

So I configured this service to run as the same user and restarted the service.

Then in SQL Server I ran this:

EXEC sp_fulltext_service 'restart_all_fdhosts'

to restart things.

I also right clicked on the FTS catalog (under databasename/Storage/Full Text Catalog), picked properties, and then selected the option to rebuild catalog.

 

Categories:  |  | 
Thursday, February 26, 2009 3:51:10 PM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

Regenerating the designer.vb and designer.cs files#

Chances are you have had this happen to you.

You start getting compile errors on your asp.net controls in your code behind pages.  But the controls exist on the page??  Whats the deal?

Well, in VS2003 the designer would create the class level controls in your code behind.  It would created a special region where it would put all it's autogenerated code.

2005 brought the new "Web Site Project" which used a "CodeFile" instead of "CodeBehind" attribute on the page tag.  In addition, the codefile/codebehind became a Partial Class.  VS would then put all the generated code in a seperate file so it didn't cramp up your code behind.

In Web Application projects, the autogen code is stored in .designer.vb files:

But everynow and then, things get out of sync, or the designer files get totally lost.

Here is how you can regenerate them:

First, make sure your class names, and page attributes are right.  The Page tag should have a Codebeind attribute pointing to the aspx.vb file and an Inherits attribute that contains the fully qualified class name in the codebehind.  (This instructions are for Web App Projects, not Web Site Projects, which use Codefile instead of Codebehind).

Second, create a designer file if one doesn't exist.  Click the "Show all files" icon in the Solution Explorer to see if you have designer files.  If not, add a class file with the right name page_name.aspx.designer.vb.  VS will automatically put it "under" the aspx page.

Make sure all namespaces are right.  Check your code beind, your designer file, and your page codebehind attribute.

Open your page in a designer and rename one of your controls.  Save everything and close the code and designer windows.  Open the designer back up and rename the control back.  Now look at your designer file, it should have a punch of controls in it, and now VS shouldn't complain about compile errors in your code behind.

 

Categories:  |  |  | 
Monday, February 23, 2009 4:07:35 PM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

Copy and Paste not working in RDP?#

You may notice that your clipboard will sometimes work over RDP(TS) sessions, but sometimes not.

Normally the problem is that the server has clipboard access disabled.

Just follow these instructions to enable it

1. Log into the TS (on an account that has administrator rights)
2. Run the Terminal Services Configuration program
3. Select the Connections folder (under Terminal Services Configuration on the left window pane)
4. Right-click on the RDP-tcp connection (in the right window pane) and select Properties.
5. Click the Client Setting tab
6. Un-tick the Clipboard Mapping option under the Disable the following: heading.

Presto.

Categories:  |  |  | 
Monday, February 23, 2009 11:17:12 AM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

All content © 2009, Christopher May, Inc
Open Job Positions
On this page
Google Ads
This site
Calendar
<July 2009>
SunMonTueWedThuFriSat
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678
Archives
Sitemap
Blogroll OPML
Disclaimer

Powered by: newtelligence dasBlog 1.9.6264.0

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

Send mail to the author(s) E-mail

Theme design by Jelle Druyts


Pick a theme: