Tuesday, 8 January 2013

bind dropdownlist with javascript using sql database with ahsx

<script type="text/javascript">

        window.onload = GetfilldataReservoir("rdatav");

        function GetfilldataReservoir(rdatav) {
            var selpkg = "rvdataval";
            jQuery.ajax({

                url: 'ReportHandler.ashx',
                type: "GET",
                data: "ssid=" + selpkg,
                success: function(data) {
                    var rvdatastore = data;
                    rvdatastore = rvdatastore.slice(0, rvdatastore.length - 1);
                    var dataspl = rvdatastore.split("~");
                    var dlldata = document.getElementById('<%= selectrvdata.ClientID %>');

                    for (var val = 0; val < dataspl.length; val++) {
                        AddItem(dataspl[val + 1], dataspl[val])
                        val++;
                    }
                }

            })
        }
        function AddItem(Text, Value) {
            var opt = document.createElement("option");
            document.getElementById('<%= selectrvdata.ClientID %>').options.add(opt);
            opt.value = Value;
            opt.text = Text;

        }
    </script>

Monday, 7 January 2013

ms access date diffrence

1.--

where HISDATA1.DDATE between DateSerial( [select top 1 Year( HISDATA1.DDATE)  from HISDATA1 group by HISDATA1.DDATE order by HISDATA1.DDATE desc],1,1)
and DateSerial([select top 1 Year(HISDATA1.DDATE)  from HISDATA1 group by HISDATA1.DDATE order by HISDATA1.DDATE desc],12,31)


2.--

SELECT HISDATA1.DDATE
FROM HISDATA1
where HISDATA1.DDATE between
DateAdd("yyyy",-10,DateSerial((select top 1 Year( HISDATA1.DDATE)  from HISDATA1 group by HISDATA1.DDATE order by HISDATA1.DDATE desc),1,1) )
and
DateAdd("yyyy",-10,DateSerial((select top 1 Year( HISDATA1.DDATE)  from HISDATA1 group by HISDATA1.DDATE order by HISDATA1.DDATE desc),12,31) )
order by HISDATA1.DDATE desc

How to highlight selected text in notepad++

  –> To highlight a block of code in Notepad++, please do the following steps step-1  :- Select the required text. step-2  :- Right click...