Monday, 12 September 2016

convert DTS Package to SSIS

Go to SQL Server 2008 R2 from Programs. Open Business Intelliegence Development studio.

Create new Integration service project.

In Solution explorer go to SSIS Package folder. Right click on Migrate DTS Package.

In pop up box from Source dropdown select structured storage file

then browse your dts package. That's it.

Tuesday, 9 August 2016

Read Google Spreadsheet thorugh Google Sheet API

To read excel sheet follow the below link.

https://developers.google.com/sheets/quickstart/dotnet


Implement olark with google tag manager

Follow the step as per below link

https://www.olark.com/help/google-tag-manager

After then in your page add below google tag manager code.

your GTM-Code will be the code which is generated when you follow the steps of above link.

  <!-- Google Tag Manager -->

    <noscript>
        <iframe src="//www.googletagmanager.com/ns.html?id=GTM-Code"
                height="0" width="0" style="display:none;visibility:hidden"></iframe>
    </noscript>
    <script>
        (function (w, d, s, l, i) {
            w[l] = w[l] || []; w[l].push({
                'gtm.start':
                new Date().getTime(), event: 'gtm.js'
            }); var f = d.getElementsByTagName(s)[0],
            j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : ''; j.async = true; j.src =
            '//www.googletagmanager.com/gtm.js?id=' + i + dl; f.parentNode.insertBefore(j, f);
        })(window, document, 'script', 'dataLayer', 'GTM-Code');</script>


    <!-- End Google Tag Manager -->

Bleow is sample screeen of google tag manager account your GTM code is at on the top at right side.


No need to add olark code in your page.

When you follow the steps of above link ask for Site ID in custom HTML. In that case you have to create your olark account after then it will provide you Site Id.

if popup of chat still  not come then check the checkbox of "send offline message" in Settings -> Behaviour & Text




Tuesday, 21 June 2016

The request was aborted: Could not create SSL/TLS secure channel.

If you got the error like this The request was aborted: Could not create SSL/TLS secure channel when you want to get response from HttpWebrequest object.

Here is simple solution just put below line before getting httpWebResponse.

ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;

if TLS 1.2 is not working then you can also write down as below.

   ServicePointManager.SecurityProtocol = (SecurityProtocolType)768 | (SecurityProtocolType)3072;
            ServicePointManager.Expect100Continue = true;

Monday, 16 May 2016

Add Custom output caching on listing page in asp.net mvc



Add below attribute on controller's method.

[OutputCache(VaryByParam = "None", VaryByCustom = "Host", Duration = 14400)]
public ActionResult Index(string category)

Add below method in gobal.asax file


        public override string GetVaryByCustomString(HttpContext context, string custom)
        {
            if (custom == "Host")
            {
                string sCategory = "";
             

                if (!string.IsNullOrEmpty(HttpUtility.ParseQueryString(context.Request.Url.ToString()).Get("CategoryName")))
                {
                    sCategory = HttpUtility.ParseQueryString(context.Request.Url.ToString()).Get("CategoryName");
                }
           

                return context.Request.Url.Host + context.Request.Url.Port + sCategory ;
            }
            return String.Empty;
        }

Tuesday, 10 May 2016

display 360 view of image using arqspin api call


string requesturl = "http://api.arqspin.com/nodeapi/search/"ArqspinAPIKey"?query=341;

this request send response like below

{"error":0,"spins":[{"shortid":"2g9yw634atmb5","title":
"341","caption":"","created_at":"2015-09-02T21:11:49.000Z",
"thumbnail":"http://spins0.arqspin.com/2g9yw634atmb5/thumbnail.jpg"}]}

create url using shortid in order to display in 360 view form

var resizeurl  = "//spins0.arqspin.com/iframe.html?spin=" + Obj360Image["spins"][0]["shortid"].ToString() + "&is=-0.16"


add above url in iframe src

<iframe style='border:solid 2px #ddd;' src='" + resizeurl + "' width=350 height=350></iframe>




below are the reference link

https://arqspin.com/seamlessly-integrate-spins-using-the-arqspin-query-api/

Open Model Popup using jquery


first add below js and css into your page.


1) jquery-{version}.js
2) bootstrap-model.js
3) bootstrap-model.css
4 ) bottstrap.min.css

Add below html code into your page.

   <div class="popupindex modal" id="mdProcesserror" style="top: 46% !important; margin-top: -281px;">
        <div class="modal-content" style="width: 169%; margin-left: -40%; ">
            <a href="#" data-dismiss="modal" class="popupmodel_close" onclick="resetModelPopUp()"> </a>
            <div class="modal-body">
                <div id="ProcesserrorBody">
                  Content Of Body
                </div>
            </div>

        </div>
    </div>


Add below styles


.popupindex.modal {
    width: 595px;
}
.popupmodel_close {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 30px;
    height: 30px;
    background: transparent url("../../../content/images/close.png") -40px 0px;
    cursor: pointer;
    z-index: 1103;
}

to open model popup when click on link button

  <a href="#" onclick="javascript: $('#mdProcesserror').modal();">Model Popup</a>