Monday, 21 February 2022

Azure Questions Series - VMs

Please answer the below questions and leave me your email id in the comments if you need the answers to these



1.  Find true statements about Private IP Address
a. Internal (local) reach
b. External (global) reach
c. May be used by other devices in other private networks
d. A unique numeric code never reused by other devices

 

2. Find true statements about Managed Disks
a. Azure managed disks are block-level storage volumes that are managed by Azure and used with Azure Virtual Machines. 
b. Managed disks are like a physical disk in an on-premises server but, virtualized. 
c. With managed disks, all you have to do is specify the disk size, the disk type, and provision the disk. 
d. The available types of disks are ultra disks, premium solid-state drives (SSD), standard SSDs, 
and standard hard disk drives (HDD).
e. Using managed disks, you can create up to 50,000 VM disks of a type in a subscription per region


3. What is the difference between Managed Disk and UnManaged disk

        a. Managed disk charges for the storage size and well as the amount of space you use whereas Unmanaged disk charges for the storage size only

        b. Unmanaged disk is managed by the users and managed disk is managed by Azure

        c. Managed disk charges for the storage size you choose  whereas Unmanaged disk charges for the amount of space you use

        d.  Managed disk charges for the amount of space you use whereas unmanaged disk charges for the storage size you choose


4. Can you create encryption while creating managed disks

    a. Yes

    b. No

  

5. Match the disk type with the usage .     i. Ultra disk  ii. Premium SSD   iii. Standard SSD     iv. Standard HDD

    a. IO-intensive workloads such as SAP HANA, top tier databases (for example, SQL, Oracle), and other transaction-heavy workloads.

    b. Production and performance sensitive workloads

    c. Web servers, lightly used enterprise applications and dev/test

    d. Backup, non-critical, infrequent access

1. i - a , ii - b, iii - c , iv - d

2. i - b , ii - c, iii - d , iv - a

3. i - c, ii - d, iii - a , iv - b

4. i - d , ii - a, iii - b , iv - c


6. Which are true statements below

1. Availability set by default contains 5 update domains and 2 fault domains

2. Availability zone can contain multiple fault domains and update domains

3. Assuming there are 5 update domains, the fifth vm will be placed in fault domain 2 and update domain 4

4. When you deploy at least 2 vms in an availability set then you qualify for 99.99% SLA


7. Availability zone can fall in multiple regions. True or False?


8.  Which of the following Regions have Availability Zone

1. (US) West US 2.(US) East US 3. (Asia Pacific) South India 4. (Europe) North Europe


9. How to check if communication on a particular port is established between 2 VMs 

1. Subnet 2. Instranet 3. Telnet 4. Ping


10. What option does Azure have for Private Cloud


11. Find true statements related to VM Scale set

1. VM scale set costs 10% of the total VM cost

2. VM scale set is free

3. VM scale set comes with a default load balancer

4. You cannot attach a disk to VM scale set

 

12. Azure Disk Encryption is not available on

1. Basic A-series VMs 

2. VMs with less than 2 GB memory

3. Lsv2-series VMs

4. D-series VMs

5. E-series VMs


13. Which is the default encryption type in Azure

1.  Platform-managed key

2. Customer-managed key


14. True statements about secure boot option while creating VMs 

1. Secure boot enables to securely boot the VM

2. It is an antivirus to protect the OS

3. Secure boot helps protect your VMs against boot kits, root kits and kernel level malware

4. It is an option enabled when you choose Trusted launch virtual machine as the Security type


15. What is the standard way of authentication for Linux VMs


16. What is the difference between Availability set and Scale set. Find True statements

1. Availability set contains discrete set of VMs

2. Availability set contains contains identically configured VMs

3. Scale set contains discrete set of VMs

4. Scale set contains identically configured VMs

5. Scale sets are used for scalability and Availability sets are used for availability


17. What does the following network rule do



1. Denies all the outbound traffic

2. Denies all the inbound traffic

3. Denies both inbound as well as outbound traffic

4. Allows all the traffic but denies the ports



Tuesday, 28 May 2019

Muslims and elections

So the elections are over and those who were on the winning side are rejoicing and those on the loosing side are sulking. But wait a minute , so you are thinking that Hindus have won and Muslims have lost? Was this election about Hindus vs Muslims. Lets face it,  going by the campaign that BJP ran , they painted that picture. Ok ok lets not go down the same path. Lets look forward

So Muslims voted for Congress (C), but why? just because they are not lynching us? may be. But why else.. Is the notion that C have played with Muslims over the years totally wrong? No there is definitely truth in that. Lets leave the M factor lets see why else one should have voted for C , do they have a strong grass roots organisation? No, Do they have a strong leadership? No, Do they have intellectuals in their party who are projected as a group of decision making body? No, Did they provide a vision to the young voter? No

So what next , as Muslims i think we should be just focused on building ourselves as a community. Building in all respects like economic, education, social and off course building the nation. We should care less if someone is appreciating us in building the nation. The nation in ours as much as anyone else's so why should we care if someone is appreciating us. I think we should also care less as to who is in power . It doesn't matter who is in power, everyone has used us. Yes if there are atrocities then we should raise our voice within the parameters of law and just hope for the best 

Thursday, 31 May 2018

the type or namespace name 'office' does not exist in the namespace 'microsoft' Visual studio online

If you are getting this error while building your projects that use Microsoft excel in your projects, in VSO , VSTS , Jenkins or any other build server that you are using, then the solution is to remove the reference to Microsoft.Office.Interop.Excel and instead add the dll by installing the nuget package Install-Package Microsoft.Office.Interop.Excel -Version 15.0.4795.1000 

Thursday, 16 April 2015

Draggable Div and Droppable Table Columns

<%@ control language="C#" autoeventwireup="true" codebehind="ProjectOperationsControl.ascx.cs" inherits="Controls_ProjectOperationsControl" %>

<script src="../App_Themes/SolarTurbines/json2.js"></script>
<script src="../App_Themes/SolarTurbines/jquery.json-2.4.min.js"></script>

<script type="text/javascript">

    var swsOperations;
    var operationsToSend = "";
    var changeSequence = 0;
    var dropSqn = 0;
    var orderByGlobal = 2;


    $(window).load(function () {

        $('div.MembershipBar').hide();
        $('div.MembershipBarPlaceholder').hide();
        $('div#PageHeader').hide();
        $('div.Title').hide();
        $('div.OperationHeader').hide();
        $('div#PageFooterBar').hide();

        var w = window.innerWidth;
        var h = window.innerHeight;

        var lft = 840 + 'px'; //(w * 55) / 100;
        $('#swsdivcontainerparent').css('left', lft);

        window.resizeTo(w + 5, h);

    });


    $(document).ready(function () {
        BuildProject();

    });


    $(window).resize(function () {

        $('div.MembershipBar').hide();
        $('div.MembershipBarPlaceholder').hide();
        $('div#PageHeader').hide();
        $('div.Title').hide();
        $('div.OperationHeader').hide();
        $('div#PageFooterBar').hide();


    });


    function BuildProject() {

        if (typeof window.opener.projectId == 'undefined') {
            alert("The parent screen is closed or navigated to a different screen");
            window.close();
        }

        var dataPassed = new Object();
        dataPassed.projectId = window.opener.projectId;


        /*---------------Get Data [Start]----------------------*/
        //Web service call here to get data

        $.ajax({
            type: "POST",
            contentType: "application/json; charset=utf-8",
            url: "../DAF/Project.asmx/GetProject",
            data: $.toJSON(dataPassed),
            dataType: "json",
            success:
                 function (msg) {
                     if (msg && msg.d) {
                         var project1 = "";
                         var obj = jQuery.parseJSON(msg.d);

                         $('#ProjectsTR').empty();

                         $.each(obj, function (i, val) {

                             project1 = $("<td>" + obj[i].Project + "</td>" + "<td>" + obj[i].Description + "</td>" + "<td>" + obj[i].Status + "</td>");

                             $('#ProjectsTR').append(project1);

                             project1 = "";

                         });

                         BuildOperations(2);

                     }
                     else {
                         alert("Error occurred while fetching data. Please contact Administrator");
                     }

                     //Build the list of SWS
                     BuildSWS();
                 },
            error:
                 function (XMLHttpRequest, textStatus, errorThrown) {
                     alert("An error occurred. Please contact administrator.");
                     window.location = '../Pages/Home.aspx';
                 }
        });

        /*---------------Get Data [End]----------------------*/
    }


    function BuildOperations(orderBy) {

        if (typeof window.opener.projectId == 'undefined') {
            alert("The parent screen is closed or navigated to a different screen");
            window.close();
        }

        var sortOrder = $('#' + orderBy + 'sortord').val();
        orderByGlobal = orderBy;

        var dataPassed = new Object();
        dataPassed.projectId = window.opener.projectId;
        dataPassed.orderBy = orderBy;
        dataPassed.sortOrder = sortOrder;
        dataPassed.swsOperations = operationsToSend;


        /*---------------Get Data [Start]----------------------*/
        //Web service call here to get data

        $.ajax({
            type: "POST",
            contentType: "application/json; charset=utf-8",
            url: "../DAF/Project.asmx/GetAllOperations",
            data: $.toJSON(dataPassed),
            dataType: "json",
            success:
                 function (msg) {
                     if (msg && msg.d) {
                         BuildOperations2(msg.d);

                         var hiddenField = $('#' + orderBy + 'sortord'),
                         val = hiddenField.val();
                         hiddenField.val(val === "true" ? "false" : "true");
                     }
                     else {
                         alert("Error occurred while fetching data. Please contact Administrator");
                     }

                     //Build the list of SWS
                     BuildSWS();
                 },
            error:
                 function (XMLHttpRequest, textStatus, errorThrown) {
                     alert("An error occurred. Please contact administrator.");
                     window.location = '../Pages/Home.aspx';
                 }
        });

        /*---------------Get Data [End]----------------------*/
    }


    function BuildOperations2(operations) {
        var operation1 = "";
        var opSWS = "";


        var obj = jQuery.parseJSON(operations);
        swsOperations = obj;

        $('#MainStepsTR').empty();

        $.each(obj, function (i, val) {

            opSWS = "<div class='draggable ui-state-default' id='" + obj[i].SwsId + ":" + obj[i].WorkSequenceTitle + "'><p>" + obj[i].WorkSequence + "</p></div>";

            operation1 = $("<tr><td><input type='textbox' readonly='true' class='sqrtxt' maxlength='3' " + (obj[i].Disabled ? "disabled='true'" : " value = " + obj[i].Sequence) + " id='txtSqn" + obj[i].ItemId
                + "' ></input><input type='hidden' id='opid" + obj[i].ItemId + "' value='" + obj[i].OperationId
                + "'/><input type='hidden' id='prodordexist" + obj[i].ItemId + "' value='" + obj[i].ProdOrdExists + "'/></td><td><span class='operationtxt' id='txtOperation" + obj[i].ItemId + "'>" + obj[i].Operation
                + "</span></td><td><input type='textbox' " + (obj[i].Disabled ? "disabled='true' " : "") + " maxlength='40' class='operationnametxt' id='txtOperationName" + obj[i].ItemId
                + "' value='" + obj[i].OperationName.replace("~~", ":").replace("^~", "{").replace("~^", "}").replace("~*", ",").replace("&#39;", "`")
                + "' onblur=\"javascript:BuildJson(" + obj[i].ItemId + ", 'Changed');\"></input> <input type='hidden' id='swsid" + obj[i].ItemId + "' value='" + obj[i].SwsId + "'/>"
                + "</td><td><div class='droppableitem' id='op" + obj[i].ItemId + "'>" + (!obj[i].Disabled ? opSWS : "") + "</div></td></tr>");

            dropSqn = (obj[i].Sequence > 0 && obj[i].Sequence > dropSqn) ? obj[i].Sequence : dropSqn;

            $('#MainStepsTR').append(operation1);

            if (!obj[i].Disabled) {
                $('#op' + obj[i].ItemId).addClass("ui-state-highlight");
            }

            $(".droppableitem").droppable({
                activeClass: "ui-state-hover",
                hoverClass: "ui-state-active",
                drop: function (event, ui) {
                    try {
                        var draggableId = ui.draggable.attr("id");

                        var droppableId = $(this).attr("id");

                        var arr = draggableId.split(':');

                        var idNbr = droppableId.substr(2, droppableId.length - 1);

                        var sCount = $("#swscount" + arr[0]).text();

                        var sCountArr = sCount.split(':');


                        if (sCountArr[0] == 0 && sCountArr[1] != "SCAN_CARD_ONLY") {
                            alert("Cannot add this Standard Work Sequence as there are no steps associated with it.");

                            ui.draggable.draggable('option', 'revert', true);

                        }
                        else {

                            $(this).addClass("ui-state-highlight");

                            dropSqn += 1;

                            $('#txtSqn' + idNbr).attr('disabled', false);
                            ;
                            $('#txtSqn' + idNbr).val(dropSqn);
                            $('#txtOperationName' + idNbr).attr('disabled', false);
                            //$('#txtWorkTitle' + idNbr).text(arr[1]);
                            $('#swsid' + idNbr).val(arr[0]);

                            var draggable1 = ui.draggable.clone();
                            draggable1 = draggable1.clone();
                            draggable1.appendTo(this);


                            BuildJson(idNbr, 'Added');

                            $('#Text1').focus();
                        }


                    }
                    catch (exception) {
                        alert(exception);
                    }

                },
                accept: function (dropElem) {
                    //dropElem was the dropped element, return true or false to accept/refuse it
                    return (!$(this).hasClass("ui-state-highlight") && $(dropElem).hasClass("ui-state-default") && !$(dropElem).parent().hasClass("ui-state-highlight"));
                }
            });

            $(".droppableitem").sortable({ connectWith: ".draggable" });


            opSWS = "";
            operation1 = "";

        });

    }


    function BuildSWS() {

        /*---------------Get Data [Start]----------------------*/
        //Web service call here to get data
        var dataPassed = new Object();
        var swsHtml = "";
        var sws = "";
        var swscount = "";

        $.ajax({
            type: "POST",
            contentType: "application/json; charset=utf-8",
            url: "../DAF/Project.asmx/GetAllSWS",
            //data: JSON.stringify(dataPassed),
            dataType: "json",
            success:
                 function (msg) {
                     if (msg && msg.d) {
                         var obj = jQuery.parseJSON(msg.d);
                         var count = 1;

                         $('#swsdiv').empty();
                         $('#swscount').empty();

                         $.each(obj, function (i, val) {

                             sws = sws + "<div class='draggable ui-state-default' id='" + obj[i].SwsId + ":" + obj[i].Title + "'><p class='swstitlep' title='"
                                 + obj[i].Title + "'>" + obj[i].StandarWorkSequence + "</p></div>";

                             swscount = swscount + "<div id='swscount" + obj[i].SwsId + "'>" + obj[i].SCount + ":" + obj[i].StandarWorkSequence + "</div>";

                             $('#swsdiv').append($(sws).draggable({
                                 helper: "clone",
                                 revert: "invalid",
                                 stack: "div",
                                 cursor: "move",
                                 cancel: null
                             }));


                             $('#swscount').append(swscount);

                             $("#swsdiv").droppable({
                                 drop: function (event, ui) {
                                     var dropped = ui.draggable;

                                     var parentDivId = $(dropped).parent().attr("id");
                                     var idNbr = parentDivId.substr(2, parentDivId.length - 1);

                                     if ($(dropped).parent().hasClass("ui-state-highlight")) {
                                         $(dropped).parent().removeClass("ui-state-highlight");
                                         $(dropped).detach().css({ top: 0, left: 0 });

                                         $('#txtSqn' + idNbr).attr('disabled', true);
                                         $('#txtSqn' + idNbr).val('');
                                         //$('#txtWorkTitle' + idNbr).text('');
                                         $('#txtOperationName' + idNbr).attr('disabled', true);

                                         BuildJson(idNbr, 'Deleted');
                                     }
                                     else {
                                         ui.draggable.draggable('option', 'revert', true);

                                     }

                                 },
                                 accept: ".draggable"
                             });

                             sws = "";
                             swscount = "";

                         });

                     }
                     else
                         alert("Error occurred while fetching data. Please contact Administrator");
                 },
            error:
                 function (XMLHttpRequest, textStatus, errorThrown) {
                     alert("An error occurred. Please contact administrator.");
                     window.location = '../Pages/Home.aspx';
                 }
        });

        /*---------------Get Data [End]----------------------*/
    }


    function SaveOperations() {
        var dataPassed = new Object();
        dataPassed.projectId = window.opener.projectId;
        dataPassed.swsOperations = operationsToSend;

        if (operationsToSend.length == 0) {
            alert("There are no changes made");
            return false;
        }
        else if (!ValidateSequence()) {
            alert("The sequence cannot be same");
            return false;
        } else if (!ValidateOperations()) {
            alert("The Operation Number and Operation Name should be unique");
            return false;

        }


        try {
            $.ajax({
                type: "POST",
                contentType: "application/json; charset=utf-8",
                url: "../DAF/Project.asmx/SaveOperations",
                data: $.toJSON(dataPassed),
                dataType: "json",
                success:
                     function (msg) {
                         //$('#2sortord').val('true');
                       
                         var sortOrdert = $('#' + orderByGlobal + 'sortord'),
                         val = sortOrdert.val();
                         sortOrdert.val(val === "true" ? "false" : "true");

                         BuildOperations(orderByGlobal);
                         operationsToSend = "";
                         alert("Changes have been saved successfully.");
                     },
                error:
                     function (XMLHttpRequest, textStatus, errorThrown) {
                         alert("An error occurred. Please contact administrator.");
                     }
            });
        } catch (exception) {
            alert(exception);
        }
    }


    function BuildJson(idNbr, operation) {

        var operationId = $('#opid' + idNbr).val();
        var swsId = $('#swsid' + idNbr).val();
        var workTitle = ''; //$('#txtWorkTitle' + idNbr).text();
        var operationNbr = $('#txtOperation' + idNbr).text();
        var operationName = $('#txtOperationName' + idNbr).val();
        var prodOrdExist = $('#prodordexist' + idNbr).val();
        var sCount = $("#swscount" + swsId).text();
        var sCountArr = sCount.split(':');

        var worksequence = sCountArr[1] != "undefined" ? sCountArr[1] : "";


        //if (workTitle.trim().length == 0 && operation == "Changed") {
        //    alert("Work Title cannot be empty");
        //    $('#txtWorkTitle' + idNbr).focus();
        //    return false;
        //}

        if (operationNbr.trim().length == 0 && operation == "Changed") {
            alert("Operation Number cannot be empty");
            $('#txtOperation' + idNbr).focus();
            return false;
        }


        if (operationName.trim().length == 0 && operation == "Changed") {
            alert("Operation Name cannot be empty");
            return false;
        }

        if (!ValidateOperations()) {
            alert("The Operation Number and Operation Name should be unique.");
            return false;
        }

        if (prodOrdExist > 0 && operation == "Deleted") {
            alert("You cannot perform this operation as there are Production Orders associated for this operation.")
            var sortOrdert = $('#' + orderByGlobal + 'sortord'),
            val = sortOrdert.val();
            sortOrdert.val(val === "true" ? "false" : "true");

            BuildOperations(orderByGlobal);
            return false;
        }




        workTitle = workTitle.replace(":", "~~");
        workTitle = workTitle.replace("{", "^~");
        workTitle = workTitle.replace("}", "~^");
        workTitle = workTitle.replace(",", "~*");

        operationNbr = operationNbr.replace(":", "~~");
        operationNbr = operationNbr.replace("{", "^~");
        operationNbr = operationNbr.replace("}", "~^");
        operationNbr = operationNbr.replace(",", "~*");

        operationName = operationName.replace(":", "~~");
        operationName = operationName.replace("{", "^~");
        operationName = operationName.replace("}", "~^");
        operationName = operationName.replace(",", "~*");


        worksequence = worksequence.replace(":", "~~");
        worksequence = worksequence.replace("{", "^~");
        worksequence = worksequence.replace("}", "~^");
        worksequence = worksequence.replace(",", "~*");
       

        var seqset = operation == "Deleted" ? -1 : $('#txtSqn' + idNbr).val();
        changeSequence += 1;

        var opObj = { "ItemId": changeSequence, "OperationId": operationId, "SwsId": swsId, "Sequence": seqset, "WorkSequenceTitle": workTitle, "ItemOperation": operation, "Operation": operationNbr, "OperationName": operationName, "WorkSequence": worksequence };

        operationsToSend = operationsToSend + JSON.stringify(opObj);
    }


    function ValidateSequence() {
        var seen = [];
        var validate = true;
        $('.sqrtxt').each(function () {
            if (!$(this).is(':disabled')) {
                var txt = $(this).val();

                for (var i = 0; i < seen.length; i++) {
                    if (seen[i] === txt) {
                        validate = false;
                        break;
                    }
                }

                seen.push(txt);
            }
        });

        return validate;
    }


    function ValidateOperations() {
        var seen = [];
        var validate = true;
        $('.operationtxt').each(function () {
            if (!$(this).is(':disabled')) {
                var txt = $(this).text().trim();
                var id = $(this).attr("id");
                var id2 = id.substr(12, id.length);

                var opname = $('#txtOperationName' + id2).val().trim();

                var culp = txt + opname;

                for (var i = 0; i < seen.length; i++) {
                    if (seen[i] === culp) {
                        validate = false;
                        break;
                    }
                }

                seen.push(culp);
            }
        });

        return validate;
    }


    function RefreshParent() {
        window.close();
        window.opener.refreshChildGrids();
    }


    function Search() {

        //if ($(obj).val().length) {
        var dataPassed = new Object();
        dataPassed.projectId = window.opener.projectId;
        dataPassed.opNbr = $("#opNbrs").val();
        dataPassed.opName = $("#opNameS").val();
        dataPassed.workSqn = $("#workSqns").val();
        dataPassed.swsOperations = operationsToSend;

        /*---------------Get Data [Start]----------------------*/
        //Web service call here to get data

        $.ajax({
            type: "POST",
            contentType: "application/json; charset=utf-8",
            url: "../DAF/Project.asmx/SearchOperations",
            data: $.toJSON(dataPassed),
            dataType: "json",
            success:
                    function (msg) {
                        if (msg && msg.d) {
                            BuildOperations2(msg.d);
                        }
                        else {
                            alert("Error occurred while fetching data. Please contact Administrator");
                        }
                    },
            error:
                    function (XMLHttpRequest, textStatus, errorThrown) {
                        alert("An error occurred. Please contact administrator.");
                        window.location = '../Pages/Home.aspx';
                    }
        });

        /*---------------Get Data [End]----------------------*/
        //}
    }

 

</script>

<table style="width: 697px; margin-left: 5px">
    <tr>
        <td>
            <div class="OperationsDiv">
                <table class="OperationsTbl">
                    <tr class="Header">
                        <th>Project
                        </th>
                        <th>Description
                        </th>
                        <th>Status
                        </th>
                    </tr>
                    <tr id="ProjectsTR"></tr>
                </table>
            </div>
        </td>
    </tr>
</table>
<table>
    <tr>
        <td>
            <div id="operationsdiv" class="OperationsDiv">
                <div style="float: left;">
                    <table class="OperationsTbl">
                        <tr class="Header">
                            <th>
                                <p><a class="opHeaderLink" href="#" onclick="javascript:BuildOperations(1); return false;">Sequence</a></p>
                                <input type="text" class="searchTxtCls" id="Text1" onblur="javascript:Search(); return false;" style="visibility: hidden; width: 3px" />
                                <input type="hidden" id="1sortord" value="true" />
                            </th>
                            <th>
                                <p><a class="opHeaderLink" href="#" onclick="javascript:BuildOperations(2); return false;">Operation Nbr</a></p>
                                <input type="text" class="searchTxtCls" id="opNbrs" onblur="javascript:Search(); return false;" style="width: 50px;" tabindex="1" />
                                <input type="hidden" id="2sortord" value="true" />
                            </th>
                            <th>
                                <p><a class="opHeaderLink" href="#" onclick="javascript:BuildOperations(3);return false;">Operation Name</a></p>
                                <input type="text" class="searchTxtCls" id="opNameS" onblur="javascript:Search(); return false;" style="width: 160px;" tabindex="2"  />
                                <input type="hidden" id="3sortord" value="true" />
                            </th>
                           <%-- <th style="visibility:hidden">
                                <p><a class="opHeaderLink" href="#" onclick="javascript:BuildOperations(4);return false;">Work Title</a></p>
                                <input type="text" class="searchTxtCls" id="workTitles" onblur="javascript:Search(); return false;" style="width: 230px;" tabindex="3"  />
                                <input type="hidden" id="4sortord" value="true" />
                            </th>--%>
                            <th>
                                <p><a class="opHeaderLink" href="#" onclick="javascript:BuildOperations(5);return false;">Work Sequence</a></p>
                                <input type="text" class="searchTxtCls" id="workSqns" onblur="javascript:Search(); return false;" style="width: 130px;" tabindex="4"  />
                                <input type="hidden" id="5sortord" value="true" />
                            </th>
                        </tr>
                        <tbody id="MainStepsTR">
                        </tbody>
                    </table>
                </div>
            </div>
            <div id="swsdivcontainerparent">
                <div>
                    <button id="btnSave" onclick="javascript:SaveOperations();return false;" style="height: 35px; width: 95px; font-weight: bold;" tabindex="5" >Save</button>
                    <button id="btnReset" style="height: 35px; width: 95px; font-weight: bold;" tabindex="6" >Reset</button>
                    <button id="btnClose" onclick="javascript:RefreshParent();return false;" style="height: 35px; width: 95px; font-weight: bold;" tabindex="7"  >Close</button>
                </div>
                <div id="swsdivcontainer">
                    <div style="background-color: #ddd; font-weight: bold; font-family: tahoma; font-size: 8.5pt; padding: 5px;">Standard Work Sequence</div>
                    <div id="swsdiv">
                    </div>
                </div>
            </div>

            <div id="swscount" style="visibility: hidden"></div>
        </td>
    </tr>
</table>

Thursday, 26 February 2015

Transactions in .Net and Oracle

To have simple transactions in you .Net application with Oracle do this

1. Encapsulate your transaction code with
 using (var scope = new System.Transactions.TransactionScope())
{
 // your transaction code
}              


2. Add reference to Oracle.ManagedDataAccessDTC.dll


3. Deploy your code to server

If you get exception like
Could not load file or assembly 'Oracle.ManagedDataAccessDTC.dll' or one of its dependencies.

or

Failed to find or load the registered .Net Framework Data Provider

a. Then make sure you have the Oracle.ManagedDataAccessDTC.dll in the bin directory in your deployed code.

b. Also make sure you do NOT have any entry like this in your web.config
<add assembly="Oracle.ManagedDataAccessDTC, Version=4.121.1.0, Culture=neutral"/>

basically let .Net load the assembly from GAC

c. If you still have the exception then you may have to do the following

  1. install Microsoft Visual C++ 2010 Redistributable (DTC –> COM based transaction processing)
  2. restart IIS

Monday, 8 December 2014

PLS-00201: identifier "sp_name" must be declared

If you have created a stored procedure in oracle and are trying to use it in your .net code and you get the 

above error while running the sp , make sure the following

1. Create the SP using the admin account


2. Grant execute rights to the user that is running the SP

3. Check if you have a public synonym for the SP in question

4. If not then create the public synonym for the SP

CREATE PUBLIC SYNONYM SYNONYM_NAME FOR ADMIN.SP_NAME;

4. Also grant execute to the public synonym also
     GRANT EXECUTE ON "ADMINACCOUNT"."SP_NAME" TO "PUBLIC_SYNONYM";


5. If a public synonym is not created or you do not want to create a public synonym , then you can run the SP by appending the ADMIN schema to the SP
    ADMINACCOUNT.SP_NAME

Thursday, 24 October 2013

0x800a01b6 - JavaScript runtime error: Object doesn't support property or method 'adGallery' - MVC 4

0x800a01b6 - JavaScript runtime error: Object doesn't support property or method 'adGallery'

If you get this error then do not include the supporting jquery in the classic way like
-- @*<script type="text/javascript" src="~/Scripts/jquery-1.7.1.min.js"></script>

Instead add your jquery to the bundle . See this to find out how to add your adGallery jquery to bundle.
-- http://stackoverflow.com/questions/12192646/why-use-scripts-render-bundles-jquery