Saturday 7 January 2012


Binding listbox and dropdown list using javascript - ASP.NET


we call a web service that return list<Employee> .

 $.ajax({
                type: "POST",
                contentType: "application/json; charset=utf-8",
                url: "../WebServices/servicename.asmx/methodname",
                data: JSON.stringify({}),
                dataType: "json",
                success: BindEmployeeSucceeded,
                error: BindEmployeeFailed
            });

function BindEmployeeSucceeded(result) {
            var columns = result.d;
            $('#<%=lbEmployee.ClientID %>').empty();
            $('#<%=
lbEmployee
.ClientID %>').append('<option value="' + "0" + '">' + "Select" + '</option>');
            for (var i = 0; i < columns.length; i++) {
                $('#<%=
lbEmployee
.ClientID %>').append('<option value=' + columns[i].Id + '>' + columns[i].OrganisationName + '</option>');
            }
        }

        function BindEmployeeFailed() {

        }

note: OrganisationName and Id are properties of Employee 

normalization


(1) In relational database design, the process of organizing data to minimize redundancy. Normalization usually involves dividing a database into two or more tables and defining relationships between the tables. The objective is to isolate data so that additions, deletions, and modifications of a field can be made in just one table and then propagated through the rest of the database via the defined relationships.

There are three main normal forms, each with increasing levels of normalization:
  • First Normal Form (1NF): Each field in a table contains different information. For example, in an employee list, each table would contain only one birthdate field.
  • Second Normal Form (2NF): Each field in a table that is not a determiner of the contents of another field must itself be a function of the other fields in the table.
  • Third Normal Form (3NF): No duplicate information is permitted. So, for example, if two tables both require a birthdate field, the birthdate information would be separated into a separate table, and the two other tables would then access the birthdate information via an indexfield in the birthdate table. Any change to a birthdate would automatically be reflect in all tables that link to the birthdate table.
  • There are additional normalization levels, such as Boyce Codd Normal Form (BCNF), fourth normal form (4NF) and fifth normal form (5NF). While normalization makes databases more efficient to maintain, they can also make them more complex because data is separated into so many different tables.
    (2) In data processing, a process applied to all data in a set that produces a specific statistical property. For example, each expenditure for a month can be divided by the total of all expenditures to produce a percentage.
    (3) In programming, changing the format of a floating-point number so the left-most digit in the mantissa is not a zero.

    normalization

    How to read data from xml file 




    using MSXML6.0.DLL


     Using System.Xml.DLL

    DOMDocumentClass document = new DOMDocumentClass();

    document .load("d:\\gopal\\test.xml");

    IXMLDOMElement p =   document .documentElement;

    for (int i = 0; i <  p.childNodes.length ; i++)

    {


    MessageBox.Show(p.childNodes[i].childNodes[0].text + " " + p.childNodes[i].childNodes[5



    ].text); 

    }