Excel VB.Net constants reference

Share on Facebook

I just felt like contributing to the visibility of these constants on the web. If you try to port VBA code from VB 6.0 to the .Net environment using VS 2003/5/8 interop assemblies for Excel, you will quickly find out that the Excel constants (typically with prefix Xl and format Xlxxxxx) no longer have global visibility. Each set of constants have been grouped into a type.

It is a pain sometimes trying to figure out the appropriate type for the constant. Luckily an MSDN page lists all the types. The page is at:

http://msdn.microsoft.com/en-us/library/aa221100(office.11).aspx# 

 

Hope this helps.

 

Cheers! 


Networked .Net App with Crystal Reports Keycodev2.dll

Share on Facebook

I had a desktop application developed in asp.net 2003 which deployed some crystal reports with the built in Crytal Reports .Net edition.

I have always wanted to deploy the application for network use, to make it easier to roll-out maintenance and upgrades to the core program. I have however always had difficulty in doing so because of Crystal Descisions keycodeV2.dll file which by default is at the location C:\Program Files\Common Files\Crystal Decisions\1.0\Bin. 

If I then run the program from a server network share, the program launches on the workstation alright, but anytime, I access any of the embedded crystal reports, the program brings up an error that it "cannot find keycodev2.dll or invalid keycode". I therefore had to put up with creating a setup project after every update and uninstalling and re-installing the program on all client workstations after evry modification to the program.

Today I found a way out. How?, well it turns out, it is possible to place a copy of the valid keycodev2.dll from the directory above into the same share location from which you launch the program. Is that the fix?, no not yet, in addition to that, you need to launch the .Net framework configuration tool from control panel\Administration tools\Microsoft.Net framework 1.1 Configuration and perform the following step:

1. click Configure code access security policy

2. click Increase Assembly Trust

3. Choose Make Changes to this computer or Make changes for the current user only depending on your needs

4.Click Next

5. Click Browse and select the .dll or .exe file for your program and click Next

6. Drag the slider to Full if you TRUST your program 

7. Click Next and then Click Finish

 

If all went well, you should be able to create a shortcut to the .Net program fom the Network share and run the program without any permission errors and also have Crystal reports use the keycodev2.dll file from the share location.

HTH.


SQL Server Integration Services package fails on DataReader

Share on Facebook

I had an Integration services package which I scheduled as an SQL server Job in SQL Server Management Studio and was working fine. A while later, I did some folder organisation on the server drive containing the ODBC Database in use by the IS Package (In this particular case, it was a Sage Line 50 ODBC Datasource). In my re-arranging files to mirror the structure on another server, I created fileshares which pointed to actual folders mapped then to drives using 'net share' command in login script.

Well, I discovered the scheduled IS packages were no longer running to success but failing. I was able to run them from SSBIDS (SQL Server Business Intelligence Development Studio), but they failed to execute from Management Studio as a job. I tried all tricks and it simply would fail.

To cut a long story short, I decided to simply try changing the ODBC Data Source path and not use the mapped drive and shared folder, but use the actual physical path to the package, and BINGO, It started working again. So if you have a similar problem, might not necessarily be an exact fix, but I hope this will point you in the right direction or at least give you another possible solution to try.

Cheers!


how to limit store.exe memory on SBS 2k3 box

Share on Facebook

Because SBS 2k3 runs more services on one box than a normal win 2k3 server, memory usage is crucial and one cannot afford to have a single service process hogging all available memory on the SBS 2k3 box. If you are like me, you've noticed and watch in horror, while store.exe uses over 500MB of memory (as per task manager) and googled for ideas with no joy. The reason I decided to amplify this solution I came across was because most of the articles I found online suggested more or less to live with it or increase RAM on the box. I however stumbled on this blog post by JIM McBee which provided a way of limiting the Store.exe memory. The article was written for Exchange 2007 but worked equally well for me running Exchange 2003 on SBS 2k3 R2. There is no use duplicationg the steps as they are ellaborately presented in that blog post.

Hope it saves somebody the headache.


Asp.Net Out of Memory Exceptions and <gcServer=false /> setting

Share on Facebook

This was such a life saver, I had to quickly document it here to save someone else the trouble. To begin with I am surprised, there are not that many hits on google about this particular setting in the aspnet.config file which can continously crash your server over and over.

This is the issue, I maintain an Asp.Net 2.0 web application which runs in its own application pool on a 64 bit multi-processor virtual server hosting space. The KEY here is the multi-processor bit. Apparently, the .Net Common Language Runtime (CLR) uses a server garbage collector in such environments which allocates a separate garbage collector instance for each processor's separate memory heap. This can very quickly result in excessive memory usage during garbage collection and eaily bring the server down and start displaying Server Unavailable messages to clients.

Well, that is the issue, what of the solution?. As it happens, there is a very simple solution. To workaround this behavior, configure the CLR to use the Workstation garbage collector:1. Open the Aspnet.config file in Notepad.exe. The file is located at %SystemRoot%\Microsoft.NET\Framework\v2.0.50727\Aspnet.config for .NET Framework 2.0 and at %SystemRoot%\Microsoft.NET\Framework\v1.1.4322\Aspnet.config for .NET Framework 1.1.2. In the section httpRuntime, add <<gcServer="false" />> (only one set of angle brackets!!) 3. Save the Aspnet.config file.

 


Memory limit on ISA Server 2004 MSDE Instance (MSSQL$MSFW) on SBS 2k3

Share on Facebook

If you run SBS 2k3 R2 like I do and have the premium version, ISA server 2004 will be installed by default (OEM). On such a box, I noticed high memory usage by an sqlserver process in task manager. Problem is because there are no process ID's in task manager, it is difficult to tell which instance of sqlserver was the culprit. To solve that mystery, I had to rely on the tool set developed by Mark Russinovich and his buddies at SysInternals. Among the toolset is a utility called Process Explorer (procexp.exe). I run this program and double clicked on all the sqlserver instances running and was able to view the process image by clicking the image tab on the properties dialog. I was then able to identify the sqlserver instance using up to 500Meg on the SBS box as MSSQL$MSFW, which is the MSDE instance for ISA server logging.

After identifying the culprit, the second stage is dealing with the high memory usage. For that, since it's a SQL server instance, I was able to use SQL server Management Studio (You could also use Enterprise Manager Or even Management Studio express) to connect to the database instance, right click on the instance icon, select properties. In the properties dialog, select the Memory tab/link either at the left side or at the top of the dialog. In the memory settings, Change the "Maximum server memory (in MB) setting from the default high figure to say 256. Click OK.

NB: You will have to play with the settings to see what value works well for other services running on the box. In my case 256 did the trick. May be different figure in your case, but the solution remains the same.

Also, note that if you set this too low, ISA server will not function properly and might affect network connectivity. As a side issue, this presented itself in my case where Remote Web Desktop Connection built into SBS stopped working.  I could connect to workstations using normal Remote Desktop Connection (RDC), but not via the RWW interface. I then adjusted the memory setting upwards and restarted ISA Service, then bingo, the RDC via RWW started working again.

 


How to clear or remove stranded Sage line 50 users

Share on Facebook

I found very little information available online on the subject and so felt the need to write a few lines to save someone else the agony.

The problem occurs with Sage Line 50 using data files running off a mapped server drive. In such a setup, if a user on a workstation for whatever reason looses connection with the server, the users session (linked to the particular workstation ID) is kept open in the user session database file. This stranded user session then prevents access to major maintenance tasks and backups.

If the user wasn't updating any files at the time of disconnection, then it is possible to logon to any workstation as the sage user and re-connect to the stranded session, and thereby terminate it.  If however the user was updating files when the disconnect happened, then in most cases it is possible to logon to the specific workstation concerned (provided it is available and the workstation ID has not changed) and re-connect to the session.

Consider a scenario where for some reason, the workstation ID changes (due to domain migration or upgrade), or the workstation is de-commissioned and is no longer available. This was the situation I faced. The situation was triggered by Microsoft's WSUS system which pushes volumes of windows updates onto the Server and Workstations. After such an update rollout and reboot, some workstation IDs changed for Sage line 50 (I don't know why and would value any info on how sage deduces its workstation IDs) and I was unable to log back into a session in order to terminate it. I searched online for some options or fixes for the situation but found no way to do this. I then had to hunt through the Sage data files in the ACCDATA folder to find a data file holding the data. I tried a few without joy, and then finally with some stroke of ingenuity, I replaced the QUEUE.DTA file with a copy from a fresh sage install, fired up sage and the stranded user was gone!!

I definitely hope it saves someone the headache, especially when working with impatient users. 


MS Ajax SlideShowExtender operation aborted error on IE

Share on Facebook

I have had to deal with one of those needle in a haystack kind of errors for the past few days and after finally pin pointing the source of the error, I felt the obvious need to document the problem, just in case it saves someone else the time and headache it took me to figure it out.

Basically, the problem occurs when you use a MS Ajax SldeshowExtender control on a page with <script> tags which importing javascript files into the asp.net page.

The dreaded Internet Explorer, operation aborted error was persistently occuring even after I had striped the page bare of all components.

Eventually, after hours of troubleshooting, I pinned the problem down to the google analytics tracking code inserted before the closing </body> tag on the page.

When I took out the tracking code, the error ceased. But I still needed the tracking code so I moved the <script> tag which imported the javascript file from google to

the the <head> </head> section of the page, and left the other <script> tags at the position just before the closing body tag. </body>.

It is possible that there is an element naming clash between the SlideShowExtender javascript files aand the google analytics js files. The Internet Explorer Operation aborted error occurs when a child element attempts to modify a parent element. So moving the <script> import from google to the top might have fixed the problem because, at the time it is downloaded, the element name clash does not happen.

This might not be the exact solution for everyone, but I think it provides pointers and clues to help you fix a similar problem when you encounter one. kick it on DotNetKicks.com

 


VS 2008 and .NET 3.5 Web Designer Error

Share on FacebookI recently installed VS 2008 on my windows XP SP2 box to checkout the new features everyone has been talking about. The installation went smoothly to completion, but I had problems getting the web designer to work for any web site/web application project I created with VS 2008. I had the same experience on my Dell laptop running Vista. After many hours of trying to figure out the problem and also googling for similar experiences, I realised there was very little material on the problem available online.

Although the symptons were similar, the underlying causes and solutions are totally different.

While trying to fix the windows XP version of the problem, I came across this .Net forum post which offered some suggestions for the Vista problem. I got home and tried it and it fixed the Vista version of the problem.

The following morning I googled again with a few variations of my search and found a post here which addressed the XP version of the problem. I was surprised at how simple the solution was, after spending so much time installing and uninstalling components of VS 2008.

I hope this post helps someone out sooner than the time I spent fixing this issue. kick it on DotNetKicks.com

ASP.Net dynamic update of web.config without loosing comments

Share on Facebook

I decided to write this short post because I did not "easily" find info in google when I needed some help on the above topic.

What I wanted to do was provide a means of updating web.config sections dynamically. I was able to do this,  but as  a  consequence, lost  all  my  comments in web.config.  Now, you and I know the importance of comments in web.config especially when it starts to get big and ugly, so this was not my preferred solution. In order to overcome this situation, I swapped out sections of web.config I intended to update at run-time into separate external configuration files using the configSource attribute.

A careful study of the Configuration.Save()  method of the System.Configuration.Configuration object which is a wrapper for a configuration file however revealed two overload methods. The first overload accepts one parameter and is the one that solved my problem. The parameter is an enumeration of type: ConfigurationSaveMode and has three values:
ConfigurationSaveMode.Full - Save everything
ConfigurationSaveMode.Minimal - Save only necessary changes
ConfigurationSaveMode.Modified - Save only modified values.

The third option to my surprised preserved all formatting in the configuration file and did not change the formatting of the file.

So my problem was solved by using the override method:
config.Save(ConfigurationSaveMode.Modified) where config is my configuration file wrapper object of type
System.Configuration.Configuration declared as follows:

Dim config As System.Configuration.Configuration = WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath)

That's it. Hope it helps someone.

kick it on DotNetKicks.com  


About Me

When not scratching my head for solutions to software challenges, I spend my time playing with my little boy - Michael Jnr.

Quotations

"Anger is never without Reason, but seldom with a good One."
Benjamin Franklin

Donate with PayPal - it

Calendar

<<  September 2010  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910

View posts in large calendar

Disclaimer

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

© Copyright 2005 - 2010

Search