Thursday, August 30, 2012

Cascading Dropdowns in JcdcHelper

(Post by Lloyd Bates)
In this example, the parent Drop list is named "SepTypeCd" and the child is "SepReason".
When an item is selected in the parent the change event looks to see if a child list is required to be available, if a child menu is needed, it populates it, if not it disables the child dropdown control.
With this pattern, we get to use the Ajax Wrapper function to allow getting all the error handling built in as a bonus.
This example has the "if" statement in it, but it doesn’t have to have it.
 
        $(document).ready(function () {
           … …
            $(
"#SepTypeCd").change(SepTypeCdChange);
           … …
        });
 
       
function SepTypeCdChange() {
           
//Get selected item from parent drop list
           
var sepTypeCd = $('select[name=SepTypeCd] option:selected').val();
           
            
//Check if selected item should fire load of child drop.                                         
            
if ((sepTypeCd == "538") || (sepTypeCd == "540)
            {
               
//Set action url
               
var actionMethodUrl = '@Url.Action("GetSepReasonDD","StudentLookup")';
               
                
//make Ajax call to Get JSON, note: the param "Id" matches the param in the MethodAction.
                JcdcAjaxDoGetRetrieveJson(actionMethodUrl, GetDDLDataSuccess, {
"Id" : sepTypeCd } );
            }
           
else {
               
//If child is not to be used, clear options and disable it.
                $(
"#SepReasonCd").empty().end();
                $(
"#SepReasonCd").attr("disabled", "disabled");
            }
        }
       
//Success function can hold all your business logic for before and after drop list is loaded.
       
function GetDDLDataSuccess(jsonDDLDispValueCV) {
           
//Load all the options to the dropdown.
            LoadOptions(jsonDDLDispValueCV,
"SepReasonCd");
        }
       
//This function could be moved to JCDCAjax.js
       
function LoadOptions(jsonDDLDispValueCV, passedInSelectId) {
            
//clear old options from drop list
           
var reasons = $("#" + passedInSelectId).empty();
                       
            
//Load new items in drop list from Ajax data
            $.each(jsonDDLDispValueCV,
function(index, option) {
                reasons.append($(
'<option/>', { value: option.Value, text: option.Disp } ));
            });
           
//enable drop down
            reasons.removeAttr(
"disabled").end();
        }

Wednesday, August 8, 2012

How to get VS2010 Group Headers to repeat on each page.


How to get VS2010 Group Headers to repeat on each page.

Do this:

http://www.jasinskionline.com/technicalwiki/(S(hludmc45qohv1i45zwzg4445))/Repeating-Row-Headers-SSRS-2010.ashx?AspxAutoDetectCookieSupport=1

Note that all statis fir a give group have to ahve all 3 settings set or it errors
(it still give warnings after but it works).


How to find advanced mode (this fix does not work but it has pics to help you find it.)
http://www.codeease.com/how-to-repeat-table-header-on-every-page-in-rdlc-report.html

Wednesday, July 25, 2012

Connection is busy. Use larger FetchBufferSize or enable connection cloning

Connection is busy. Use larger FetchBufferSize or enable connection cloning

 
Looks like Pooling is a setting on the ConnectionString in the web.config…

More things to try/ check (in order of how easy/likely they are). In case this doesn’t’ help. Take a look at #2 , #3 and #5 they are the most likely to start happening After a long time of things working correctly..


#1 Different Possible web.config workaround: (easy to try)
<
add name="SybaseDB" connectionString="host='******';Pooling=true;Port='5100';UID='*******';Password='******';Database='****';Min Pool Size=5;Load Balance Timeout=30;Max Pool Size=50;Workstation ID='CIS3G';Fetch Buffer Size=4096;Clone Connection If Needed=True" />

#2 Other application consuming to many resources can cause it:

 
#3 Router issue

Its from the oracle boards but it’s about the same error using the same brand of drivers.
Router/switch reset and  /PAE tags in
 might be the cause …
 

#4 New drivers from DDtek

#5 Badly handled Fk  error from Sybase
http://uxforums.progress.com/ddforums/message.jspa?messageID=1098

http://forums.datadirect.com/ddforums/thread.jspa?messageID=5105https://forums.oracle.com/forums/thread.jspa?threadID=822330&tstart=15portal servers boot.ini http://www.datadirect.com/resources/ado-net/connection-pooling/index.html

#6 
There is a bug in the driver that can cause this error, turn off pooling to fix it


 
 
7# IT group set idle connection timeout on the fire wall to 1 hr, from 8, set it back to 8 , and it fixed  it(8/13/2020- EWB)

Tuesday, June 26, 2012

In an RDLC formatting the date to shortDate sometimes fails and s#Error, even when the data looks perfectly good.

Change this:

=Format(Fields!SurveyCompDt.Value,"dd.MM.yyyy HH:mm:ss")

To This:

=IIf(CDate(Fields!SurveyCompDt.Value)=CDate("1/1/0001"),Nothing,CDate(Fields!SurveyCompDt.Value).ToShortDateString())
and it should go away.

The bug appears to have to do with the conversion of the dates.


Thursday, June 14, 2012

A quick and dirty way to diagnose a thread collision problem in c#

If you are having a problem that looks like it might be a rcing condition or other threading type issue, here is a quick and dirty test to determine if it's threading or not. Set up a scenerio that reproduces the error (say running it in several (10) threads in a constant loop overnight) Apply this attribute to your class [Synchronization] That forces all the instances of the class to run on a single thread (way slower). Re run your test. If your problem goes away, you have a threading issue. If speed is a concern, you need to go back and do all the locking around the code that touches that object. If you convert everything to use properties for the objects in question you can just lock the getter and setter. If the quick and dirty test fails to fix the issue, it's probabaly something else. For instance if you're using unsafe code or unsafe dlls (ie stuff written in non .Net c++), it might be a memory corruption problem.

Wednesday, January 18, 2012

Nuget Commands to remember

Get packagge by Verison
Install-Package JCDCHelper.BLL -Version 3.2.2.2

Uninstall all dependances
Uninstall-Package JCDCHelper. –RemoveDependencies –Force


Try to re-install the packages. Fixes bad references
At the NuGet console say:


Update-Package -Reinstall -ProjectName Your.Project.Name

Omit '-Project' parameter if you want to re-install packages and restore references for the whole solution.