Tuesday, December 29, 2015

How to add command to crystal report

It is so confusing of using crystal report with database expert

under data tab

on the right side, select my connections, the sql db, then click on add command, then click on ">" button. It will prompt "Add Command to report" window.

Then you add SQL and Parameter

after you finish, if pass the syntax check, then you get it back to the Database Expert window, then you have to right mouse click on the "Command" to view the options to Edit, View or add to repository.

If you have two commands, then you have to link then using the link tab.

Visual studio view crystal report field explorer

open the rpt file
Go to view, other windows, document outline

Thursday, December 17, 2015

Issue resolution process

Issue

Option 1
   Impact
   Estimate: (cost)

Option 2
   Impact
   Estimate: (cost)

Monday, December 14, 2015

configuration transform extension for app config file

https://visualstudiogallery.msdn.microsoft.com/69023d00-a4f9-4a34-a6cd-7e854ba318b5

https://visualstudiogallery.msdn.microsoft.com/579d3a78-3bdd-497c-bc21-aa6e6abbc859/view/Reviews/0?showReviewForm=True

Wednesday, December 9, 2015

Common Web.Config transformations with Visual Studio 2010

http://weblogs.asp.net/srkirkland/common-web-config-transformations-with-visual-studio-2010

First, A Tiny Iota (That guy was great!) of XDT Review

As it pertains to web.config replacements, you need to know that every XML element can have two xdt attributes: xdt:Tranform and xdt:Locator
  • Transform: What you want to do with the XML element
    • You might want to Replace it, set an attribute (SetAttribute), remove an attribute (RemoveAttribute), etc.
  • Locator: Where is the element that needs transformation?
    • You probably want to transform an element that matches (Match) a specific attribute value

Case 1: Replacing all AppSettings

This is the overkill case where you just want to replace an entire section of the web.config.  In this case I will replace all AppSettings in the web.config will new settings in web.release.config.  This is my baseline web.config appSettings:
<appSettings>
  <add key="KeyA" value="ValA"/>
  <add key="KeyB" value="ValB"/>
</appSettings>
Now in my web.release.config file, I am going to create a appSettings section except I will include the attribute xdt:Transform=”Replace” since I want to just replace the entire element.  I did not have to use xdt:Locator because there is nothing to locate – I just want to wipe the slate clean and replace everything.
<appSettings xdt:Transform="Replace">
  <add key="ProdKeyA" value="ProdValA"/>
  <add key="ProdKeyB" value="ProdValB"/>
  <add key="ProdKeyC" value="ProdValC"/>
</appSettings>

Note that in the web.release.config file my appSettings section has three keys instead of two, and the keys aren’t even the same.  Now let’s look at the generated web.config file what happens when we publish:
<appSettings>
  <add key="ProdKeyA" value="ProdValA"/>
  <add key="ProdKeyB" value="ProdValB"/>
  <add key="ProdKeyC" value="ProdValC"/>
</appSettings>
Just as we expected – the web.config appSettings were completely replaced by the values in web.release config.  That was easy!

Case 2: Replacing a specific AppSetting’s value

Ok, so case 1 was the nuclear option, what about doing something a little more practical?  Let’s go back to our original AppSettings web.config example:
<appSettings>
  <add key="KeyA" value="ValA"/>
  <add key="KeyB" value="ValB"/>
</appSettings>

Let’s say that we just want to replace KeyB’s value to something more suited for a production environment.  This time we get to use both xdt:Transform and xdt:Locator.
Our strategy will be to define (in web.release.config) an appSettings section that has just the replacements we want to make.  It will initially look like this:
<appSettings>
  <add key="KeyB" value="ProdValA" />
</appSettings>
Now we want to add in the transforms so that we replace any appSetting that matches this key (KeyB).
<appSettings>
  <add key="KeyB" value="ProdValA" xdt:Transform="Replace" xdt:Locator="Match(key)" />
</appSettings>

Once we publish our resulting web.config file looks like this:
<appSettings>
  <add key="KeyA" value="ValA"/>
  <add key="KeyB" value="ProdValA"/>
</appSettings>

Perfect – We replaced KeyB but left KeyA (and any other keys if they were to exist) alone.

Case 3: Replace Compilation Debug=”true”

This is a simple one because Microsoft gives it to us out of the box – but I’ll reproduce it here anyway because it illustrates a common scenario and shows that there are more transforms then just Replace:
<system.web>
  <compilation xdt:Transform="RemoveAttributes(debug)" />
</system.web>
There are also ways to SetAttributes, Remove elements, Insert elements, and much more

To Infinity – And Beyond

We have obviously just scratched the surface, but for now that’s as deep as I need to go.  Until next time, you can look at the MSDN reference for Web.Config transformations athttp://msdn.microsoft.com/en-us/library/dd465326%28VS.100%29.aspx.
Enjoy!

find out pdf file size

Control D after open the file in Acrobat reader

Tuesday, December 8, 2015

Monday, December 7, 2015

Asp.net javascript read application settings

http://forums.asp.net/t/1226181.aspx?Reading+from+web+config+

   function ReadConfigurationSettings() {
            var wt = '<%=ConfigurationManager.AppSettings("DocPreviewWaitTimeInMilliseconds").ToString() %>'
            if (!isNaN(parseInt(wt))) {
                return parseInt(wt);
            }
            else {//defaul to 1 sec.
                return 1000;
            }
        }

Thursday, December 3, 2015

avascript Function Declaration vs Function expressions

https://tckidd.wordpress.com/2013/05/17/javascript-function-declaration-vs-function-expressions/

Wednesday, November 25, 2015

Thursday, November 19, 2015

Wednesday, November 18, 2015

How do you auto format code in visual studio?

http://stackoverflow.com/questions/5755942/how-do-you-auto-format-code-in-visual-studio

For Visual Studio 2010 or newer
To format a selection: CTRL + K + F
To format a document: CTRL + K + D
See more in edit -> advanced menu
Source/more information see here...

Tuesday, November 17, 2015

Pd4ml pdf rendering missing images

If pd4ml could not get image files from an URL,  then check IIS server

Monday, November 16, 2015

Javascript book

http://eloquentjavascript.net/

Javascript interview

http://www.toptal.com/javascript/interview-questions

IIS log location

%SystemDrive%\inetpub\logs\LogFiles
http://stackoverflow.com/questions/6426375/where-can-i-find-the-iis-logs
http://programming4.us/website/3684.aspx

Thursday, November 12, 2015

jquery.blockUI.js blockUI

http://www.drdobbs.com/windows/jquery-and-blocking-the-user-interface/225702258

The difference between + and & for joining strings in VB.NET

http://stackoverflow.com/questions/734600/the-difference-between-and-for-joining-strings-in-vb-net


There's no difference if both operands are strings. However, if one operand is a string, and one is a number, then you run into problems, 

Thursday, November 5, 2015

recall outlook email

You have to open the email, then find the section says Move and then Actions.

Wednesday, November 4, 2015

IIS Express authentication changes

http://stackoverflow.com/questions/4762538/iis-express-windows-authentication

select project and press F4

Friday, October 30, 2015

if CSS style sheet changed

Control  F5 to clear the cache to reload the style sheet

http://stackoverflow.com/questions/2263096/css-file-is-not-refreshing-in-my-browser


or weeks? Try opening the style sheet itself (by entering its address into the browser's address bar) and pressing F5. If it still doesn't refresh, your problem lies elsewhere.
If you update a style sheet and want to make sure it gets refreshed in every visitor's cache, a very popular method to do that is to add a version number as a GET parameter. That way, the style sheet gets refreshed when necessary, but not more often than that.
<link rel="stylesheet" type="text/css" href="styles.css?version=51">

Tuesday, October 27, 2015

run asm on visual studio

http://stackoverflow.com/questions/20078021/how-to-enable-assembly-language-support-in-visual-studio-2013

http://www.cs.virginia.edu/~evans/cs216/guides/x86.html

Wednesday, October 21, 2015

IIS relative path

<div style="WIDTH: 100%" class="pageTitleSection"><A href="/">
      <img src="Images/logo.png">

if web site setup on virtual directory, you can use web browser F12 key console to see if it can load image file. 'Images" is a folder in the VS project directory,

below dose not work:
img src="../images/logo.png"
img src="/images/log.png"
img src="../../images/log.png"

below worked:
img src="Images/logo.png"
img src="./Images/logo.png"

Friday, October 2, 2015

Assign value to session

 
                                Session(Util.ATTR_FORM_XML) = xml
                                Session(Util.ATTR_FORMNAME) = New Forms.xxx.xxx(xml)
                                Session(Util.ATTR_FORM_XKEY) = xKey
                                Response.Redirect("./formx.aspx?app=forms")

Thursday, October 1, 2015

Wednesday, September 16, 2015

facebook react

https://facebook.github.io/react/

IE logged in user id could not pass to the link web page triggered from the parent page

right click on IE press shift key down and select login as different user

Logged in as: COLUMBUS\xxxx on the parent page

and there is a link to start a child page from the parent page, some how COLUMBUS\yyyy is displayed, yyyy is the desktop login ID.

The above situation is fixed by recreate the user profile.


Monday, September 14, 2015

Notepad

http://www.technipages.com/add-reminder-notes-to-android-home-screen

Tuesday, September 8, 2015

The URL 'http://localhost:port#/' for Web project 'xxx' is configured to use IIS as the web server but the URL is currently configured on the IIS Express web server.

C:\xxx\yyy.vbproj : error  : The URL 'http://localhost:51854/' for Web project 'xxx' is configured to use IIS as the web server but the URL is currently configured on the IIS Express web server. To open this project, you must edit the 'C:\Users\zzz\Documents\IISExpress\config\applicationhost.config' file to change the port of the site currently using the URL in IIS Express.

http://rickgaribay.net/archive/2012/11/08/the-url-x-for-web-project-y-is-configured-to.aspx

To fix the above following section must be in project file.

 <ProjectExtensions>
    <VisualStudio>
      <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
        <WebProjectProperties>
          <UseIIS>False</UseIIS>
          <AutoAssignPort>True</AutoAssignPort>
          <DevelopmentServerPort>51854</DevelopmentServerPort>
          <DevelopmentServerVPath>/</DevelopmentServerVPath>
          <IISUrl>
          </IISUrl>
          <NTLMAuthentication>False</NTLMAuthentication>
          <UseCustomServer>False</UseCustomServer>
          <CustomServerUrl>
          </CustomServerUrl>
          <SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
        </WebProjectProperties>
      </FlavorProperties>
    </VisualStudio>
  </ProjectExtensions>

Friday, September 4, 2015

Angular js Web Api problem solver

blogs.msmvps.com/deborahk/angular-front-to-back-with-web-api-problem-solver/

Friday, August 28, 2015

Angular js mistakes

https://www.airpair.com/angularjs/posts/top-10-mistakes-angularjs-developers-make

Microsoft report viewer

https://msayem.wordpress.com/2013/02/04/how-to-create-a-dynamic-report-in-asp-net-using-microsoft-report-viewer/

Thursday, August 27, 2015

registry change to open GAC

http://stackoverflow.com/questions/9498234/how-to-view-the-folder-and-files-in-gac
  1. Launch regedit.
  2. Navigate to HKLM\Software\Microsoft\Fusion
  3. Add a DWORD called DisableCacheViewer and set the value to 1.

Foundation javascript

Grid

Wednesday, August 26, 2015

asp.net and crystal reports

http://www.codeproject.com/Articles/9847/Displaying-Exporting-and-Printing-Crystal-Reports

Asp.net virtual path

http://www.codeproject.com/Articles/723668/ASP-Net-How-to-map-virtual-path-to-physical-path

Tuesday, August 25, 2015

upgrade to .net 4.5 Iframe issue

http://stackoverflow.com/questions/17809446/iframe-parser-error-after-upgrading-to-net-4-5

You need to add below tag.
<asp:HtmlIframe>
In the designer change the control type to
System.Web.UI.HtmlControls.HtmlIframe
Add the below line in ur Webconfig
<controls>
 <add tagPrefix="asp" namespace="System.Web.UI.HtmlControls" assembly="System.Web"/>
</controls>
This should fix..

Crystal report for Visual studio

Crystal report for Visual studio
http://scn.sap.com/docs/DOC-7824

Monday, August 24, 2015

cannot-assign value to member xxx it does not define a setter

http://stevemichelotti.com/cannot-assign-value-to-member-xxx-it-does-not-define-a-setter/

Friday, August 21, 2015

webpack vs browserify

http://mattdesl.svbtle.com/browserify-vs-webpack

Return of false for onkeypress event no longer blocks input

http://forums.asp.net/t/1118932.aspx?Return+of+false+for+onkeypress+event+no+longer+blocks+input


 Return of false for onkeypress event no longer blocks input

06-06-2007 01:30 PM|LINK
I did find out how to solve my problem.  By changing the onkeypress event from:
onkeypress="return validNumeric(event);"  to
onkeypress="event.returnValue=validNumeric(event);"
 I now get the form to limit input in the zipcode textbox to numbers only and also keep the DefaultButton property on the Panel it is contained 

Thursday, August 20, 2015

refresh css need to use crtl-f5

http://stackoverflow.com/questions/385367/what-requests-do-browsers-f5-and-ctrl-f5-refreshes-generate

Generally speaking:
F5 may give you the same page even if the content is changed, because it may load the page from cache. But Ctrl-F5 forces a cache refresh, and will guarantee that if the content is changed, you will get the new content.

sample text file web site

http://lipsum.com/

Wednesday, August 5, 2015

Code review hosting

https://www.gerritcodereview.com/

Branch

Checkout a branch
then click on branch on the tool bar under file menu bar to create a branch

modify then commit, (then if want to patch then click on "" to do patch)

after commit then do push

select the push from and the remote want to push to

Sourcetree Show all files



Wednesday, July 29, 2015

Tuesday, July 28, 2015

Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive

http://www.codeproject.com/Questions/281518/Unrecognized-attribute-targetFramework-Note-that-a

Check the .NET version of Application pool in IIS. If application pool is running on .NET version 2 and the web.Config file specify .Net version 4, you get this error.
Note this may not be the only cause for your error. But check this.

How to enable assembly bind failure logging (Fusion) in .NET

http://stackoverflow.com/questions/255669/how-to-enable-assembly-bind-failure-logging-fusion-in-net


Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fusion]
"ViewerAttributes"=dword:56300949
"ForceLog"=dword:00000001
"LogFailures"=dword:00000001
"LogResourceBinds"=dword:00000001
"LogPath"="D:\\Logs\\bind\\"
"EnableLog"=dword:00000001

Monday, July 27, 2015

Saturday, July 25, 2015

Wiwo-s20

Wiwo-s20

http://www.cnx-software.com/2014/07/31/orvibo-wiwo-s20-wi-fi-smart-socket-features-us-eu-uk-or-au-plug-types/

Friday, July 24, 2015

SourceTree tutorial

https://www.atlassian.com/git/

pull down rep
stages files (ready to go file)
commit , snapshot of staged file

then push to master

https://www.youtube.com/watch?v=srXdUml4_HM

git for age 4 and up
https://www.youtube.com/watch?v=3m7BgIvC-uQ

https://answers.atlassian.com/questions/244429/unknown-user-in-sourcetree
git config --global user.name "Jennifer Connor"
git config --global user.email "your@email.com"

  1. The author name and e-mail is configured in Tools -> Options -> General.
    In Repository -> Repository Settings -> Advanced it does not matter if 'Use global user settings' is checked or not.

Sunday, July 19, 2015

ipad

iPad air with 64 GB memory, protect jackket, key board for sell.
Model MD790LL/A
 
Amazon link  Amazon price $525, sell price $349
 
Rugged Tough Jacket Amazon price $67.76, sell price $39
 
Keyboard Amazon price $54.99, sell price $29
 
Please contact me if you are interested. I work at IT department. Swiching to Microsoft Surface Pro 3, so no longer need this device.

Saturday, July 18, 2015

change actionlink color

<td>
                @Html.ActionLink("Details", "Details", new { _id = item._id }, new { style = "color: #000"}) |
                @Html.ActionLink("Register", "Register", new { _id = item._id }, new { style = "color: #000" })
            </td>
        </tr>

Wednesday, July 15, 2015

Unable to retrieve NT credentials. Make sure 'Anonymous Access' is disabled within IIS.

\Documents\IISExpress\config\applicationhost.config

  <authentication>

                <anonymousAuthentication enabled="false" userName="" />

                <basicAuthentication enabled="true" />

                <clientCertificateMappingAuthentication enabled="false" />

                <digestAuthentication enabled="false" />

                <iisClientCertificateMappingAuthentication enabled="false">
                </iisClientCertificateMappingAuthentication>

                <windowsAuthentication enabled="false">
                    <providers>
                        <add value="Negotiate" />
                        <add value="NTLM" />
                    </providers>
                </windowsAuthentication>

            </authentication>

Friday, July 10, 2015

VB.net Why reference not showing up?

I have a reference DLL added to the project, but import just would not see it.

Reason being the DLL was compiled to framework 4.5.2 and my project is 4.5.0, so that's the reason why it does not see it.

Google material design

Flat design

Thursday, July 9, 2015

.webinfo file needed when Can't open my VS2003 project: The project you are trying to open is a Web project. You need...

Re: Can't open my VS2003 project: The project you are trying to open is a Web project. You need...

Mar 05, 2007 12:44 PM|LINK

    <Web URLPath = "http://localhost/Folder/fred.csproj" />
Folder is the application name of the  in the IIS manager website properties
ex. xyzService is the application name


VB.net

<VisualStudioUNCWeb>
    <Web URLPath = "http://localhost/xyzService/xyzServices.vbproj" />
</VisualStudioUNCWeb>




To fix this error all you need to do is add a webinfo file.  If your using VSS for source control, it's probably a good idea to add the webinfo file to SourceSafe as well as this is not done for you automatically.
If you have a project file c:\Inetpub\wwwroot\Folder\fred.csproj then you need a corresponding webinfo file fred.csproj.webinfo.  The contents of the webinfo file looks like this:
<VisualStudioUNCWeb>
    <Web URLPath = "http://localhost/Folder/fred.csproj" />
</VisualStudioUNCWeb>
When you go to add this web project to your solution file you actually don't specify “Add Existing Project From Web”, but simply “Add Existing Project”, then browse to c:\Inetpub\wwwroot\Folder\fred.csproj

Visual studio 2013 missing convert to web application

http://stackoverflow.com/questions/19561982/visual-studio-2013-missing-convert-to-web-application

Convert to Web Application

Rest soap

[BasicHttpBinding = Soap 1.1], [WsHttpBinding = Soap 1.2], [WebHttpBinding = Rest] –  Frank Myat Thu May 19 '14 at 4:49

SetSite failed for package [JavaScriptWebExtensionsPackage]

Depends on which version of visual studio

C:\Users\[user]\AppData\Roaming\Microsoft\VisualStudio\1x.0\ActivityLog.xml

In order to fix the issue one needs to clear the VS cache under:
%LOCALAPPDATA%\Microsoft\VisualStudio\1x.0\ComponentModelCache

Wednesday, July 8, 2015

Replace code one line with multiple lines

https://visualstudiogallery.msdn.microsoft.com/699ce302-b0d4-4083-be0e-1682e873cebf

Thursday, June 25, 2015

ERROR: Failed to backup website http://localhost

ERROR: Failed to backup website http://localhost/....

just delete that project from solution and added it back from the correct file folder.


Wednesday, June 24, 2015

Troubleshooting 503 "service unavailable" errors

http://mvolo.com/where-did-my-iis7-server-go-troubleshooting-503-quotservice-unavailablequot-errors/

Saturday, June 20, 2015

Friday, June 19, 2015

Fix MHT if missing two "-" at the end of file

Below seemed to work for me.

  Sub Main()
        Dim inputfile As String = "c:\6.mht"
        FixMht(inputfile)

    End Sub
    Private Sub FixMht(ByVal tempFileName As String)
        Dim all As String = File.ReadAllText(tempFileName)
        Dim last As Integer = all.LastIndexOf("------=_NextPart_000_00")
        Dim newall As String = all.Remove(last)
        Dim builder As New StringBuilder
        builder.Append(newall)
        builder.Append("------=_NextPart_000_00--")
        File.WriteAllText(tempFileName, builder.ToString, Encoding.UTF8)

    End Sub

Tuesday, June 16, 2015

Execl can not take one ', you have to use two ''

I tried to concatenate strings enter one ' in one row, it will not do it, you have to use two ''

Monday, June 8, 2015

DB2 SQL needs less than 80 characters for mainframe FTP whatever

'This routine fix the input file which just SQL for DB2 and split them into less than 80 characters per 'line

Imports System.IO
Module Module1

    Sub Main()
        'Dim inputfile As String = "c:\aurorasql.txt"
        'Dim outputfile As String = "c:\out.txt"
        Dim inputfile As String = "c:\printer.txt"
        Dim outputfile As String = "c:\outprinter.txt"

        ' split SQL statement into less than length 80
        ' first separate by ","
        ' the first line has SQL command "insert" and it is default lenght is less than 80 so no need of comma
        ' others than need comma

        Using sw As StreamWriter = New StreamWriter(outputfile, True)

            For Each line As String In File.ReadLines(inputfile)
                'Console.WriteLine(line)
                Dim len = 80
                Dim arr = line.Split(",")
                For Each Str As String In arr
                    If Str.Length > 80 Then
                        sw.Write(",")
                        Dim arr1 = Str.Split(" ")
                        Dim str2 As String = String.Empty
                        For Each str1 As String In arr1
                            str2 = str2 & str1 & " "
                            If str2.Length > 70 Then 'this is just make sure total is less than 80
                                sw.WriteLine(str2)
                                str2 = String.Empty
                            End If
                        Next

                        sw.WriteLine(str2)
                        str2 = String.Empty
                    Else
                        If Str.Contains("INSERT") Then
                            sw.WriteLine(Str)
                        Else
                            sw.WriteLine(" ," & Str)
                        End If
                    End If
                Next

            Next
        End Using
        Console.WriteLine("done")
    End Sub

End Module

Saturday, June 6, 2015

SPA examples

http://jaliyaudagedara.blogspot.com/2014/06/creating-empty-aspnet-project-powered.html?m=1

Friday, May 29, 2015

Angular js filters

Ng-repeat | orderby 'field name'

$scope.sortorder

You can use a drop down list
So user

Thursday, May 28, 2015

unit test private methods by creating private accessor

http://stackoverflow.com/questions/250692/how-do-you-unit-test-private-methods
It might not be usefull to test private methods. However, I also sometimes like to call private methods from test methods. Most of the time in order to prevent code duplication for test data generation...
Microsoft provides two mechanisms for this:
Accessors
  • Goto the class definition's source code
  • Right-click on the name of the class
  • Choose "Create Private Accessor"
  • Choose the project in which the accessor should be created => You will end up with a new class with the name foo_accessor. This class will be dynamically generated during compilation and privides all members public available.
However, the mechanism is sometimes a bit intractable when it comes to changes of the interface of the original class. So, most of the times I avoid using this.
PrivateObject class The other way is to use Microsoft.VisualStudio.TestTools.UnitTesting.PrivateObject
// Wrap an already existing instance
PrivateObject accessor = new PrivateObject( objectInstanceToBeWrapped );

// Retrieve a private field
MyReturnType accessiblePrivateField = (MyReturnType) accessor.GetField( "privateFieldName" );

// Call a private method
accessor.Invoke( "PrivateMethodName", new Object[] {/* ... */} );