that fixed it!

Unit Testing – wow, I spent two days and the issue seems to have been just my misunderstanding of how stateless each unit test is.
I was trying to test a push and a pull from a local cache storage (instead of using web application cache, I switched to MemoryCache (.Net 4).

The problem was that I was saving in one test and trying to read in another test. And it’s an unfortunately long story, but when I finally just made one test method which saved and then read, it all worked.

I knew that I couldn’t count on tests being run in a certain order, but I was trying to run things by hand from Test Explorer. Sometimes it would work, but I just shot at least 12 hours trying to get something to work that I should have just spent 3 minutes on doing it the easy way.

(sorry about this post all in an image … I’m not skilled enough at word press to format all my bracket characters)

here is what finally worked
we took out as much razor as possible, and now I’m happy. I failed to catch another error in the image of all my travails with this – we got the asp.net system message that echoed to the screen, and the fix for that was to put in a “using” statement … and I could not get this to work in a reasonable amount of time. (less than 4-6 hours) Less razor is a good thing.

the razor code:
I think it’s best to do what we need in a function.
I put presentation layer code in my view model

‘ purpose – called by the css to show or hide the paging section based on whether there are more than
‘ one page or not
Public Function NotPaged() As String
Dim sRet As String = “”
If (Not isPagination) Then sRet = “display:none; height:0px;”
Return sRet
End Function

I’ve been connecting to three or four oracle databases off and on for about 5 years.

In a new project, I added a new entry to TNSNames and tried to connect to a new database, and I spent close to 12 hours trying to get it to work.

I may have had a problem with my tnsnames entry … but what seemed to do it finally was this:

Oracle looks for the tnsnames.ora file in the directory defined in the TNS_ADMIN environment variable – If you are running as different users, then maybe the TNS_ADMIN environment variable is not set, and therefore it cannot find the file?

could we live without stack overflow?

also, in the process I made sure to install the ODAC stuff downloaded from oracle.com.

But the fact that visual studio server and also my programs could connect to other oracle databases also defined in the same tnsnames.ora file is something I may not ever understand.

3) we load the list from a datatable4) then later in the code, we find an element in the list based on the user netid, and return some values. Frankly, I don’t understand the syntax. To me, it looks like LINQ, but I guess the Find function of the generic list is calling my little inline delegate function … or something like that.

The exception I get (sporadically – about 5% of the time, I think) is:

ERROR: System.NullReferenceException:
Object reference not set to an instance of an object. at
System.Data.SqlClient.SqlDataReader.ReadColumnData() at System.Data.SqlClient.SqlDataReader.ReadColumnHeader(Int32
i) at System.Data.SqlClient.SqlDataReader.ReadColumn(Int32
i, Boolean setTimeout) at
System.Data.SqlClient.SqlDataReader.GetValueInternal(Int32 i) at
System.Data.SqlClient.SqlDataReader.GetValue(Int32 i) at
System.Data.SqlClient.SqlDataReader.get_Item(String name)

Note – there are no null columns in my data, and this code has worked for years.

When I converted my code to get a datatable, then loop through the rows, my troubles went away. I haven’t run that in production yet, but it looks very hopeful.

This points out that I don’t quite understand the process as a reader loops and reads. It seems like it loses its schema along the way and loses track of columns.

When I get a datatable, it pulls in everything, then I close the connection. It just works more stably. We’ve seen issues on this database server in the past – but those were with writes, not read like this time.