Rss Feed Like Us on facebook Google Plus

May 10, 2014

Call WebService using JQuery and HTML : Asp.Net

This article is all about Calling a WebService (asmx) in HTML Page using jquery. to call a webservice first thing to know about a webservice
  • Web services are application components
  • Web services communicate using open protocols
  • Web services are self-contained and self-describing
  • Web services can be discovered using UDDI
  • Web services can be used by other applications
  • HTTP and XML is the basis for Web services

Webservices transfers data to application in XML, JSON and Text Format as well as JSON object.

One important distinction is what I mean by a JSON object and JSON format.  A JSON object is an object that can be used by javascript
var o = {data: 'value'};
alert (o.data); // this works as o is an object
JSON format is simply a literal string that can be turned into a JSON object if we parse it
var f = "{data: 'value'}";
alert (f.data); // this won't work as f is just a string and string doesn't have a data property
EXAMPLE

WEB SERVICE
[WebMethod]
public string SayHello(string firstName, string lastName)
{
    return "Hello " + firstName + " " + lastName;
}

[WebMethod]
public string SayHelloJson(string firstName, string lastName)
{
    var data = new { Greeting = "Hello", Name = firstName + " " + lastName };

    // We are using an anonymous object above, but we could use a typed one too (SayHello class is defined below)
    // SayHello data = new SayHello { Greeting = "Hello", Name = firstName + " " + lastName };

    System.Web.Script.Serialization.JavaScriptSerializer js = new System.Web.Script.Serialization.JavaScriptSerializer();

    return js.Serialize(data);
}

[WebMethod]
public SayHello SayHelloObject(string firstName, string lastName)
{
    SayHello o = new SayHello();
    o.Greeting = "Hello";
    o.Name = firstName + " " + lastName;

    return o;
}
"SayHello" returns a string "SayHelloJson" returns a string that is an object in JSON format "SayHelloObject" returns an object.  The SayHello class is here
public class SayHello
{
    public string Greeting { get; set; }
    public string Name { get; set; }
}
HTML


<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Hello World</title>
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" type="text/javascript"></script>
</head>
<body>
    <form id="form1" runat="server">
    <div><br />Example A</div>
    <div id="searchresultsA"></div>
    <div><br />Example B</div>
    <div id="searchresultsB"></div>
    <div><br />Example C</div>
    <div id="searchresultsC"></div>
    <div><br />Example D</div>
    <div id="searchresultsD"></div>
    <div><br />Example E</div>
    <div id="searchresultsE"></div>

    <script type="text/javascript">
              // Example A - call a function that returns a string.
              // Params are sent as form-encoded, data that comes back is text
              $(document).ready(function () {
              $.ajax({
                type: "POST",
                url: "MyWebService.asmx/SayHello",
                data: "firstName=Aidy&lastName=F", 
                dataType: "text", 
                success: function (data) {
                    $("#searchresultsA").html(data);
                }
            });

            // Example B - call a function that returns a string.
            // Params are sent in JSON format, data that comes back is JSON
            $.ajax({
                type: "POST",
                url: "MyWebService.asmx/SayHello",
                data: "{firstName:'Aidy', lastName:'F'}",
                contentType: "application/json; charset=utf-8",
                dataType: "json", 
                success: function (data) {
                    $("#searchresultsB").html(data.d);
                }
            });

            // Example C - call a function that returns a string.
            // Params are sent as a JSON object, data that comes back is text
            $.ajax({
                type: "POST",
                url: "MyWebService.asmx/SayHello",
                data: { firstName: 'Aidy', lastName: 'F' },
                contentType: "application/x-www-form-urlencoded; charset=UTF-8",
                dataType: "text",
                success: function (data) {
                    $("#searchresultsC").html(data); 
                }
            });

            // Example D - call a function that returns a string that is an object in JSON format.
            // Params are sent in JSON format, data that comes back is a string that represents an object in JSON format
            $.ajax({
                type: "POST",
                url: "MyWebService.asmx/SayHelloJson",
                data: "{ firstName: 'Aidy', lastName: 'F' }",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (data) {
                    var myData = JSON.parse(data.d); 
                    $("#searchresultsD").html(myData.Greeting + " " + myData.Name);
                }
            });

            // Example E - call a function that returns an object.  .net will serialise the object as JSON for us.
            // Params are sent in JSON format, data that comes back is a JSON object
            $.ajax({
                type: "POST",
                url: "MyWebService.asmx/SayHelloObject",
                data: "{ firstName: 'Aidy', lastName: 'F' }",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (data) {
                    var myData = data.d; 
                    $("#searchresultsE").html(myData.Greeting + " " + myData.Name);
                }
            });
        });
    </script>

    </form>
</body>
</html>
Read More

March 21, 2014

Install WhatsApp in Nokia X

when i bought Nokia X , i am surprised there is no WhatsApp and no direct option to install it. so i found 2 ways to install WhatsApp in Nokia-X. checkout below.


1st Way

The idea came from the store search itself when it was pointing to 1MobileStore, a popular Android store, which has the official WhatsApp for android devices. Below is a video explaining how I installed it.

Follow the steps to get the WhatsApp:

  • Search in Nokia Store for app named as “1MobileStore”.
  • Install it and launch.
  • Now since this app itself is a store, make a search again for WhatsApp.
  • The first result should list the WhatsApp, officially from WhatsApp Inc. Take a look at ratings to figure if that’s correct.
  • Install and start using after following up the basic setup.
  • In case, you get an error during installation where it concerns about security. Turn on installation from unknown sources. You will get the option to get there right when the error shows up.
  • Instead of sending out verification code to your number, it will use SMS to verify.


















2nd Way

Download WhatsApp directly from its website. open website in your Nokia - X browser. i will redirect to android-store

See picture :



Read More

February 20, 2014

Style your button with transform and transition : CSS3

Style up your button with CSS3 transitions and transform. i'm going to give a demo to use these properties. below some basic information of Transition and Transform
Transform :
The transform property applies a 2D or 3D transformation to an element. This property allows you to rotate, scale, move, skew, etc., elements.

transform: none|transform-functions|initial|inherit;

Transition :
CSS3 transitions are effects that let an element gradually change from one style to another.
To do this, you must specify two things:
  • Specify the CSS property you want to add an effect to
  • Specify the duration of the effect.
transition: all 1s ease-in-out;

Example with a Button


HTML :
<div>
 <button type="button" class="btn-effect">Submit</button>
</div>
CSS :
.btn-effect:before {
    background: none repeat scroll 0 0 #66B3F6;
    content: "";
    height: 100%;
    left: 0;
    position: absolute;
    top: 0;
    width: 100%;
    z-index: -1;
    color: #fff;
}
.btn-effect:after {
    background: none repeat scroll 0 0 #BFE1FB;
    content: "";
    height: 0;
    left: 50%;
    opacity: 0;
    position: absolute;
    top: 50%;
    transform: translateX(0%) translateY(-25%) rotate(45deg);
    -webkit-transform: translateX(0%) translateY(-25%) rotate(45deg);
    transition: all 0.3s ease 0s;
   -webkit-transition: all 0.3s ease 0s;
    width: 100%;
    z-index: -1;
    border: 1px solid #f4f4f4;
    left: 0;
    top: 0;
}
.btn-effect {
    border: 0.5px solid #f4f4f4;
    color: #fff;
    cursor: pointer;
    font-family: segoe ui;
    font-size: 18px;
    height: 45px;
    line-height: 18px;
    padding: 10px 40px;
    position: relative;
    font-variant: small-caps;
    transition: all 0.5s ease-in-out 0s;
    box-shadow: 1px 3px 5px 1px #aaa;
    font-size: 22px;
    overflow: hidden;
    z-index: 99;
  border-radius:5px;
}
.btn-effect:hover, .btn-effect:active {
    color: #000000 !important;
}
.btn-effect:hover:after {
    height: 215%;
    opacity: 1;
    width: 100%;
}
.btn-effect:active:after {
    height: 235%;
    opacity: 1;
}

LIVE DEMO :


Read More

January 13, 2014

GPG Dragon Version 3.35 Free Download

GPG Dragon Version 3.35 Features 

  • SC6530 &6531 Rear-Write
  • Flash Auto identify SC6531&6530 Flash 
  • Amount Adjust SPD 6820/8810 Read Flash Adjust SPD6820/8810
  • Write Flash For Bin 
  • File Adjust SPD6820/8810 Write Flash For PAC File
  • Add New Flash tar

Format Support -
  • All SPD android
  • Add MTK Android New NAND Flash Support
  • Added More chips information in the software!
ABOUT GPG DRAGON
  1. Gpgdragon box supports all china mobile
  2. Gpgdragon box supports china mobile pinfinding
  3. Gpgdragon box support zte and huawei pinfinding and repair
  4. Gpgdragon software is easy use and has constant updates.

Download Now...
Read More

December 10, 2013

Object Error in Internet Explorer (IE- 7,8,9,10,11)


While opening Internet Explorer you are getting the Object Error in a popup window, this error may come while opening a new web page or between surfing a website.


Issues:
1.most add-ons are not compatible with the 64 bit version of ie
2.Many dysfunctional addons from various utilities will effect the internet explorer
3.Security suites Privacy features/ Toolbars 
4. unwanted addons ,toolbars

Solution:

Here are the few steps to resolve this problem, please follow these steps to automatically resolve it.

Step 1.  Uninstall Unwanted Toolbars from add/remove program

Example:-
privacy safe gaurd,Social Privacy,unfriend checker,Price peep today,Coupon amazing,We-Care Toolbar

Step 2. Disable all addons except from Microsoft

goto Tools >> Manage Add-Ons
or you can use this MS fixit utility.

Step 3. Reset Internet Browser Setting

goto Tools >> Internet options >> Advanced tab 

Click on Reset Button and Restore Advance Setting button


Restart your Browser/System then check. your problem should be resolved.


Read More

November 20, 2013

Ways to Prevent from Popular Online Scams

Online Scams can be done in many forms to your computer,phones or website. so this article going to cover some popular online scams and ways to prevent from it...
 
The use of Internet services or software with Internet access to defraud victims or to otherwise take advantage of them, for example by stealing personal information, which can even lead to identity theft. A very common form of Internet fraud is the distribution of rogue security software. Internet services can be used to present fraudulent solicitations to prospective victims, to conduct fraudulent transactions, or to transmit the proceeds of fraud to financial institutions or to others connected with the scheme.
 
Internet fraud can take many forms: identity theft, injecting malware, fraudulent transactions. It can occur through e-mail, smartphones, websites, and chat rooms. Here are some such scams and ways to avoid them.

These are the sites that are not legitimate and have malicious software to hack your personal information. A lot of such infected sites come up during festive season, when people are buying gifts online, and hackers build these using popular search items. Another variation of infection is legitimate sites that get heavy traffic and, hence, are injected with ads and images that have viruses. 
 
>> A good way to avoid these is to go with familiar, popular sites or install ad blockers on your browser.

2) Fake phone apps

Be very careful about the apps that you download on your phone. Android and Apple phones are particularly vulnerable to fake apps in their stores, and these can introduce malware that steals the datayour phone. 
 
>> To avoid fake apps, check the users' review about the game or app before you download it. You can also go to the developer's website and get more information about the app before zeroing in on it. Another safe option is to go for the most downloaded apps or those that come with the 'editor's tag'. Avoid the apps that are 'paid' but are being offered for free, or ask for too much information.

3) International dialling

If your Internet connection is through a modem using a local telephone number, beware. Some sites lure people into viewing content that requires them to download a dialler or viewer. If you do so, your computer will be disconnectedthe Net and will instead be used to dial an international number, resulting in high phone bills. 
 
>> To safeguard yourself, avoid sites that require you to download a program to view content. You can also have your line blocked making international calls. Also make sure your computer has anti-malware software to detect any illegal activity.


This is probably the oldest known scamming technique that is still going strong. Here e-mails, purportedly sent outwell-known institutions and social networking or payment sites, are used to draw out sensitive, personal informationpasswords and credit card details. These mails could also carry links to infected sites.

>> A preventive step is to never give out personal information and call up the company to crosscheck that the e-mail is genuine. Also scan the url for security (use of https in the address bar means it is safe).

5) Pharming

A combination of 'farming' and 'phishing', this term refers to the process by which a hacker gets a domain name for a site and then uses it to redirect this site's traffic to another, bogus website. It can comp romise serious information and cause heavy losses if the site being copied is that of a bank or taxation department. It can also be used to steal passwords, PIN or account numbers.

>> The best way to prevent this is to make sure you use secure Web connections (https) to access privacy-sensitive sites.

 
6) Wi-Fi hacking

If you use a public Wi-Fi connection, such as at airport terminals or coffee shops, to log into your account, you stand the risk of having your password and private information hacked. The hacker can also access your browsing history. This is especially true if you save the password to your account. 
 
>> If you are using a smartphone to access your account, try to use the 3G or 4G connection as it is more secure.

7) Auction/shopping scams

With online shopping and auction sites—wherein you put up household items and gadgets for bidding and sale— becoming popular, the scope of fraud has increased. You could be scammed out of your money by not receiving the goods at all, getting poor quality items, or beingged more than the price mentioned. Your credit card information could also be used fraudulently. Besides, the seller could be defrauded if he doesn't get any payment.

>> To avoid it, make sure you know as much as possible about the item and seller/buyer. The latter shouldn't have just an e-mail or a post office box address. Call him up and ask him about the address and extrages. Also go through the feedback.

8) Investing scams

Here, the prices of stocks are manipulated by sending out false information about the companies through e-mails, chat forums or Internet boards. This results in a rise or fall in the prices of stocks and the scamster benefits by selling or buying shares at the right time. In another variation of investing scam, which came under the Sebi scanner recently, companies were offering 'guaranteed return' schemes through e-mails, websites, blogs and social media platforms, and conning people out of their money. 
 
>> The best way to avoid it is to conduct your own research about the company, and not invest in schemes that promise outrageous returns.

9) Employment fraud

There are two variants of this scam. The more common one involves job offers by recruiters that require you to pay an advance fee or make a deposit, without the job ever materialising. The second one typically offers you the job of a 'representative' of an overseas company and your task is to collect customers' deposits in your account and remit most of it to the company abroad. In doing so, you could not only be a victim of identity theft, but also have money stolenyour account.

>> Avoid any such offers without verifying the company and do not give out personal information.

10) Click scams 

Have you ever clicked on the game strips or dancing/jumping figures that pop up and move across your screen while you are on social networking or other sites? 
 
>> Don't click on on the game strips or dancing/jumping figures . These could be fake and could lead you to click on concealed links, which either make your personal information public or provide access to confidential information stored on your computer.
 
Read More

November 19, 2013

Charge your Smart Phone with Sunglasses


What can you do with your sunglasses when the Sun goes down? You can use them to chargeyour smartphone! An Indian designer based in the US has turned a pair of sunglasses into a smartphone charging device by adding solar panels to them.

Sayalee Kaluskar's The Ray-Ban Shama Shades are part of a project at Miami Ad School - San Francisco, CNET reported. The shades have a small solar panel on each arm, and that's apparently enough to charge a smartphone when the Sun goes down.

According to PSFK.com, Kaluskar placed small solar panels on each side of the frame, allowing the sunglasses to harness solar energy during the day.

At night, the frames can be detached and used to charge a smartphone, the report said. Kaluskar worked with Ramiro Ramirez on the project as part of their student work.

Experts say people are keen on tapping solar energy on the go, provided they can harness enough of it to be useful.
Read More

November 18, 2013

Retrieve Data from Client Machine DataBase on Web using Javascript Active-X object

To Retrieve data from Local database you can use JavaScript simulation using Active-X
object on your Asp.net Website.

If all of your users are on Windows computers, you could use ADO or ODBC to connect to a corresponding database. checkout the example

Limitations:
This script will work only on Internet Explorer

EXAMPLE

SCRIPT:

<script id="clientEventHandlersJS" type="text/javascript">
        function GetData() {
            var connection = new ActiveXObject("ADODB.Connection");
            var connectionstring = "Data Source=AJIT-LAPTOP\\sqlexpress;Initial Catalog=user;User ID=ajit;Password=ajit;Provider=SQLOLEDB";
            connection.Open(connectionstring);
            if (connection) {
                var rs = new ActiveXObject("ADODB.Recordset");
    //FOR Single Record
                var userid = document.getElementById("txtuserid").value;
                rs.open("select password from userdetail where userid='" + userid + "'", connection);
                if (!rs.EOF) {
                    var c1 = rs.fields("userid").value;
                    alert(c1);
                }
                else {
                    alert("Record Not Found");
                }
              //For Multiple Records
          rs.Open ("select col1,col2 from tbl_test", conn,0,1);
          while (! rs.EOF)
          {
             c1 = rs.fields("col1").value;
             c2 = rs.fields("col2").value;
             document.write(c1+' - '+c2+'<br>');
             rs.MoveNext ();
          }
                rs.close();
                rs = null;
                connection.close;
                return true;
            }
            else {
                return false;
            }
        }
    </script>

HTML:

<form id="form1" runat="server">
    <table>
        <tr>
            <td>
               USER ID: <input type="text" id="txtuserid" runat="server" />
                <input type="button" id="btn" onclick="javascript:return GetData()" style="width: 80px;
                    height: 30px;" value="OK" runat="server" />
            </td>
        </tr>
    </table>
    </form>



Read More

November 17, 2013

AngularJS open-source JavaScript framework, maintained by Google

Its provide browser-based applications with MVC capability, in an effort to make easier development and testing.The library reads in HTML that contains additional custom tag attributes; it then obeys the directives in those custom attributes, and binds input or output parts of the page to a model represented by standard JavaScript variables. The values of those JavaScript variables can be manually set, or retrieved from static or dynamic JSON resources.

 

Angular JS Script:

<head>
 <script src="http://code.angularjs.org/1.2.1/angular.min.js"></script>
</head>

Angular directives:AngularJS directives allow developer to specify custom and reusable HTML tags that moderate the behavior of certain elements.

1: ng-app 
Declares angularJS as a root element of the application allowing behavior to be modified through custom HTML tags.
<html ng-app>
...........
</html>

2: ng-bind
Automatically changes the text of a HTML element to the value of a given expression.
<div ng-controller="Ctrl"> 
 Enter name: <input type="text" ng-model="name"><br> 
 Hello <span ng-bind="name"></span>
</div>

3: ng-model
Similar to ng-bind, but allows two-way data binding between the view and the scope.
 <input type="text" ng-model="name">


4: ng-class 
Allows class attributes to be dynamically loaded.  
<span class="base-class" ng-class="..">

5: ng-controller 
Specifies a JavaScript controller class that evaluates HTML expressions. 
<body ng-controller="...">

6: ng-repeat
Instantiate an element once per item from a collection. 

7: ng-show & ng-hide
Conditionally show or hide an element, depending on the value of a boolean expression. 
<div class="check-element animate-show" ng-show="checked">

8: ng-switch
Conditionally instantiate one template from a set of choices, depending on the value of a selection expression.  

9: ng-view
The base directive responsible for handling routes that resolve JSON before rendering templates driven by specified controllers. 

10: ng-if 
Basic if statement directive which allow to show the following element if the conditions are true.

Example:
<!doctype html>
<html ng-app>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular.min.js"></script>
</head>
<body>
<div>
<label>Name:</label>
<input type="text" ng-model="yourName" placeholder="Enter a name here">
<hr>
<h1>Hello {{yourName}}!</h1>
</div>
</body>
</html>

Learn More...
Read More

November 7, 2013

How to use Cursor in SQL Server


A cursor is a set of rows together with a pointer that identifies a current row.


Cursor is a database object used by applications to manipulate data in a set on a row-by-row basis, instead of the typical SQL commands that operate on all the rows in the set at one time. For example, you can use cursor to include a list of all user databases and make multiple operations against each database by passing each database name as a variable. it's like record-set in ASP and Visual Basic

Declaring a Cursor

Before using cursor, you first must declare the cursor, i.e. define its scrolling behavior and the query used to build the result set on which the cursor operates. To declare cursor, you can use a syntax based on the SQL-92 standard and a syntax using a set of Transact-SQL extensions.

DECLARE cursor_name [INSENSITIVE] [SCROLL] CURSOR
FOR select_statement
[FOR {READ ONLY | UPDATE [OF column_name [,...n]]}]
where

cursor_name - the name of the server side cursor, must contain from 1 to 128 characters.

INSENSITIVE - specifies that cursor will use a temporary copy of the data instead of base tables. This cursor does not allow modifications and modifications made to base tables are not reflected in the data returned by fetches made to this cursor.

SCROLL - specifies that cursor can fetch data in all directions, not only sequentially until the end of the result set. If this argument is not specified, FETCH NEXT is the only fetch option supported.

select_statement - the standard select statement, cannot contain COMPUTE, COMPUTE BY, FOR BROWSE, and INTO keywords.

READ ONLY - specifies that cursor cannot be updated.

UPDATE [OF column_name [,...n]] - specifies that all cursor's columns can be updated (if OF column_name [,...n] is not specified), or only the columns listed in the OF column_name [,...n] list allow modifications.

Opening a Cursor

Once a cursor has been declared, you must open it to fetch data from it. To open a cursor, you can use the following syntax:
OPEN { { [GLOBAL] cursor_name } | cursor_variable_name}
where

GLOBAL - if this argument was not specified and both a global and a local cursor exist with the same name, the local cursor will be opened; otherwise, the global cursor will be opened.

cursor_name - the name of the server side cursor, must contain from 1 to 128 characters.

cursor_variable_name - the name of a cursor variable that references a cursor.

After a cursor is opening, you can determine the number of rows that were found by the cursor. To get this number, you can use @@CURSOR_ROWS scalar function.

Fetching a Cursor

Once a cursor has been opened, you can fetch from it row by row and make multiple operations on the currently active row in the cursor. To fetch from a cursor, you can use the following syntax:
FETCH
        [    [    NEXT | PRIOR | FIRST | LAST
                | ABSOLUTE {n | @nvar}
                | RELATIVE {n | @nvar}
            ]
            FROM
        ]
{ { [GLOBAL] cursor_name } | @cursor_variable_name}
[INTO @variable_name[,...n] ]
where

NEXT - the default cursor fetch option. FETCH NEXT returns the next row after the current row.

PRIOR - returns the prior row before the current row.

FIRST - returns the first row in the cursor.

LAST - returns the last row in the cursor.

ABSOLUTE {n | @nvar} - returns the nth row in the cursor. If a positive number was specified, the rows are counted from the top of the data set; if 0 was specified, no rows are returned; if a negative number was specified, the number of rows will be counted from the bottom of the data set.

RELATIVE {n | @nvar} - returns the nth row in the cursor relative to the current row. If a positive number was specified, returns the nth row beyond the current row; if a negative number was specified, returns the nth row prior the current row; if 0 was specified, returns the current row.

GLOBAL - if this argument was not specified and both a global and a local cursor exist with the same name, the local cursor will be fetched; otherwise, the global cursor will be fetched.

cursor_name - the name of the server side cursor, must contain from 1 to 128 characters.

cursor_variable_name - the name of a cursor variable that references a cursor.

INTO @variable_name[,...n] - allows data returned from the cursor to be held in temporary variables. The type of variables must match the type of columns in the cursor select list or support implicit conversion. The number of variables must match the number of columns in the cursor select list.


Closing a Cursor
When you have finished working with a cursor, you can close it to release any resources and locks that SQL Server may have used while the cursor was open.
To close a cursor, you can use the following syntax:

CLOSE { { [GLOBAL] cursor_name } | cursor_variable_name }
where

GLOBAL - if this argument was not specified and both a global and a local cursor exist with the same name, the local cursor will be closed; otherwise, the global cursor will be closed.

cursor_name - the name of the server side cursor, must contain from 1 to 128 characters.

cursor_variable_name - the name of a cursor variable that references a cursor.

Note. If you have closed a cursor, but have not deallocated it, you can open it again when needed.


Deallocating a Cursor
When you have finished working with a cursor and want to completely release SQL Server resources that were used by a cursor, you can deallocate a cursor.
To deallocate a cursor, you can use the following syntax:

DEALLOCATE { { [GLOBAL] cursor_name } | @cursor_variable_name}
where

GLOBAL - if this argument was not specified and both a global and a local cursor exist with the same name, the local cursor will be deallocated; otherwise, the global cursor will be deallocated.

cursor_name - the name of the server side cursor, must contain from 1 to 128 characters.

cursor_variable_name - the name of a cursor variable that references a cursor.

Note. Deallocating a cursor completely removes all cursor references. So, after a cursor is deallocated, it no longer can be opened.


Example
DECLARE @ColExpir datetime
DECLARE @ColFallprotec datetime
DECLARE @ColWorkid int
--------------------------------------------------------
DECLARE @MyCursor CURSOR
SET @MyCursor = CURSOR FAST_FORWARD
FOR
SELECT Table_Training_Detalis.DateExpires,Table_Training_Detalis.Worker_ID
FROM   Table_Courses 
OPEN @MyCursor
FETCH NEXT FROM @MyCursor
INTO @ColExpir,@ColWorkid
WHILE @@FETCH_STATUS = 0
BEGIN
update Table_Workers set WHIMIS= @ColExpir where Worker_ID=@ColWorkid
 
FETCH NEXT FROM @MyCursor
INTO @ColExpir,@ColWorkid
END
CLOSE @MyCursor
DEALLOCATE @MyCursor
Read More

© 2011-2016 Techimpulsion All Rights Reserved.


The content is copyrighted to Tech Impulsion and may not be reproduced on other websites.