<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-482602810823403830</id><updated>2025-06-07T11:39:32.235-07:00</updated><category term="SQL"/><category term="Database"/><category term="SQL 2008"/><category term="C#"/><category term="ASP.Net"/><category term="JQuery"/><category term="Javascript"/><category term="MVC"/><category term="cte"/><category term="JSON"/><category term="LINQ"/><category term="Merge Query"/><category term="Group By"/><category term="Pivot"/><category term="Cross Apply"/><category term="EditorTemplates"/><category term="Enum"/><category term="Log"/><category term="SignalR"/><category term="Tree"/><category term="XML"/><category term="AJAX"/><category term="Aggregate"/><category term="Backup"/><category term="Bulk Insert"/><category term="Calendar"/><category term="ConvertAll"/><category term="Core AJAX"/><category term="Database Difference"/><category term="Delegate"/><category term="DisplayFor"/><category term="DisplayTemplates"/><category term="EditFor"/><category term="Enum Extention"/><category term="Excel Configration"/><category term="Excel Programming"/><category term="Extended Method"/><category term="Fibonacci Sequence"/><category term="Field List"/><category term="IIS Configration"/><category term="Left Outer Join"/><category term="OUTPUT Clause"/><category term="Openrowset"/><category term="Outer Apply"/><category term="Page Method"/><category term="Restore"/><category term="Rounding Date"/><category term="Running Transaction"/><category term="Search"/><category term="Threading Pool"/><category term="Truncate Log"/><category term="UnPivot"/><category term="Webservice"/><category term="Year Dates"/><title type='text'>JSD Ideas</title><subtitle type='html'>.Net, MVC, MVP, SQL, JQuery, JSON, Javascript</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://jsdideas.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/482602810823403830/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://jsdideas.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/482602810823403830/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Jayesh Chauhan</name><uri>http://www.blogger.com/profile/07837823503910695576</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>64</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-482602810823403830.post-5936586129351084599</id><published>2015-12-29T02:59:00.000-08:00</published><updated>2015-12-29T03:02:46.802-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><category scheme="http://www.blogger.com/atom/ns#" term="SignalR"/><title type='text'>SignalR Implementation in XAML Page</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2&gt;XAML Page:&lt;/h2&gt;
&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;
&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System.Collections.Generic;
&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System.Windows;
&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System.Windows.Controls;
&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System.Windows.Input;
&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System.Windows.Media;
&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; Microsoft.AspNet.SignalR.Client;

&lt;span class=&quot;kwrd&quot;&gt;namespace&lt;/span&gt; SignalRDemo
{
    &lt;span class=&quot;rem&quot;&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;rem&quot;&gt;/// Interaction logic for MainWindow.xaml&lt;/span&gt;
    &lt;span class=&quot;rem&quot;&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;partial&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; MainWindow : Window
    {
        &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; MainWindow()
        {
            InitializeComponent();
        }

        HubConnection _connection;
        IHubProxy _hub;

        &lt;span class=&quot;rem&quot;&gt;// Keep track of when fake &quot;drag and drop&quot; mode is enabled.&lt;/span&gt;
        &lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;bool&lt;/span&gt; isDragging = &lt;span class=&quot;kwrd&quot;&gt;false&lt;/span&gt;;

        &lt;span class=&quot;rem&quot;&gt;// Store the location where the user clicked the control.&lt;/span&gt;
        &lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;double&lt;/span&gt; clickOffsetX, clickOffsetY;

        &lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; window_Loaded(&lt;span class=&quot;kwrd&quot;&gt;object&lt;/span&gt; sender, RoutedEventArgs e)
        {
            Start();
        }

        &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; label_MouseDown(&lt;span class=&quot;kwrd&quot;&gt;object&lt;/span&gt; sender, MouseButtonEventArgs e)
        {
            isDragging = &lt;span class=&quot;kwrd&quot;&gt;true&lt;/span&gt;;
            &lt;span class=&quot;kwrd&quot;&gt;var&lt;/span&gt; position = e.GetPosition(window);

            &lt;span class=&quot;kwrd&quot;&gt;var&lt;/span&gt; label = sender &lt;span class=&quot;kwrd&quot;&gt;as&lt;/span&gt; Label;
            &lt;span class=&quot;kwrd&quot;&gt;var&lt;/span&gt; l = (&lt;span class=&quot;kwrd&quot;&gt;double&lt;/span&gt;)label.GetValue(Canvas.LeftProperty);
            &lt;span class=&quot;kwrd&quot;&gt;var&lt;/span&gt; t = (&lt;span class=&quot;kwrd&quot;&gt;double&lt;/span&gt;)label.GetValue(Canvas.TopProperty);

            clickOffsetX = l - position.X;
            clickOffsetY = t - position.Y;
        }

        &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; label_MouseMove(&lt;span class=&quot;kwrd&quot;&gt;object&lt;/span&gt; sender, MouseEventArgs e)
        {
            &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (isDragging == &lt;span class=&quot;kwrd&quot;&gt;true&lt;/span&gt;)
            {
                &lt;span class=&quot;rem&quot;&gt;// The control coordinates are converted into form coordinates&lt;/span&gt;
                &lt;span class=&quot;rem&quot;&gt;// by adding the label position offset.&lt;/span&gt;
                &lt;span class=&quot;rem&quot;&gt;// The offset where the user clicked in the control is also&lt;/span&gt;
                &lt;span class=&quot;rem&quot;&gt;// accounted for. Otherwise, it looks like the top-left corner&lt;/span&gt;
                &lt;span class=&quot;rem&quot;&gt;// of the label is attached to the mouse.&lt;/span&gt;

                &lt;span class=&quot;kwrd&quot;&gt;var&lt;/span&gt; label = sender &lt;span class=&quot;kwrd&quot;&gt;as&lt;/span&gt; Label;
                &lt;span class=&quot;kwrd&quot;&gt;var&lt;/span&gt; position = e.GetPosition(window);

                &lt;span class=&quot;kwrd&quot;&gt;var&lt;/span&gt; x = position.X + clickOffsetX;
                &lt;span class=&quot;kwrd&quot;&gt;var&lt;/span&gt; y = position.Y + clickOffsetY;

                SetShapePosition(label, x, y);

                _hub.Invoke(&lt;span class=&quot;str&quot;&gt;&quot;MoveShape&quot;&lt;/span&gt;, &lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt;.Parse(label.Name.Replace(&lt;span class=&quot;str&quot;&gt;&quot;shape&quot;&lt;/span&gt;, &lt;span class=&quot;str&quot;&gt;&quot;&quot;&lt;/span&gt;)), x, y);
            }
        }

        &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; label_MouseUp(&lt;span class=&quot;kwrd&quot;&gt;object&lt;/span&gt; sender, MouseButtonEventArgs e)
        {
            isDragging = &lt;span class=&quot;kwrd&quot;&gt;false&lt;/span&gt;;
        }

        &lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; Start()
        {
            _connection = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; HubConnection(&lt;span class=&quot;str&quot;&gt;&quot;http://localhost/SignalRChat/myhubs/hubs&quot;&lt;/span&gt;);

            _hub = _connection.CreateHubProxy(&lt;span class=&quot;str&quot;&gt;&quot;SignalRHub&quot;&lt;/span&gt;);

            _connection.Start().Wait();

            _hub.On&amp;lt;&lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt;&amp;gt;(&lt;span class=&quot;str&quot;&gt;&quot;usersConnected&quot;&lt;/span&gt;, (count) =&amp;gt;
            {
                &lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.Dispatcher.Invoke(() =&amp;gt;
                    UpdateUserCount(count)
                );
            });

            _hub.On&amp;lt;List&amp;lt;Common.Shape&amp;gt;&amp;gt;(&lt;span class=&quot;str&quot;&gt;&quot;shapeList&quot;&lt;/span&gt;, (list) =&amp;gt;
            {
                &lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.Dispatcher.Invoke(() =&amp;gt;
                {
                    canvas.Children.Clear();

                    list.ForEach(q =&amp;gt;
                    {
                        &lt;span class=&quot;kwrd&quot;&gt;var&lt;/span&gt; label = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; Label();

                        label.Name = &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;.Format(&lt;span class=&quot;str&quot;&gt;&quot;shape{0}&quot;&lt;/span&gt;, q.Id);
                        label.Content = q.Name;
                        label.Height = 100;
                        label.Width = 100;
                        label.Padding = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; Thickness(10, 10, 0, 0);
                        label.Background = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; SolidColorBrush((Color)ColorConverter.ConvertFromString(q.Color));
                        SetShapePosition(label, q.X, q.Y);
                        label.FontSize = 20;

                        label.MouseDown += label_MouseDown;
                        label.MouseMove += label_MouseMove;
                        label.MouseUp += label_MouseUp;

                        canvas.Children.Add(label);
                    });
                });
            });

            _hub.On&amp;lt;Common.Shape&amp;gt;(&lt;span class=&quot;str&quot;&gt;&quot;shapeMoved&quot;&lt;/span&gt;, (shape) =&amp;gt;
            {
                &lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.Dispatcher.Invoke(() =&amp;gt;
                    UpdatePosition(shape)
                );
            });

            _hub.Invoke(&lt;span class=&quot;str&quot;&gt;&quot;GetShapeList&quot;&lt;/span&gt;);
        }

        &lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; SetShapePosition(Label label, &lt;span class=&quot;kwrd&quot;&gt;double&lt;/span&gt; x, &lt;span class=&quot;kwrd&quot;&gt;double&lt;/span&gt; y)
        {
            &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (label != &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;)
            {
                label.SetValue(Canvas.LeftProperty, x);
                label.SetValue(Canvas.TopProperty, y);
            }
        }

        &lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; UpdateUserCount(&lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt; count)
        {
            lblCount.Content = count;
        }

        &lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; UpdatePosition(Common.Shape shape)
        {
            &lt;span class=&quot;kwrd&quot;&gt;var&lt;/span&gt; label = UIHelper.FindChild&amp;lt;Label&amp;gt;(Application.Current.MainWindow, &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;.Format(&lt;span class=&quot;str&quot;&gt;&quot;shape{0}&quot;&lt;/span&gt;, shape.Id));
            SetShapePosition(label, shape.X, shape.Y);
        }
    }

    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; UIHelper
    {
        &lt;span class=&quot;rem&quot;&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;rem&quot;&gt;/// Finds a Child of a given item in the visual tree. &lt;/span&gt;
        &lt;span class=&quot;rem&quot;&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;rem&quot;&gt;/// &amp;lt;param name=&quot;parent&quot;&amp;gt;A direct parent of the queried item.&amp;lt;/param&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;rem&quot;&gt;/// &amp;lt;typeparam name=&quot;T&quot;&amp;gt;The type of the queried item.&amp;lt;/typeparam&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;rem&quot;&gt;/// &amp;lt;param name=&quot;childName&quot;&amp;gt;x:Name or Name of child. &amp;lt;/param&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;rem&quot;&gt;/// &amp;lt;returns&amp;gt;The first parent item that matches the submitted type parameter. &lt;/span&gt;
        &lt;span class=&quot;rem&quot;&gt;/// If not matching item can be found, &lt;/span&gt;
        &lt;span class=&quot;rem&quot;&gt;/// a null parent is being returned.&amp;lt;/returns&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;static&lt;/span&gt; T FindChild&amp;lt;T&amp;gt;(DependencyObject parent, &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; childName)
           where T : DependencyObject
        {
            &lt;span class=&quot;rem&quot;&gt;// Confirm parent and childName are valid. &lt;/span&gt;
            &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (parent == &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;) &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;;

            T foundChild = &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;;

            &lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt; childrenCount = VisualTreeHelper.GetChildrenCount(parent);
            &lt;span class=&quot;kwrd&quot;&gt;for&lt;/span&gt; (&lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt; i = 0; i &amp;lt; childrenCount; i++)
            {
                &lt;span class=&quot;kwrd&quot;&gt;var&lt;/span&gt; child = VisualTreeHelper.GetChild(parent, i);
                &lt;span class=&quot;rem&quot;&gt;// If the child is not of the request child type child&lt;/span&gt;
                T childType = child &lt;span class=&quot;kwrd&quot;&gt;as&lt;/span&gt; T;
                &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (childType == &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;)
                {
                    &lt;span class=&quot;rem&quot;&gt;// recursively drill down the tree&lt;/span&gt;
                    foundChild = FindChild&amp;lt;T&amp;gt;(child, childName);

                    &lt;span class=&quot;rem&quot;&gt;// If the child is found, break so we do not overwrite the found child. &lt;/span&gt;
                    &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (foundChild != &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;) &lt;span class=&quot;kwrd&quot;&gt;break&lt;/span&gt;;
                }
                &lt;span class=&quot;kwrd&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (!&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;.IsNullOrEmpty(childName))
                {
                    &lt;span class=&quot;kwrd&quot;&gt;var&lt;/span&gt; frameworkElement = child &lt;span class=&quot;kwrd&quot;&gt;as&lt;/span&gt; FrameworkElement;
                    &lt;span class=&quot;rem&quot;&gt;// If the child&#39;s name is set for search&lt;/span&gt;
                    &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (frameworkElement != &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt; &amp;amp;&amp;amp; frameworkElement.Name == childName)
                    {
                        &lt;span class=&quot;rem&quot;&gt;// if the child&#39;s name is of the request name&lt;/span&gt;
                        foundChild = (T)child;
                        &lt;span class=&quot;kwrd&quot;&gt;break&lt;/span&gt;;
                    }
                }
                &lt;span class=&quot;kwrd&quot;&gt;else&lt;/span&gt;
                {
                    &lt;span class=&quot;rem&quot;&gt;// child element found.&lt;/span&gt;
                    foundChild = (T)child;
                    &lt;span class=&quot;kwrd&quot;&gt;break&lt;/span&gt;;
                }
            }

            &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; foundChild;
        }
    }

}
&lt;/pre&gt;
&lt;h2&gt;SignalR Hub Page :&lt;/h2&gt;
&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;
&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; Microsoft.AspNet.SignalR;
&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System.Collections.Generic;
&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System.Linq;
&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System.Threading.Tasks;
&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; Common;

&lt;span class=&quot;kwrd&quot;&gt;namespace&lt;/span&gt; SignalRChat
{
    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; SignalRHub : Hub
    {
        &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; SignalRHub()
        {

        }

        &lt;span class=&quot;preproc&quot;&gt;#region&lt;/span&gt; Moveable Shape
        &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; async Task GetShapeList() &lt;span class=&quot;rem&quot;&gt;// this method will be called from the client, when the user drag/move the shape&lt;/span&gt;
        {
            await Clients.Caller.shapeList(ShapeHandler.Instance.ShapeList); &lt;span class=&quot;rem&quot;&gt;// this method will send the coord x, y to the other users but the user draging the shape&lt;/span&gt;
        }

        &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; async Task MoveShape(&lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt; id, &lt;span class=&quot;kwrd&quot;&gt;double&lt;/span&gt; x, &lt;span class=&quot;kwrd&quot;&gt;double&lt;/span&gt; y) &lt;span class=&quot;rem&quot;&gt;// this method will be called from the client, when the user drag/move the shape&lt;/span&gt;
        {
            &lt;span class=&quot;kwrd&quot;&gt;var&lt;/span&gt; shape = ShapeHandler.Instance.GetShape(id, x, y);

            &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (shape.X != x || shape.Y != y) await Clients.Caller.shapeMoved(shape);

            await Clients.Others.shapeMoved(shape); &lt;span class=&quot;rem&quot;&gt;// this method will send the coord x, y to the other users but the user draging the shape&lt;/span&gt;
        }

        &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;override&lt;/span&gt; Task OnConnected() &lt;span class=&quot;rem&quot;&gt;//override OnConnect, OnReconnected and OnDisconnected to know if a user is connected or disconnected&lt;/span&gt;
        {
            ShapeHandler.Instance.ConnectedIds.Add(Context.ConnectionId); &lt;span class=&quot;rem&quot;&gt;//add a connection id to the list&lt;/span&gt;
            Clients.All.usersConnected(ShapeHandler.Instance.ConnectedIds.Count()); &lt;span class=&quot;rem&quot;&gt;//this will send to ALL the clients the number of users connected&lt;/span&gt;
            &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;base&lt;/span&gt;.OnConnected();
        }

        &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;override&lt;/span&gt; Task OnReconnected()
        {
            ShapeHandler.Instance.ConnectedIds.Add(Context.ConnectionId);
            Clients.All.usersConnected(ShapeHandler.Instance.ConnectedIds.Count());
            &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;base&lt;/span&gt;.OnConnected();
        }

        &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;override&lt;/span&gt; Task OnDisconnected(&lt;span class=&quot;kwrd&quot;&gt;bool&lt;/span&gt; stopCalled)
        {
            ShapeHandler.Instance.ConnectedIds.Remove(Context.ConnectionId);
            Clients.All.usersConnected(ShapeHandler.Instance.ConnectedIds.Count());
            &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;base&lt;/span&gt;.OnDisconnected(stopCalled);
        }
        &lt;span class=&quot;preproc&quot;&gt;#endregion&lt;/span&gt;
    }
}&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jsdideas.blogspot.com/feeds/5936586129351084599/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/482602810823403830/5936586129351084599' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/482602810823403830/posts/default/5936586129351084599'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/482602810823403830/posts/default/5936586129351084599'/><link rel='alternate' type='text/html' href='http://jsdideas.blogspot.com/2015/12/signalr-implementation-in-xaml-page.html' title='SignalR Implementation in XAML Page'/><author><name>Jayesh Chauhan</name><uri>http://www.blogger.com/profile/07837823503910695576</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-482602810823403830.post-5269782829063177334</id><published>2015-12-29T02:45:00.000-08:00</published><updated>2015-12-29T02:45:01.977-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><category scheme="http://www.blogger.com/atom/ns#" term="SignalR"/><title type='text'>SignalR Implementation in HTML Page</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;

&lt;h2&gt;Html Page :&lt;/h2&gt;

&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;!&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;DOCTYPE&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;html&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;xmlns&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;http://www.w3.org/1999/xhtml&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;body&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;label&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;serverDate&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;label&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;button&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;initTimer&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;Start Timer&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;button&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;

    &lt;span class=&quot;rem&quot;&gt;&amp;lt;!--Script references. --&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;script&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Scripts/jquery-1.6.4.min.js&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
    &amp;lt;script src=&lt;span class=&quot;str&quot;&gt;&quot;Scripts/jquery.signalR-2.0.0.js&quot;&lt;/span&gt;&amp;gt;&amp;lt;/script&amp;gt;

    &amp;lt;!--Reference the autogenerated SignalR hub script. --&amp;gt;
    &amp;lt;script src=&lt;span class=&quot;str&quot;&gt;&quot;signalR/hubs&quot;&lt;/span&gt;&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;script type=&lt;span class=&quot;str&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&amp;gt;
        $(&lt;span class=&quot;kwrd&quot;&gt;function&lt;/span&gt; () {
            &lt;span class=&quot;rem&quot;&gt;// Declare a proxy to reference the hub.&lt;/span&gt;
            &lt;span class=&quot;kwrd&quot;&gt;var&lt;/span&gt; hub = $.connection.demoHub;

            hub.client.serverDateTimeInfo = &lt;span class=&quot;kwrd&quot;&gt;function&lt;/span&gt; (time) {
                $(&lt;span class=&quot;str&quot;&gt;&quot;#serverDate&quot;&lt;/span&gt;).text(time);
            };

            $.connection.hub.start().done(&lt;span class=&quot;kwrd&quot;&gt;function&lt;/span&gt; () {
                alert(&lt;span class=&quot;str&quot;&gt;&#39;Server connected&#39;&lt;/span&gt;);

                hub.server.getServerDatetime();

                $(&lt;span class=&quot;str&quot;&gt;&quot;#initTimer&quot;&lt;/span&gt;).click(&lt;span class=&quot;kwrd&quot;&gt;function&lt;/span&gt; () {
                    hub.server.initTimer();
                });
            });
        });
    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;body&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;

&lt;h2&gt;SignalR Hub Page :&lt;/h2&gt;

&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;
&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; Microsoft.AspNet.SignalR;
&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System;
&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System.Collections.Generic;
&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System.Linq;
&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System.Timers;
&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System.Web;

&lt;span class=&quot;kwrd&quot;&gt;namespace&lt;/span&gt; SignalRChat
{
    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; DemoHub :Hub
    {
        &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; GetServerDatetime()
        {
            SendNotification();
        }

        &lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; SendNotification()
        {
            &lt;span class=&quot;kwrd&quot;&gt;try&lt;/span&gt;
            {
                Clients.Caller.serverDateTimeInfo(DateTime.Now.ToString());
            }
            &lt;span class=&quot;kwrd&quot;&gt;catch&lt;/span&gt; { }
        }

        &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; InitTimer()
        {
            Timer timer = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; Timer(1000);
            timer.Elapsed += &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; ElapsedEventHandler(timer_Elapsed);
            timer.AutoReset = &lt;span class=&quot;kwrd&quot;&gt;true&lt;/span&gt;;
            timer.Enabled = &lt;span class=&quot;kwrd&quot;&gt;true&lt;/span&gt;;
        }

        &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; timer_Elapsed(&lt;span class=&quot;kwrd&quot;&gt;object&lt;/span&gt; sender, ElapsedEventArgs e)
        {
            SendNotification();
        }
        
    }
}&lt;/pre&gt;

&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jsdideas.blogspot.com/feeds/5269782829063177334/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/482602810823403830/5269782829063177334' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/482602810823403830/posts/default/5269782829063177334'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/482602810823403830/posts/default/5269782829063177334'/><link rel='alternate' type='text/html' href='http://jsdideas.blogspot.com/2015/12/signalr-implementation-in-html-page.html' title='SignalR Implementation in HTML Page'/><author><name>Jayesh Chauhan</name><uri>http://www.blogger.com/profile/07837823503910695576</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-482602810823403830.post-9200765684532999853</id><published>2012-03-15T22:34:00.003-07:00</published><updated>2012-07-11T21:44:47.533-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Cross Apply"/><category scheme="http://www.blogger.com/atom/ns#" term="Outer Apply"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL 2008"/><title type='text'>Diffrence between CROSS APPLY and OUTER APPLY of SQL XML</title><content type='html'>&lt;a href=&quot;http://www.codeproject.com&quot; rel=&quot;tag&quot; style=&quot;display:none&quot;&gt;CodeProject&lt;/a&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&lt;br /&gt;&lt;b&gt;Sample XML :&lt;/b&gt;&lt;br /&gt;DECLARE @XML XML = &lt;br /&gt;&lt;span class=&quot;str&quot;&gt;&#39;&amp;lt;Root&amp;gt;&lt;br /&gt;    &amp;lt;UserInfo Id=&quot;1&quot; Name=&quot;Name 1&quot;&amp;gt;&lt;br /&gt;        &amp;lt;CityInfo Id=&quot;2&quot; City=&quot;City 1&quot; /&amp;gt;&lt;br /&gt;        &amp;lt;CityInfo Id=&quot;3&quot; City=&quot;City 2&quot; &amp;gt;&lt;br /&gt;            &amp;lt;PrefInfo Id=&quot;33&quot; Name=&quot;Show Whether&quot; /&amp;gt;&lt;br /&gt;        &amp;lt;/CityInfo&amp;gt;&lt;br /&gt;    &amp;lt;/UserInfo&amp;gt;&lt;br /&gt;    &amp;lt;UserInfo Id=&quot;2&quot; Name=&quot;Name 2&quot;&amp;gt;&lt;br /&gt;        &amp;lt;CityInfo Id=&quot;4&quot; City=&quot;City 3&quot; /&amp;gt;&lt;br /&gt;        &amp;lt;CityInfo Id=&quot;5&quot; City=&quot;City 4&quot; &amp;gt;&lt;br /&gt;            &amp;lt;PrefInfo Id=&quot;33&quot; Name=&quot;Show Temprature&quot; /&amp;gt;&lt;br /&gt;        &amp;lt;/CityInfo&amp;gt;&lt;br /&gt;    &amp;lt;/UserInfo&amp;gt;&lt;br /&gt;&amp;lt;/Root&amp;gt;&#39;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Cross Apply : &lt;/b&gt; Cross apply is basically use inner join of two xml collection&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;SELECT&lt;/span&gt;&lt;br /&gt;    UserInfo.&lt;span class=&quot;kwrd&quot;&gt;value&lt;/span&gt;(&lt;span class=&quot;str&quot;&gt;&#39;@Id&#39;&lt;/span&gt;, &lt;span class=&quot;str&quot;&gt;&#39;BIGINT&#39;&lt;/span&gt;) &lt;span class=&quot;kwrd&quot;&gt;as&lt;/span&gt; UserId&lt;br /&gt;    , UserInfo.&lt;span class=&quot;kwrd&quot;&gt;value&lt;/span&gt;(&lt;span class=&quot;str&quot;&gt;&#39;@Name&#39;&lt;/span&gt;, &lt;span class=&quot;str&quot;&gt;&#39;VARCHAR(20)&#39;&lt;/span&gt;) &lt;span class=&quot;kwrd&quot;&gt;as&lt;/span&gt; UserName&lt;br /&gt;    , CityInfo.&lt;span class=&quot;kwrd&quot;&gt;value&lt;/span&gt;(&lt;span class=&quot;str&quot;&gt;&#39;@Id&#39;&lt;/span&gt;, &lt;span class=&quot;str&quot;&gt;&#39;BIGINT&#39;&lt;/span&gt;) &lt;span class=&quot;kwrd&quot;&gt;as&lt;/span&gt; CityId&lt;br /&gt;    , CityInfo.&lt;span class=&quot;kwrd&quot;&gt;value&lt;/span&gt;(&lt;span class=&quot;str&quot;&gt;&#39;@City&#39;&lt;/span&gt;, &lt;span class=&quot;str&quot;&gt;&#39;VARCHAR(20)&#39;&lt;/span&gt;) &lt;span class=&quot;kwrd&quot;&gt;as&lt;/span&gt; CityName&lt;br /&gt;    , PrefInfo.&lt;span class=&quot;kwrd&quot;&gt;value&lt;/span&gt;(&lt;span class=&quot;str&quot;&gt;&#39;@Id&#39;&lt;/span&gt;, &lt;span class=&quot;str&quot;&gt;&#39;BIGINT&#39;&lt;/span&gt;) &lt;span class=&quot;kwrd&quot;&gt;as&lt;/span&gt; PrefId&lt;br /&gt;    , PrefInfo.&lt;span class=&quot;kwrd&quot;&gt;value&lt;/span&gt;(&lt;span class=&quot;str&quot;&gt;&#39;@Name&#39;&lt;/span&gt;, &lt;span class=&quot;str&quot;&gt;&#39;VARCHAR(20)&#39;&lt;/span&gt;) &lt;span class=&quot;kwrd&quot;&gt;as&lt;/span&gt; PrefName&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;FROM&lt;/span&gt; @xml.nodes(&lt;span class=&quot;str&quot;&gt;&#39;/Root/UserInfo&#39;&lt;/span&gt;)e(UserInfo)&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;CROSS&lt;/span&gt; APPLY UserInfo.nodes(&lt;span class=&quot;str&quot;&gt;&#39;CityInfo&#39;&lt;/span&gt;)b(CityInfo)&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;CROSS&lt;/span&gt; APPLY CityInfo.nodes(&lt;span class=&quot;str&quot;&gt;&#39;PrefInfo&#39;&lt;/span&gt;)c(PrefInfo)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Output :&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;UserId   UserName  CityId  CityName  PrefId   PrefName&lt;br /&gt;-------- --------- ------- --------- -------- ----------------&lt;br /&gt;1        Name 1    3       City 2    33       Show Whether&lt;br /&gt;2        Name 2    5       City 4    33       Show Temprature &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Outer Apply : &lt;/b&gt; Outer apply is basically use left outer join of two xml collection&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;SELECT&lt;/span&gt;&lt;br /&gt;    UserInfo.&lt;span class=&quot;kwrd&quot;&gt;value&lt;/span&gt;(&lt;span class=&quot;str&quot;&gt;&#39;@Id&#39;&lt;/span&gt;, &lt;span class=&quot;str&quot;&gt;&#39;BIGINT&#39;&lt;/span&gt;) &lt;span class=&quot;kwrd&quot;&gt;as&lt;/span&gt; UserId&lt;br /&gt;    , UserInfo.&lt;span class=&quot;kwrd&quot;&gt;value&lt;/span&gt;(&lt;span class=&quot;str&quot;&gt;&#39;@Name&#39;&lt;/span&gt;, &lt;span class=&quot;str&quot;&gt;&#39;VARCHAR(20)&#39;&lt;/span&gt;) &lt;span class=&quot;kwrd&quot;&gt;as&lt;/span&gt; UserName&lt;br /&gt;    , CityInfo.&lt;span class=&quot;kwrd&quot;&gt;value&lt;/span&gt;(&lt;span class=&quot;str&quot;&gt;&#39;@Id&#39;&lt;/span&gt;, &lt;span class=&quot;str&quot;&gt;&#39;BIGINT&#39;&lt;/span&gt;) &lt;span class=&quot;kwrd&quot;&gt;as&lt;/span&gt; CityId&lt;br /&gt;    , CityInfo.&lt;span class=&quot;kwrd&quot;&gt;value&lt;/span&gt;(&lt;span class=&quot;str&quot;&gt;&#39;@City&#39;&lt;/span&gt;, &lt;span class=&quot;str&quot;&gt;&#39;VARCHAR(20)&#39;&lt;/span&gt;) &lt;span class=&quot;kwrd&quot;&gt;as&lt;/span&gt; CityName&lt;br /&gt;    , PrefInfo.&lt;span class=&quot;kwrd&quot;&gt;value&lt;/span&gt;(&lt;span class=&quot;str&quot;&gt;&#39;@Id&#39;&lt;/span&gt;, &lt;span class=&quot;str&quot;&gt;&#39;BIGINT&#39;&lt;/span&gt;) &lt;span class=&quot;kwrd&quot;&gt;as&lt;/span&gt; PrefId&lt;br /&gt;    , PrefInfo.&lt;span class=&quot;kwrd&quot;&gt;value&lt;/span&gt;(&lt;span class=&quot;str&quot;&gt;&#39;@Name&#39;&lt;/span&gt;, &lt;span class=&quot;str&quot;&gt;&#39;VARCHAR(20)&#39;&lt;/span&gt;) &lt;span class=&quot;kwrd&quot;&gt;as&lt;/span&gt; PrefName&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;FROM&lt;/span&gt; @xml.nodes(&lt;span class=&quot;str&quot;&gt;&#39;/Root/UserInfo&#39;&lt;/span&gt;)e(UserInfo)&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;CROSS&lt;/span&gt; APPLY UserInfo.nodes(&lt;span class=&quot;str&quot;&gt;&#39;CityInfo&#39;&lt;/span&gt;)b(CityInfo)&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;OUTER&lt;/span&gt; APPLY CityInfo.nodes(&lt;span class=&quot;str&quot;&gt;&#39;PrefInfo&#39;&lt;/span&gt;)c(PrefInfo)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Output :&lt;/b&gt;&lt;br /&gt;UserId  UserName  CityId  CityName  PrefId  PrefName&lt;br /&gt;------- --------- ------- --------- ------- ----------------&lt;br /&gt;1       Name 1    2       City 1    NULL    NULL&lt;br /&gt;1       Name 1    3       City 2    33      Show Whether&lt;br /&gt;2       Name 2    4       City 3    NULL    NULL&lt;br /&gt;2       Name 2    5       City 4    33      Show Temprature &lt;br /&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsdideas.blogspot.com/feeds/9200765684532999853/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/482602810823403830/9200765684532999853' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/482602810823403830/posts/default/9200765684532999853'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/482602810823403830/posts/default/9200765684532999853'/><link rel='alternate' type='text/html' href='http://jsdideas.blogspot.com/2012/03/diffrence-between-cross-apply-and-outer.html' title='Diffrence between CROSS APPLY and OUTER APPLY of SQL XML'/><author><name>Jayesh Chauhan</name><uri>http://www.blogger.com/profile/07837823503910695576</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-482602810823403830.post-7550514392645839616</id><published>2012-03-14T04:25:00.003-07:00</published><updated>2012-03-14T04:35:40.429-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="JQuery"/><title type='text'>How to Handle button click event in jquery</title><content type='html'>&lt;b&gt;Code :&lt;/b&gt;&lt;br /&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;br /&gt;   &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;script&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;language&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;javascript&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        $(document).ready(&lt;span class=&quot;kwrd&quot;&gt;function&lt;/span&gt; () {&lt;br /&gt;            $(&lt;span class=&quot;str&quot;&gt;&quot;[id*=&#39;btnSave&#39;]&quot;&lt;/span&gt;).click(&lt;span class=&quot;kwrd&quot;&gt;function&lt;/span&gt; (&lt;span class=&quot;kwrd&quot;&gt;event&lt;/span&gt;) {&lt;br /&gt;                &lt;span class=&quot;kwrd&quot;&gt;event&lt;/span&gt;.preventDefault();&lt;br /&gt;                &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (confirm(&lt;span class=&quot;str&quot;&gt;&quot;Want to save data?&quot;&lt;/span&gt;)) {&lt;br /&gt;                    $(&lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;).unbind(&lt;span class=&quot;str&quot;&gt;&#39;click&#39;&lt;/span&gt;).click()&lt;br /&gt;                }&lt;br /&gt;            });&lt;br /&gt;&lt;br /&gt;        });&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsdideas.blogspot.com/feeds/7550514392645839616/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/482602810823403830/7550514392645839616' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/482602810823403830/posts/default/7550514392645839616'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/482602810823403830/posts/default/7550514392645839616'/><link rel='alternate' type='text/html' href='http://jsdideas.blogspot.com/2012/03/how-to-handle-button-click-event-in.html' title='How to Handle button click event in jquery'/><author><name>Jayesh Chauhan</name><uri>http://www.blogger.com/profile/07837823503910695576</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-482602810823403830.post-1991406007287944694</id><published>2011-09-20T23:41:00.000-07:00</published><updated>2011-09-26T04:41:43.548-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="JQuery"/><title type='text'>jQuery Selector</title><content type='html'>&lt;pre&gt;&lt;br /&gt;#No     Syntax                              Description&lt;br /&gt;---------------------------------------------------------------------------------------&lt;br /&gt;1.      $(this)                             Current HTML element&lt;br /&gt;2.      $(&quot;.intro&quot;)                         All elements with class=&quot;intro&quot;&lt;br /&gt;3.      $(&quot;#intro&quot;)                         The first element with id=&quot;intro&quot;&lt;br /&gt;4.      $(&quot;p&quot;)                              All &amp;lt;p&amp;gt; elements&lt;br /&gt;5.      $(&quot;p.intro&quot;)                        All &amp;lt;p&amp;gt; elements with class=&quot;intro&quot;&lt;br /&gt;6.      $(&quot;p#intro&quot;)                        All &amp;lt;p&amp;gt; elements with id=&quot;intro&quot;&lt;br /&gt;7.      $(&quot;p#intro:first-child&quot;)            The first &amp;lt;p&amp;gt; element with id=&quot;intro&quot;&lt;br /&gt;8.      $(&quot;ul li:first-child&quot;)              The first &amp;lt;li&amp;gt; element of each &amp;lt;ul&amp;gt;&lt;br /&gt;9.      $(&quot;ul li:last-child&quot;)               The last &amp;lt;li&amp;gt; element of each &amp;lt;ul&amp;gt;&lt;br /&gt;10.     $(&quot;ul li:nth-child(4)&quot;)             The fourth &amp;lt;li&amp;gt; element of each &amp;lt;ul&amp;gt;&lt;br /&gt;11.     $(&quot;div#intro .head&quot;)                All elements with class=&quot;head&quot; and id=&quot;intro&quot; of DIV&lt;br /&gt;12.     $(&quot;[href*=&#39;User&#39;]&quot;)                 All elements with href contains &quot;User&quot;&lt;br /&gt;13.     $(&quot;[href^=&#39;User&#39;]&quot;)                 All elements with href start with &quot;User&quot;&lt;br /&gt;14.     $(&quot;[href$=&#39;.html&#39;]&quot;)                All elements with an href attribute&lt;br /&gt;                                            that ends with &quot;.html&quot;&lt;br /&gt;15.     $(&quot;[href*=&#39;User&#39;] div&quot;)             AND condition for Getting all element &lt;br /&gt;                                            which have href contains &quot;User&quot; and inner element div&lt;br /&gt;16.     $(&quot;[href*=&#39;User&#39;],div&quot;)             OR condition for Getting all element &lt;br /&gt;                                            which have href contains &quot;User&quot; or div element&lt;br /&gt;17.     $(&quot;[href!=&#39;UserInfo.html&#39;]&quot;)        NOT condition for Getting all element   &lt;br /&gt;                                            which have href not equle to &quot;UserInfo.html&quot;&lt;br /&gt;18.     $(&quot;div &amp;gt; input#User&quot;)               Getting all element which have a parent element is&lt;br /&gt;                                            DIV and next element is INPUT have a id User&lt;br /&gt;19.     $(&quot;div&quot;).find(&quot;input#User&quot;)         Getting all element of parent element is &lt;br /&gt;                                            DIV and child element is INPUT have a id User&lt;br /&gt;20.     $(&quot;div&quot;).not(&quot;.UserInfo, #UserId&quot;)  Getting all div element which not have a &lt;br /&gt;                                            class USERINFO or id is USERID&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsdideas.blogspot.com/feeds/1991406007287944694/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/482602810823403830/1991406007287944694' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/482602810823403830/posts/default/1991406007287944694'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/482602810823403830/posts/default/1991406007287944694'/><link rel='alternate' type='text/html' href='http://jsdideas.blogspot.com/2011/09/jquery-selector.html' title='jQuery Selector'/><author><name>Jayesh Chauhan</name><uri>http://www.blogger.com/profile/07837823503910695576</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-482602810823403830.post-7476355099851114178</id><published>2011-08-29T00:23:00.000-07:00</published><updated>2011-09-21T03:44:37.155-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Rounding Date"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL 2008"/><title type='text'>Rounding date in SQL query</title><content type='html'>&lt;pre class=&quot;csharpcode&quot;&gt;&lt;br /&gt;&lt;b&gt;Query : &lt;/b&gt;&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;SELECT&lt;/span&gt;&lt;br /&gt;    DATEADD( MI, DATEDIFF( MI, 0, DATEADD( SS, 30, Dates.SampleDate) ), 0) &lt;span class=&quot;kwrd&quot;&gt;AS&lt;/span&gt; RoundedDate&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;FROM&lt;/span&gt;&lt;br /&gt;(&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;SELECT&lt;/span&gt; SampleDate = &lt;span class=&quot;kwrd&quot;&gt;CONVERT&lt;/span&gt;( DATETIME, &lt;span class=&quot;str&quot;&gt;&#39;8/29/2011 12:59:29.998&#39;&lt;/span&gt;)&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;UNION&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;ALL&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;SELECT&lt;/span&gt; SampleDate = &lt;span class=&quot;kwrd&quot;&gt;CONVERT&lt;/span&gt;( DATETIME, &lt;span class=&quot;str&quot;&gt;&#39;8/29/2011 12:59:30.000&#39;&lt;/span&gt;)&lt;br /&gt;) Dates&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Results : &lt;/b&gt;&lt;br /&gt;&lt;br /&gt;RoundedDate&lt;br /&gt;-----------------------&lt;br /&gt;2011-08-29 12:59:00.000&lt;br /&gt;2011-08-29 13:00:00.000&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsdideas.blogspot.com/feeds/7476355099851114178/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/482602810823403830/7476355099851114178' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/482602810823403830/posts/default/7476355099851114178'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/482602810823403830/posts/default/7476355099851114178'/><link rel='alternate' type='text/html' href='http://jsdideas.blogspot.com/2011/08/rounding-date-in-sql-query.html' title='Rounding date in SQL query'/><author><name>Jayesh Chauhan</name><uri>http://www.blogger.com/profile/07837823503910695576</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-482602810823403830.post-3639341717100924752</id><published>2011-07-01T00:16:00.000-07:00</published><updated>2011-07-01T00:53:05.658-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Group By"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL 2008"/><title type='text'>Use of Rollup, Grouping, Grouping_ID and Cube in Group By</title><content type='html'>&lt;pre class=&quot;csharpcode&quot;&gt;&lt;br /&gt;&lt;b&gt;ROLLUP&lt;/b&gt; = Generates the simple GROUP BY aggregate rows&lt;br /&gt;  , plus subtotal or super-aggregate rows&lt;br /&gt;  , and also a grand total row.&lt;br /&gt;&lt;b&gt;GROUPING&lt;/b&gt; = Indicates whether a specified column expression in a GROUP BY list is aggregated or not.&lt;br /&gt;&lt;b&gt;GROUPING_ID&lt;/b&gt; = Is a function that computes the level of grouping.&lt;br /&gt;&lt;b&gt;CUBE = &lt;/b&gt;Generates simple GROUP BY aggregate rows, the ROLLUP super-aggregate rows, and cross-tabulation rows.&lt;br /&gt;&lt;h3&gt;Sample Data&lt;/h3&gt;&lt;span class=&quot;kwrd&quot;&gt;DECLARE&lt;/span&gt; @Sales &lt;span class=&quot;kwrd&quot;&gt;TABLE&lt;/span&gt; (&lt;span class=&quot;kwrd&quot;&gt;Year&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;INT&lt;/span&gt;, Quarter &lt;span class=&quot;kwrd&quot;&gt;VARCHAR&lt;/span&gt;(50), SalesPerson &lt;span class=&quot;kwrd&quot;&gt;VARCHAR&lt;/span&gt;(50), Amount &lt;span class=&quot;kwrd&quot;&gt;FLOAT&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;INSERT&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;INTO&lt;/span&gt; @Sales &lt;span class=&quot;kwrd&quot;&gt;values&lt;/span&gt;&lt;br /&gt;      (1998, &lt;span class=&quot;str&quot;&gt;&#39;Q1&#39;&lt;/span&gt;, &lt;span class=&quot;str&quot;&gt;&#39;SalePerson1&#39;&lt;/span&gt;, 123)&lt;br /&gt;    , (1998, &lt;span class=&quot;str&quot;&gt;&#39;Q2&#39;&lt;/span&gt;, &lt;span class=&quot;str&quot;&gt;&#39;SalePerson2&#39;&lt;/span&gt;, 234)&lt;br /&gt;    , (1998, &lt;span class=&quot;str&quot;&gt;&#39;Q3&#39;&lt;/span&gt;, &lt;span class=&quot;str&quot;&gt;&#39;SalePerson4&#39;&lt;/span&gt;, 345)&lt;br /&gt;    , (1998, &lt;span class=&quot;str&quot;&gt;&#39;Q4&#39;&lt;/span&gt;, &lt;span class=&quot;str&quot;&gt;&#39;SalePerson3&#39;&lt;/span&gt;, 556)&lt;br /&gt;    , (1999, &lt;span class=&quot;str&quot;&gt;&#39;Q1&#39;&lt;/span&gt;, &lt;span class=&quot;str&quot;&gt;&#39;SalePerson1&#39;&lt;/span&gt;, 623)&lt;br /&gt;    , (1999, &lt;span class=&quot;str&quot;&gt;&#39;Q2&#39;&lt;/span&gt;, &lt;span class=&quot;str&quot;&gt;&#39;SalePerson2&#39;&lt;/span&gt;, 734)&lt;br /&gt;    , (1999, &lt;span class=&quot;str&quot;&gt;&#39;Q3&#39;&lt;/span&gt;, &lt;span class=&quot;str&quot;&gt;&#39;SalePerson3&#39;&lt;/span&gt;, 845)&lt;br /&gt;    , (1999, &lt;span class=&quot;str&quot;&gt;&#39;Q4&#39;&lt;/span&gt;, &lt;span class=&quot;str&quot;&gt;&#39;SalePerson4&#39;&lt;/span&gt;, 956)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Example 1 :&lt;/b&gt; (Single field in grouping)&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;SELECT&lt;/span&gt;&lt;br /&gt;     [&lt;span class=&quot;kwrd&quot;&gt;Year&lt;/span&gt;]&lt;br /&gt;    , &lt;span class=&quot;kwrd&quot;&gt;AVG&lt;/span&gt;(Amount) &lt;span class=&quot;kwrd&quot;&gt;as&lt;/span&gt; Average&lt;br /&gt;    , &lt;span class=&quot;kwrd&quot;&gt;GROUPING&lt;/span&gt;([&lt;span class=&quot;kwrd&quot;&gt;Year&lt;/span&gt;]) &lt;span class=&quot;kwrd&quot;&gt;as&lt;/span&gt; [YearRollUp?]&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;FROM&lt;/span&gt; &lt;br /&gt;    @Sales&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;GROUP&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;BY&lt;/span&gt;&lt;br /&gt;    [&lt;span class=&quot;kwrd&quot;&gt;Year&lt;/span&gt;] &lt;span class=&quot;kwrd&quot;&gt;WITH&lt;/span&gt; ROLLUP&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Output :&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Year        Average                YearRollUp?&lt;br /&gt;----------- ---------------------- -----------&lt;br /&gt;1998        314.5                  0&lt;br /&gt;1999        789.5                  0&lt;br /&gt;NULL        552                    1&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Example 2 :&lt;/b&gt; (Multipal field in grouping)&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;SELECT&lt;/span&gt;&lt;br /&gt;    [&lt;span class=&quot;kwrd&quot;&gt;Year&lt;/span&gt;]&lt;br /&gt;    , Quarter&lt;br /&gt;    , &lt;span class=&quot;kwrd&quot;&gt;AVG&lt;/span&gt;(Amount) &lt;span class=&quot;kwrd&quot;&gt;as&lt;/span&gt; Average&lt;br /&gt;    , &lt;span class=&quot;kwrd&quot;&gt;GROUPING&lt;/span&gt;( [&lt;span class=&quot;kwrd&quot;&gt;Year&lt;/span&gt;] ) &lt;span class=&quot;kwrd&quot;&gt;as&lt;/span&gt; [YearRollUp?]&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;FROM&lt;/span&gt; &lt;br /&gt;    @Sales&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;GROUP&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;BY&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;GROUPING&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;SETS&lt;/span&gt; (( [&lt;span class=&quot;kwrd&quot;&gt;Year&lt;/span&gt;], Quarter), ( [&lt;span class=&quot;kwrd&quot;&gt;Year&lt;/span&gt;] ), ())&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Output : &lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Year        Quarter Average                YearRollUp?&lt;br /&gt;----------- ------- ---------------------- -----------&lt;br /&gt;1998        Q1      123                    0&lt;br /&gt;1998        Q2      234                    0&lt;br /&gt;1998        Q3      345                    0&lt;br /&gt;1998        Q4      556                    0&lt;br /&gt;1998        NULL    314.5                  0&lt;br /&gt;1999        Q1      623                    0&lt;br /&gt;1999        Q2      734                    0&lt;br /&gt;1999        Q3      845                    0&lt;br /&gt;1999        Q4      956                    0&lt;br /&gt;1999        NULL    789.5                  0&lt;br /&gt;NULL        NULL    552                    1&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Example 3 :&lt;/b&gt;( Example of Grouping_ID )&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;SELECT&lt;/span&gt;&lt;br /&gt;    [&lt;span class=&quot;kwrd&quot;&gt;Year&lt;/span&gt;]&lt;br /&gt;    , Quarter&lt;br /&gt;    , &lt;span class=&quot;kwrd&quot;&gt;AVG&lt;/span&gt;(Amount) &lt;span class=&quot;kwrd&quot;&gt;as&lt;/span&gt; Average&lt;br /&gt;    , GROUPING_ID( [&lt;span class=&quot;kwrd&quot;&gt;Year&lt;/span&gt;], Quarter) &lt;span class=&quot;kwrd&quot;&gt;as&lt;/span&gt; [x]&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;FROM&lt;/span&gt; &lt;br /&gt;    @Sales&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;GROUP&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;BY&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;GROUPING&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;SETS&lt;/span&gt; (( [&lt;span class=&quot;kwrd&quot;&gt;Year&lt;/span&gt;], Quarter), ( [&lt;span class=&quot;kwrd&quot;&gt;Year&lt;/span&gt;] ), ( [Quarter] ), ())&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Output :&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Year        Quarter Average                x&lt;br /&gt;----------- ------- ---------------------- -----------&lt;br /&gt;1998        Q1      123                    0&lt;br /&gt;1999        Q1      623                    0&lt;br /&gt;NULL        Q1      373                    2&lt;br /&gt;1998        Q2      234                    0&lt;br /&gt;1999        Q2      734                    0&lt;br /&gt;NULL        Q2      484                    2&lt;br /&gt;1998        Q3      345                    0&lt;br /&gt;1999        Q3      845                    0&lt;br /&gt;NULL        Q3      595                    2&lt;br /&gt;1998        Q4      556                    0&lt;br /&gt;1999        Q4      956                    0&lt;br /&gt;NULL        Q4      756                    2&lt;br /&gt;NULL        NULL    552                    3&lt;br /&gt;1998        NULL    314.5                  1&lt;br /&gt;1999        NULL    789.5                  1&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Example 4:&lt;/b&gt;(Example of Cube)&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;SELECT&lt;/span&gt;&lt;br /&gt;     [&lt;span class=&quot;kwrd&quot;&gt;Year&lt;/span&gt;]&lt;br /&gt;    , [Quarter]&lt;br /&gt;    , &lt;span class=&quot;kwrd&quot;&gt;AVG&lt;/span&gt;(Amount) &lt;span class=&quot;kwrd&quot;&gt;as&lt;/span&gt; Average&lt;br /&gt;    , GROUPING_ID( [&lt;span class=&quot;kwrd&quot;&gt;Year&lt;/span&gt;], [Quarter]) &lt;span class=&quot;kwrd&quot;&gt;as&lt;/span&gt; [x]&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;FROM&lt;/span&gt; &lt;br /&gt;    @Sales&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;GROUP&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;BY&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;CUBE&lt;/span&gt;( [&lt;span class=&quot;kwrd&quot;&gt;Year&lt;/span&gt;], [Quarter])&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Output :&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Year        Quarter Average                x&lt;br /&gt;----------- ------- ---------------------- -----------&lt;br /&gt;1998        Q1      123                    0&lt;br /&gt;1999        Q1      623                    0&lt;br /&gt;NULL        Q1      373                    2&lt;br /&gt;1998        Q2      234                    0&lt;br /&gt;1999        Q2      734                    0&lt;br /&gt;NULL        Q2      484                    2&lt;br /&gt;1998        Q3      345                    0&lt;br /&gt;1999        Q3      845                    0&lt;br /&gt;NULL        Q3      595                    2&lt;br /&gt;1998        Q4      556                    0&lt;br /&gt;1999        Q4      956                    0&lt;br /&gt;NULL        Q4      756                    2&lt;br /&gt;NULL        NULL    552                    3&lt;br /&gt;1998        NULL    314.5                  1&lt;br /&gt;1999        NULL    789.5                  1&lt;br /&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsdideas.blogspot.com/feeds/3639341717100924752/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/482602810823403830/3639341717100924752' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/482602810823403830/posts/default/3639341717100924752'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/482602810823403830/posts/default/3639341717100924752'/><link rel='alternate' type='text/html' href='http://jsdideas.blogspot.com/2011/07/use-of-rollup-grouping-groupingid-and.html' title='Use of Rollup, Grouping, Grouping_ID and Cube in Group By'/><author><name>Jayesh Chauhan</name><uri>http://www.blogger.com/profile/07837823503910695576</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-482602810823403830.post-8945274281604860223</id><published>2011-06-30T23:15:00.000-07:00</published><updated>2011-06-30T23:20:36.312-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL 2008"/><title type='text'>Query with static output</title><content type='html'>&lt;h2&gt;Query :&lt;/h2&gt;&lt;br /&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;select&lt;/span&gt; * &lt;span class=&quot;kwrd&quot;&gt;from&lt;/span&gt;&lt;br /&gt;(&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;values&lt;/span&gt; (1, 2), (2, 3), (3, 4)&lt;br /&gt;) &lt;span class=&quot;kwrd&quot;&gt;as&lt;/span&gt; MyTable(Col1, Col2)&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;&lt;h2&gt;Output :&lt;/h2&gt;&lt;br /&gt;Col1        Col2&lt;br /&gt;----------- -----------&lt;br /&gt;1           2&lt;br /&gt;2           3&lt;br /&gt;3           4&lt;br /&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsdideas.blogspot.com/feeds/8945274281604860223/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/482602810823403830/8945274281604860223' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/482602810823403830/posts/default/8945274281604860223'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/482602810823403830/posts/default/8945274281604860223'/><link rel='alternate' type='text/html' href='http://jsdideas.blogspot.com/2011/06/query-with-static-output.html' title='Query with static output'/><author><name>Jayesh Chauhan</name><uri>http://www.blogger.com/profile/07837823503910695576</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-482602810823403830.post-9089393110113130338</id><published>2011-04-28T03:35:00.000-07:00</published><updated>2011-09-21T03:43:52.111-07:00</updated><title type='text'>Genrate table to ENUM</title><content type='html'>&lt;div class=&quot;code&quot;&gt;&lt;br /&gt;&lt;span class=&quot;ReservedKeyword&quot;&gt;DECLARE&lt;/span&gt;&amp;nbsp;@TableName&amp;nbsp;&amp;nbsp;&lt;span class=&quot;DataType&quot;&gt;VARCHAR&lt;/span&gt;(20)&amp;nbsp;=&amp;nbsp;&lt;span class=&quot;String&quot;&gt;&#39;tblFileType&#39;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;InlineComment&quot;&gt;-------------&amp;gt;&amp;nbsp;type&amp;nbsp;table&amp;nbsp;name&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;ReservedKeyword&quot;&gt;DECLARE&lt;/span&gt;&amp;nbsp;@ValueField&amp;nbsp;&lt;span class=&quot;DataType&quot;&gt;VARCHAR&lt;/span&gt;(20)&amp;nbsp;=&amp;nbsp;&lt;span class=&quot;String&quot;&gt;&#39;Id&#39;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;InlineComment&quot;&gt;-------------&amp;gt;&amp;nbsp;type&amp;nbsp;ValueField&amp;nbsp;Name&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;ReservedKeyword&quot;&gt;DECLARE&lt;/span&gt;&amp;nbsp;@NameField&amp;nbsp;&amp;nbsp;&lt;span class=&quot;DataType&quot;&gt;VARCHAR&lt;/span&gt;(20)&amp;nbsp;=&amp;nbsp;&lt;span class=&quot;String&quot;&gt;&#39;Name&#39;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;InlineComment&quot;&gt;-------------&amp;gt;&amp;nbsp;type&amp;nbsp;NAme&amp;nbsp;Field&amp;nbsp;Name&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;ReservedKeyword&quot;&gt;BEGIN&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;ReservedKeyword&quot;&gt;DECLARE&lt;/span&gt;&amp;nbsp;@SqlQuery&amp;nbsp;&lt;span class=&quot;DataType&quot;&gt;VARCHAR&lt;/span&gt;(&lt;span class=&quot;Function&quot;&gt;MAX&lt;/span&gt;)&amp;nbsp;=&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;String&quot;&gt;&#39;SELECT&amp;nbsp;&#39;&#39;public&amp;nbsp;enum&amp;nbsp;enum&#39;&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;Function&quot;&gt;REPLACE&lt;/span&gt;(&amp;nbsp;@TableName,&amp;nbsp;&lt;span class=&quot;String&quot;&gt;&#39;tbl&#39;&lt;/span&gt;,&amp;nbsp;&lt;span class=&quot;String&quot;&gt;&#39;&#39;&lt;/span&gt;)&amp;nbsp;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;String&quot;&gt;&#39;&#39;&#39;&amp;nbsp;AS&amp;nbsp;enum&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;UNION&amp;nbsp;ALL&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SELECT&amp;nbsp;&#39;&#39;{&#39;&#39;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;UNION&amp;nbsp;ALL&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SELECT&amp;nbsp;(&amp;nbsp;REPLACE(&#39;&lt;/span&gt;&amp;nbsp;+&amp;nbsp;@NameField&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;String&quot;&gt;&#39;,&amp;nbsp;&#39;&#39;&amp;nbsp;&#39;&#39;,&amp;nbsp;&#39;&#39;&#39;&#39;)&amp;nbsp;+&amp;nbsp;&#39;&#39;&amp;nbsp;=&amp;nbsp;&#39;&#39;&amp;nbsp;+&amp;nbsp;CAST(&amp;nbsp;&#39;&lt;/span&gt;&amp;nbsp;+&amp;nbsp;@ValueField&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;String&quot;&gt;&#39;&amp;nbsp;AS&amp;nbsp;VARCHAR(10)&amp;nbsp;)&amp;nbsp;)&amp;nbsp;+&amp;nbsp;&#39;&#39;,&#39;&#39;&amp;nbsp;FROM&amp;nbsp;&#39;&lt;/span&gt;&amp;nbsp;+&amp;nbsp;@TableName&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;String&quot;&gt;&#39;&amp;nbsp;UNION&amp;nbsp;ALL&amp;nbsp;SELECT&amp;nbsp;&#39;&#39;}&#39;&#39;&amp;nbsp;&#39;&lt;/span&gt;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;ReservedKeyword&quot;&gt;PRINT&lt;/span&gt;&amp;nbsp;@SqlQuery&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;ReservedKeyword&quot;&gt;EXECUTE&lt;/span&gt;(&amp;nbsp;@SqlQuery&amp;nbsp;)&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;InlineComment&quot;&gt;--&amp;nbsp;SELECT&amp;nbsp;Name&amp;nbsp;+&amp;nbsp;&#39;&amp;nbsp;=&amp;nbsp;&#39;&amp;nbsp;+&amp;nbsp;CAST(&amp;nbsp;Id&amp;nbsp;AS&amp;nbsp;VARCHAR(10)&amp;nbsp;)&amp;nbsp;+&amp;nbsp;&#39;,&#39;&amp;nbsp;FROM&amp;nbsp;tblUserRoll&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;ReservedKeyword&quot;&gt;END&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsdideas.blogspot.com/feeds/9089393110113130338/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/482602810823403830/9089393110113130338' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/482602810823403830/posts/default/9089393110113130338'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/482602810823403830/posts/default/9089393110113130338'/><link rel='alternate' type='text/html' href='http://jsdideas.blogspot.com/2011/04/genrate-table-to-enum.html' title='Genrate table to ENUM'/><author><name>Jayesh Chauhan</name><uri>http://www.blogger.com/profile/07837823503910695576</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-482602810823403830.post-5803025737487754462</id><published>2010-11-18T00:27:00.000-08:00</published><updated>2010-11-18T22:52:53.871-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.Net"/><category scheme="http://www.blogger.com/atom/ns#" term="IIS Configration"/><category scheme="http://www.blogger.com/atom/ns#" term="MVC"/><title type='text'>MVC Application Configration in IIS</title><content type='html'>I have referred this site to get the MVC applicaiton working using Virtual directory. There is no direct way to get the MCV working on the IIS. It can run through port by default but making it work with IIS Virtual Directory follow this link. &lt;br /&gt;&lt;br /&gt;1) &lt;a href=&#39;http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx&#39;&gt;http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx&lt;/a&gt;&lt;br /&gt;2) &lt;a href=&#39;http://www.asp.net/mvc/tutorials/using-asp-net-mvc-with-different-versions-of-iis-vb&#39;&gt;http://www.asp.net/mvc/tutorials/using-asp-net-mvc-with-different-versions-of-iis-vb&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsdideas.blogspot.com/feeds/5803025737487754462/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/482602810823403830/5803025737487754462' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/482602810823403830/posts/default/5803025737487754462'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/482602810823403830/posts/default/5803025737487754462'/><link rel='alternate' type='text/html' href='http://jsdideas.blogspot.com/2010/11/mvc-configration-in-iis.html' title='MVC Application Configration in IIS'/><author><name>Jayesh Chauhan</name><uri>http://www.blogger.com/profile/07837823503910695576</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-482602810823403830.post-334381304493125176</id><published>2010-07-20T01:21:00.001-07:00</published><updated>2012-03-23T03:45:13.891-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL 2008"/><title type='text'>Get All Relationship of Primary Key</title><content type='html'>&lt;pre class=&quot;csharpcode&quot;&gt;&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;SELECT&lt;/span&gt;&lt;br /&gt;    PKTableInfo.TABLE_NAME &lt;span class=&quot;kwrd&quot;&gt;AS&lt;/span&gt; PK_Table_Name&lt;br /&gt;    , ConstarintReference.UNIQUE_CONSTRAINT_NAME &lt;span class=&quot;kwrd&quot;&gt;AS&lt;/span&gt; PK_CONSTRAINT_NAME&lt;br /&gt;    , STUFF( (&lt;br /&gt;                &lt;span class=&quot;kwrd&quot;&gt;SELECT&lt;/span&gt;&lt;br /&gt;                    &lt;span class=&quot;str&quot;&gt;&#39;,&#39;&lt;/span&gt; + kcu.COLUMN_NAME&lt;br /&gt;                &lt;span class=&quot;kwrd&quot;&gt;FROM&lt;/span&gt; INFORMATION_SCHEMA.KEY_COLUMN_USAGE  &lt;span class=&quot;kwrd&quot;&gt;AS&lt;/span&gt; kcu&lt;br /&gt;                &lt;span class=&quot;kwrd&quot;&gt;WHERE&lt;/span&gt; kcu.TABLE_CATALOG = PKTableInfo.TABLE_CATALOG&lt;br /&gt;                    &lt;span class=&quot;kwrd&quot;&gt;AND&lt;/span&gt; kcu.TABLE_SCHEMA = PKTableInfo.TABLE_SCHEMA&lt;br /&gt;                    &lt;span class=&quot;kwrd&quot;&gt;AND&lt;/span&gt; kcu.TABLE_NAME = PKTableInfo.TABLE_NAME&lt;br /&gt;                    &lt;span class=&quot;kwrd&quot;&gt;AND&lt;/span&gt; kcu.CONSTRAINT_CATALOG = PKTableInfo.CONSTRAINT_CATALOG&lt;br /&gt;                    &lt;span class=&quot;kwrd&quot;&gt;AND&lt;/span&gt; kcu.CONSTRAINT_SCHEMA = PKTableInfo.CONSTRAINT_SCHEMA&lt;br /&gt;                    &lt;span class=&quot;kwrd&quot;&gt;AND&lt;/span&gt; kcu.CONSTRAINT_NAME = PKTableInfo.CONSTRAINT_NAME&lt;br /&gt;                &lt;span class=&quot;kwrd&quot;&gt;ORDER&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;BY&lt;/span&gt; kcu.ORDINAL_POSITION&lt;br /&gt;                &lt;span class=&quot;kwrd&quot;&gt;FOR&lt;/span&gt; XML &lt;span class=&quot;kwrd&quot;&gt;PATH&lt;/span&gt;(&lt;span class=&quot;str&quot;&gt;&#39;&#39;&lt;/span&gt;)&lt;br /&gt;            ), 1, 1, &lt;span class=&quot;str&quot;&gt;&#39;&#39;&lt;/span&gt;) &lt;span class=&quot;kwrd&quot;&gt;AS&lt;/span&gt; [PK_CONSTRAINT_COLUMNS]&lt;br /&gt;    , FKTableInfo.TABLE_NAME &lt;span class=&quot;kwrd&quot;&gt;AS&lt;/span&gt; FK_Table_Name&lt;br /&gt;    , ConstarintReference.CONSTRAINT_NAME &lt;span class=&quot;kwrd&quot;&gt;AS&lt;/span&gt; FK_CONSTRAINT_NAME&lt;br /&gt;    , STUFF( (&lt;br /&gt;                &lt;span class=&quot;kwrd&quot;&gt;SELECT&lt;/span&gt;&lt;br /&gt;                    &lt;span class=&quot;str&quot;&gt;&#39;,&#39;&lt;/span&gt; + kcu.COLUMN_NAME&lt;br /&gt;                &lt;span class=&quot;kwrd&quot;&gt;FROM&lt;/span&gt; INFORMATION_SCHEMA.KEY_COLUMN_USAGE  &lt;span class=&quot;kwrd&quot;&gt;AS&lt;/span&gt; kcu&lt;br /&gt;                &lt;span class=&quot;kwrd&quot;&gt;WHERE&lt;/span&gt; kcu.TABLE_CATALOG = FKTableInfo.TABLE_CATALOG&lt;br /&gt;                    &lt;span class=&quot;kwrd&quot;&gt;AND&lt;/span&gt; kcu.TABLE_SCHEMA = FKTableInfo.TABLE_SCHEMA&lt;br /&gt;                    &lt;span class=&quot;kwrd&quot;&gt;AND&lt;/span&gt; kcu.TABLE_NAME = FKTableInfo.TABLE_NAME&lt;br /&gt;                    &lt;span class=&quot;kwrd&quot;&gt;AND&lt;/span&gt; kcu.CONSTRAINT_CATALOG = FKTableInfo.CONSTRAINT_CATALOG&lt;br /&gt;                    &lt;span class=&quot;kwrd&quot;&gt;AND&lt;/span&gt; kcu.CONSTRAINT_SCHEMA = FKTableInfo.CONSTRAINT_SCHEMA&lt;br /&gt;                    &lt;span class=&quot;kwrd&quot;&gt;AND&lt;/span&gt; kcu.CONSTRAINT_NAME = FKTableInfo.CONSTRAINT_NAME&lt;br /&gt;                &lt;span class=&quot;kwrd&quot;&gt;ORDER&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;BY&lt;/span&gt; kcu.ORDINAL_POSITION&lt;br /&gt;                &lt;span class=&quot;kwrd&quot;&gt;FOR&lt;/span&gt; XML &lt;span class=&quot;kwrd&quot;&gt;PATH&lt;/span&gt;(&lt;span class=&quot;str&quot;&gt;&#39;&#39;&lt;/span&gt;)&lt;br /&gt;            ), 1, 1, &lt;span class=&quot;str&quot;&gt;&#39;&#39;&lt;/span&gt;) &lt;span class=&quot;kwrd&quot;&gt;AS&lt;/span&gt; [FK_CONSTRAINT_COLUMNS]&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;FROM&lt;/span&gt; INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS  &lt;span class=&quot;kwrd&quot;&gt;AS&lt;/span&gt; ConstarintReference&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;INNER&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;JOIN&lt;/span&gt; INFORMATION_SCHEMA.CONSTRAINT_TABLE_USAGE &lt;span class=&quot;kwrd&quot;&gt;AS&lt;/span&gt; PKTableInfo &lt;span class=&quot;kwrd&quot;&gt;ON&lt;/span&gt; PKTableInfo.CONSTRAINT_CATALOG = ConstarintReference.UNIQUE_CONSTRAINT_CATALOG&lt;br /&gt;        &lt;span class=&quot;kwrd&quot;&gt;AND&lt;/span&gt; PKTableInfo.CONSTRAINT_SCHEMA = ConstarintReference.UNIQUE_CONSTRAINT_SCHEMA&lt;br /&gt;        &lt;span class=&quot;kwrd&quot;&gt;AND&lt;/span&gt; PKTableInfo.CONSTRAINT_NAME = ConstarintReference.UNIQUE_CONSTRAINT_NAME&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;INNER&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;JOIN&lt;/span&gt; INFORMATION_SCHEMA.CONSTRAINT_TABLE_USAGE &lt;span class=&quot;kwrd&quot;&gt;AS&lt;/span&gt; FKTableInfo &lt;span class=&quot;kwrd&quot;&gt;ON&lt;/span&gt; ConstarintReference.CONSTRAINT_CATALOG = FKTableInfo.CONSTRAINT_CATALOG&lt;br /&gt;        &lt;span class=&quot;kwrd&quot;&gt;AND&lt;/span&gt; ConstarintReference.CONSTRAINT_SCHEMA = FKTableInfo.CONSTRAINT_SCHEMA&lt;br /&gt;        &lt;span class=&quot;kwrd&quot;&gt;AND&lt;/span&gt; ConstarintReference.CONSTRAINT_NAME = FKTableInfo.CONSTRAINT_NAME&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;ORDER&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;BY&lt;/span&gt; PK_Table_Name, FK_Table_Name&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;GO&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsdideas.blogspot.com/feeds/334381304493125176/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/482602810823403830/334381304493125176' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/482602810823403830/posts/default/334381304493125176'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/482602810823403830/posts/default/334381304493125176'/><link rel='alternate' type='text/html' href='http://jsdideas.blogspot.com/2010/07/get-all-relationship-of-primary-key.html' title='Get All Relationship of Primary Key'/><author><name>Jayesh Chauhan</name><uri>http://www.blogger.com/profile/07837823503910695576</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-482602810823403830.post-8069001159190095552</id><published>2010-07-17T03:15:00.001-07:00</published><updated>2012-03-23T03:44:47.402-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL 2008"/><title type='text'>Get detailed error handling information in SQL</title><content type='html'>Refer this link&lt;br /&gt;&lt;br /&gt;&lt;a href=&#39;http://msdn.microsoft.com/en-us/library/ms175976.aspx&#39;&gt;http://msdn.microsoft.com/en-us/library/ms175976.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br/&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsdideas.blogspot.com/feeds/8069001159190095552/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/482602810823403830/8069001159190095552' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/482602810823403830/posts/default/8069001159190095552'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/482602810823403830/posts/default/8069001159190095552'/><link rel='alternate' type='text/html' href='http://jsdideas.blogspot.com/2010/07/get-detailed-error-handling-information.html' title='Get detailed error handling information in SQL'/><author><name>Jayesh Chauhan</name><uri>http://www.blogger.com/profile/07837823503910695576</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-482602810823403830.post-6531063903585517662</id><published>2010-07-14T23:06:00.001-07:00</published><updated>2012-03-23T03:42:38.170-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="JQuery"/><category scheme="http://www.blogger.com/atom/ns#" term="Search"/><title type='text'>Searching and Multipal Selection Criteria in JQuery</title><content type='html'>&lt;pre class=&quot;csharpcode&quot;&gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;div&amp;gt;&lt;br /&gt;        &amp;lt;div style=&lt;span class=&quot;str&quot;&gt;&quot;float: left; width: 150px&quot;&lt;/span&gt;&amp;gt;&lt;br /&gt;            Your Gender :&lt;br /&gt;        &amp;lt;/div&amp;gt;&lt;br /&gt;        &amp;lt;div style=&lt;span class=&quot;str&quot;&gt;&quot;float: left; width: 250px&quot;&lt;/span&gt;&amp;gt;&lt;br /&gt;            &amp;lt;asp:RadioButtonList ID=&lt;span class=&quot;str&quot;&gt;&quot;rdbGender&quot;&lt;/span&gt; runat=&lt;span class=&quot;str&quot;&gt;&quot;server&quot;&lt;/span&gt;&amp;gt;&lt;br /&gt;                &amp;lt;asp:ListItem Text=&lt;span class=&quot;str&quot;&gt;&quot;Male&quot;&lt;/span&gt; Value=&lt;span class=&quot;str&quot;&gt;&quot;1&quot;&lt;/span&gt;&amp;gt;&amp;lt;/asp:ListItem&amp;gt;&lt;br /&gt;                &amp;lt;asp:ListItem Text=&lt;span class=&quot;str&quot;&gt;&quot;Female&quot;&lt;/span&gt; Value=&lt;span class=&quot;str&quot;&gt;&quot;0&quot;&lt;/span&gt;&amp;gt;&amp;lt;/asp:ListItem&amp;gt;&lt;br /&gt;            &amp;lt;/asp:RadioButtonList&amp;gt;&lt;br /&gt;        &amp;lt;/div&amp;gt;&lt;br /&gt;    &amp;lt;/div&amp;gt;&lt;br /&gt;    &amp;lt;div style=&lt;span class=&quot;str&quot;&gt;&quot;clear: both&quot;&lt;/span&gt;&amp;gt;&lt;br /&gt;        &amp;lt;div style=&lt;span class=&quot;str&quot;&gt;&quot;float: left; width: 150px&quot;&lt;/span&gt;&amp;gt;&lt;br /&gt;            Searching :&lt;br /&gt;        &amp;lt;/div&amp;gt;&lt;br /&gt;        &amp;lt;div style=&lt;span class=&quot;str&quot;&gt;&quot;float: left; width: 250px&quot;&lt;/span&gt;&amp;gt;&lt;br /&gt;            &amp;lt;asp:RadioButtonList ID=&lt;span class=&quot;str&quot;&gt;&quot;rdbSearching&quot;&lt;/span&gt; runat=&lt;span class=&quot;str&quot;&gt;&quot;server&quot;&lt;/span&gt;&amp;gt;&lt;br /&gt;                &amp;lt;asp:ListItem Text=&lt;span class=&quot;str&quot;&gt;&quot;Groom&quot;&lt;/span&gt; Value=&lt;span class=&quot;str&quot;&gt;&quot;1&quot;&lt;/span&gt;&amp;gt;&amp;lt;/asp:ListItem&amp;gt;&lt;br /&gt;                &amp;lt;asp:ListItem Text=&lt;span class=&quot;str&quot;&gt;&quot;Bride&quot;&lt;/span&gt; Value=&lt;span class=&quot;str&quot;&gt;&quot;0&quot;&lt;/span&gt;&amp;gt;&amp;lt;/asp:ListItem&amp;gt;&lt;br /&gt;            &amp;lt;/asp:RadioButtonList&amp;gt;&lt;br /&gt;        &amp;lt;/div&amp;gt;&lt;br /&gt;    &amp;lt;/div&amp;gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;script type=&lt;span class=&quot;str&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; language=&lt;span class=&quot;str&quot;&gt;&quot;javascript&quot;&lt;/span&gt;&amp;gt;&lt;br /&gt;        $(document).ready(function() {&lt;br /&gt;            $(&lt;span class=&quot;str&quot;&gt;&quot;input[id*=&#39;rdbGender&#39;], input[id*=&#39;rdbSearching&#39;]&quot;&lt;/span&gt;).click(function() {&lt;br /&gt;&lt;br /&gt;                var foundIn = $(&lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;).attr(&lt;span class=&quot;str&quot;&gt;&#39;id&#39;&lt;/span&gt;).toString().search(&lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; RegExp(/rdbGender/i));&lt;br /&gt;&lt;br /&gt;                var strOpositeRadioButton = &lt;span class=&quot;str&quot;&gt;&quot;rdbGender&quot;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;                &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (foundIn &amp;gt; -1) {&lt;br /&gt;                    strOpositeRadioButton = &lt;span class=&quot;str&quot;&gt;&quot;rdbSearching&quot;&lt;/span&gt;;&lt;br /&gt;                }&lt;br /&gt;&lt;br /&gt;                &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; ($(&lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;).val() == 1) {&lt;br /&gt;                    $(&lt;span class=&quot;str&quot;&gt;&quot;input[id*=&quot;&lt;/span&gt; + strOpositeRadioButton + &lt;span class=&quot;str&quot;&gt;&quot;][value=0]&quot;&lt;/span&gt;).attr(&lt;span class=&quot;str&quot;&gt;&quot;checked&quot;&lt;/span&gt;, &lt;span class=&quot;str&quot;&gt;&quot;checked&quot;&lt;/span&gt;);&lt;br /&gt;                }&lt;br /&gt;                &lt;span class=&quot;kwrd&quot;&gt;else&lt;/span&gt; {&lt;br /&gt;                    $(&lt;span class=&quot;str&quot;&gt;&quot;input[id*=&quot;&lt;/span&gt; + strOpositeRadioButton + &lt;span class=&quot;str&quot;&gt;&quot;][value=1]&quot;&lt;/span&gt;).attr(&lt;span class=&quot;str&quot;&gt;&quot;checked&quot;&lt;/span&gt;, &lt;span class=&quot;str&quot;&gt;&quot;checked&quot;&lt;/span&gt;);&lt;br /&gt;                }&lt;br /&gt;            });&lt;br /&gt;        });&lt;br /&gt;    &amp;lt;/script&amp;gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsdideas.blogspot.com/feeds/6531063903585517662/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/482602810823403830/6531063903585517662' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/482602810823403830/posts/default/6531063903585517662'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/482602810823403830/posts/default/6531063903585517662'/><link rel='alternate' type='text/html' href='http://jsdideas.blogspot.com/2010/07/searching-on-jquery.html' title='Searching and Multipal Selection Criteria in JQuery'/><author><name>Jayesh Chauhan</name><uri>http://www.blogger.com/profile/07837823503910695576</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-482602810823403830.post-1186462238761456750</id><published>2010-07-12T01:21:00.000-07:00</published><updated>2010-07-12T01:36:58.836-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="JQuery"/><category scheme="http://www.blogger.com/atom/ns#" term="JSON"/><title type='text'>JQuery</title><content type='html'>&lt;pre class=&quot;csharpcode&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Ready&lt;/span&gt;&lt;br /&gt;-----------------------------------&lt;br /&gt;$(document).read(function(){&lt;br /&gt;    alert(&lt;span class=&quot;str&quot;&gt;&#39;hi&#39;&lt;/span&gt;);&lt;br /&gt;})&lt;br /&gt;&lt;br /&gt;$(document).read(FormSetting)&lt;br /&gt;Function FormSetting()&lt;br /&gt;{&lt;br /&gt;    alert(&lt;span class=&quot;str&quot;&gt;&#39;hi&#39;&lt;/span&gt;);&lt;br /&gt;}&lt;br /&gt;-----------------------------------&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Selection Criteria&lt;/span&gt;&lt;br /&gt;-----------------------------------&lt;br /&gt;=&amp;gt; ID&lt;br /&gt;   $(&lt;span class=&quot;str&quot;&gt;&quot;#txtUserName&quot;&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;=&amp;gt; Control&lt;br /&gt;   $(&lt;span class=&quot;str&quot;&gt;&quot;input&quot;&lt;/span&gt;)&lt;br /&gt;   $(&lt;span class=&quot;str&quot;&gt;&quot;div&quot;&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;=&amp;gt; Inner Control&lt;br /&gt;   $(&lt;span class=&quot;str&quot;&gt;&quot;div div input&quot;&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;=&amp;gt; Class&lt;br /&gt;   $(&lt;span class=&quot;str&quot;&gt;&quot;.button&quot;&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;=&amp;gt; Selection on standard attributes&lt;br /&gt;   $(&lt;span class=&quot;str&quot;&gt;&quot;input[type=&#39;button&#39;]&quot;&lt;/span&gt;) &lt;br /&gt;&lt;br /&gt;=&amp;gt; Selection on custome attributes&lt;br /&gt;   &amp;lt;input type=&lt;span class=&quot;str&quot;&gt;&quot;text&quot;&lt;/span&gt; IsGridText=&lt;span class=&quot;str&quot;&gt;&quot;True&quot;&lt;/span&gt; /&amp;gt;&lt;br /&gt;   $(&lt;span class=&quot;str&quot;&gt;&quot;input[IsGridText =&#39;True&#39;]&quot;&lt;/span&gt;)&lt;br /&gt;-----------------------------------&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Functions&lt;/span&gt;&lt;br /&gt;-----------------------------------&lt;br /&gt;=&amp;gt; VAL()&lt;br /&gt;   Var strUserName = $(&lt;span class=&quot;str&quot;&gt;&quot;#txtUserName).val();&lt;br /&gt;   $(&quot;&lt;/span&gt;#txtUserName).val(&lt;span class=&quot;str&quot;&gt;&quot;jsd24&quot;&lt;/span&gt;);&lt;br /&gt;&lt;br /&gt;=&amp;gt; HTML()&lt;br /&gt;   Var strInnerHtml = $(&lt;span class=&quot;str&quot;&gt;&quot;#divUserInfo).html();&lt;br /&gt;   $(&quot;&lt;/span&gt;#divUserInfo).html(&lt;span class=&quot;str&quot;&gt;&quot;&amp;lt;a href=&#39;#&#39;     OnClick=&#39;Alert(1)&#39;&amp;gt;Click Me&amp;lt;/a&amp;gt;&quot;&lt;/span&gt;);&lt;br /&gt;&lt;br /&gt;=&amp;gt; Attr ( attribute)&lt;br /&gt;   var IsGridText = $(&lt;span class=&quot;str&quot;&gt;&quot;#txtUserName&quot;&lt;/span&gt;).attr(&lt;span class=&quot;str&quot;&gt;&quot;IsGridText&quot;&lt;/span&gt;);&lt;br /&gt;   $(&lt;span class=&quot;str&quot;&gt;&quot;#txtUserName&quot;&lt;/span&gt;).attr(&lt;span class=&quot;str&quot;&gt;&quot;IsGridText&quot;&lt;/span&gt;, &lt;span class=&quot;str&quot;&gt;&quot;False&quot;&lt;/span&gt;);&lt;br /&gt;   $(&lt;span class=&quot;str&quot;&gt;&quot;#txtUserName&quot;&lt;/span&gt;).attr({IsGridText:&lt;span class=&quot;str&quot;&gt;&#39;True&#39;&lt;/span&gt;, IsSelected:&lt;span class=&quot;str&quot;&gt;&#39;True&#39;&lt;/span&gt;});&lt;br /&gt;&lt;br /&gt;=&amp;gt; Css (style sheet)&lt;br /&gt;   var color = $(&lt;span class=&quot;str&quot;&gt;&quot;#txtUserName&quot;&lt;/span&gt;).css(&lt;span class=&quot;str&quot;&gt;&quot;color&quot;&lt;/span&gt;);&lt;br /&gt;   $(&lt;span class=&quot;str&quot;&gt;&quot;#txtUserName&quot;&lt;/span&gt;).css(&lt;span class=&quot;str&quot;&gt;&quot;color&quot;&lt;/span&gt;, &lt;span class=&quot;str&quot;&gt;&quot;red&quot;&lt;/span&gt;);&lt;br /&gt;   $(&lt;span class=&quot;str&quot;&gt;&quot;#txtUserName&quot;&lt;/span&gt;).css({&lt;span class=&quot;str&quot;&gt;&#39;width&#39;&lt;/span&gt;: &lt;span class=&quot;str&quot;&gt;&#39;100px&#39;&lt;/span&gt;, &lt;span class=&quot;str&quot;&gt;&#39;height&#39;&lt;/span&gt;:&lt;span class=&quot;str&quot;&gt;&#39;25px&#39;&lt;/span&gt;});&lt;br /&gt; &lt;br /&gt;=&amp;gt; Each&lt;br /&gt;   $(&lt;span class=&quot;str&quot;&gt;&quot;input&quot;&lt;/span&gt;).each(function() { $(&lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;).val(&lt;span class=&quot;str&quot;&gt;&quot;jd&quot;&lt;/span&gt;); })&lt;br /&gt;&lt;br /&gt;=&amp;gt; addClass()&lt;br /&gt;   $(&lt;span class=&quot;str&quot;&gt;&quot;input[type=&#39;button&#39;]&quot;&lt;/span&gt;).addClass(&lt;span class=&quot;str&quot;&gt;&quot;button&quot;&lt;/span&gt;);&lt;br /&gt;&lt;br /&gt;=&amp;gt; removeClass()&lt;br /&gt;   $(&lt;span class=&quot;str&quot;&gt;&quot;input[type=&#39;button&#39;]&quot;&lt;/span&gt;).removeClass(&lt;span class=&quot;str&quot;&gt;&quot;button&quot;&lt;/span&gt;);&lt;br /&gt;&lt;br /&gt;=&amp;gt; haseClass()&lt;br /&gt;   $(&lt;span class=&quot;str&quot;&gt;&quot;#txtUserName&quot;&lt;/span&gt;).haseClass(&lt;span class=&quot;str&quot;&gt;&quot;UserName&quot;&lt;/span&gt;);&lt;br /&gt;   $(&lt;span class=&quot;str&quot;&gt;&quot;#txtUserName&quot;&lt;/span&gt;).haseClass(&lt;span class=&quot;str&quot;&gt;&quot;EmailID&quot;&lt;/span&gt;);&lt;br /&gt;&lt;br /&gt;=&amp;gt; toggleClass()&lt;br /&gt;   $(&lt;span class=&quot;str&quot;&gt;&quot;#divUserInfo&quot;&lt;/span&gt;).toggleClass(&lt;span class=&quot;str&quot;&gt;&quot;Content&quot;&lt;/span&gt;);&lt;br /&gt;&lt;br /&gt;=&amp;gt; height()&lt;br /&gt;   $(&lt;span class=&quot;str&quot;&gt;&quot;#divUserInfo&quot;&lt;/span&gt;).height();&lt;br /&gt;&lt;br /&gt;=&amp;gt; innerHeight()&lt;br /&gt;   $(&lt;span class=&quot;str&quot;&gt;&quot;#divUserInfo&quot;&lt;/span&gt;).innerHeight();&lt;br /&gt;&lt;br /&gt;=&amp;gt; outerHeight()&lt;br /&gt;   $(&lt;span class=&quot;str&quot;&gt;&quot;#divUserInfo&quot;&lt;/span&gt;).outerHeight();&lt;br /&gt;&lt;br /&gt;=&amp;gt; width()&lt;br /&gt;   $(&lt;span class=&quot;str&quot;&gt;&quot;#divUserInfo&quot;&lt;/span&gt;).width();&lt;br /&gt;&lt;br /&gt;=&amp;gt; innerWidth ()&lt;br /&gt;   $(&lt;span class=&quot;str&quot;&gt;&quot;#divUserInfo&quot;&lt;/span&gt;).innerWidth ();&lt;br /&gt;&lt;br /&gt;=&amp;gt; outerWidth ()&lt;br /&gt;   $(&lt;span class=&quot;str&quot;&gt;&quot;#divUserInfo&quot;&lt;/span&gt;).outerWidth ();&lt;br /&gt;&lt;br /&gt;=&amp;gt; fadeIn()&lt;br /&gt;   $(&lt;span class=&quot;str&quot;&gt;&quot;#divUserInfo&quot;&lt;/span&gt;).fadeIn();&lt;br /&gt;&lt;br /&gt;=&amp;gt; fadeOut()&lt;br /&gt;   $(&lt;span class=&quot;str&quot;&gt;&quot;#divUserInfo&quot;&lt;/span&gt;).fadeOut ();&lt;br /&gt;&lt;br /&gt;=&amp;gt; hide()&lt;br /&gt;   $(&lt;span class=&quot;str&quot;&gt;&quot;#divUserInfo&quot;&lt;/span&gt;).hide();&lt;br /&gt;&lt;br /&gt;=&amp;gt; show()&lt;br /&gt;   $(&lt;span class=&quot;str&quot;&gt;&quot;#divUserInfo&quot;&lt;/span&gt;).show();&lt;br /&gt;&lt;br /&gt;=&amp;gt; appendTo    &lt;br /&gt;$(&lt;span class=&quot;str&quot;&gt;&quot;Hello&quot;&lt;/span&gt;).appendTo(&lt;span class=&quot;str&quot;&gt;&quot;#divUserInfo&quot;&lt;/span&gt;);&lt;br /&gt;&lt;br /&gt;=&amp;gt; clone&lt;br /&gt;$(&lt;span class=&quot;str&quot;&gt;&quot;#divUserInfo&quot;&lt;/span&gt;).clone().appendTo(&lt;span class=&quot;str&quot;&gt;&quot;#divUserInfo1&quot;&lt;/span&gt;);&lt;br /&gt;&lt;br /&gt;=&amp;gt; not&lt;br /&gt;$(&lt;span class=&quot;str&quot;&gt;&quot;#ddlProductList option&quot;&lt;/span&gt;).not(&lt;span class=&quot;str&quot;&gt;&quot;[value*=&#39;Computer&#39;]&quot;&lt;/span&gt;).clone().appendTo(&lt;span class=&quot;str&quot;&gt;&quot;#ddlFilterList&quot;&lt;/span&gt;);&lt;br /&gt;-----------------------------------&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Multiple Action in single line&lt;/span&gt;&lt;br /&gt;-----------------------------------&lt;br /&gt;$(&lt;span class=&quot;str&quot;&gt;&quot;#txtUserName&quot;&lt;/span&gt;).val(&lt;span class=&quot;str&quot;&gt;&quot;JSD24&quot;&lt;/span&gt;).css(&lt;span class=&quot;str&quot;&gt;&quot;color&quot;&lt;/span&gt;, &lt;span class=&quot;str&quot;&gt;&quot;green&quot;&lt;/span&gt;).attr(&lt;span class=&quot;str&quot;&gt;&quot;IsSelected&quot;&lt;/span&gt;, &lt;span class=&quot;str&quot;&gt;&quot;true&quot;&lt;/span&gt;)&lt;br /&gt;-----------------------------------&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Events&lt;/span&gt;&lt;br /&gt;-----------------------------------&lt;br /&gt;=&amp;gt; change()&lt;br /&gt;   $(&lt;span class=&quot;str&quot;&gt;&quot;#txtUserName&quot;&lt;/span&gt;).change(function(){});&lt;br /&gt;   &lt;br /&gt;=&amp;gt; click()&lt;br /&gt;   $(&lt;span class=&quot;str&quot;&gt;&quot;a&quot;&lt;/span&gt;).click(function(){});&lt;br /&gt;&lt;br /&gt;=&amp;gt; dblclick()&lt;br /&gt;   $(&lt;span class=&quot;str&quot;&gt;&quot;a&quot;&lt;/span&gt;).dblclick(function(){});&lt;br /&gt;&lt;br /&gt;=&amp;gt; focus()&lt;br /&gt;   $(&lt;span class=&quot;str&quot;&gt;&quot;#txtUserName&quot;&lt;/span&gt;).focus();&lt;br /&gt;&lt;br /&gt;=&amp;gt; focusIn()&lt;br /&gt;   $(&lt;span class=&quot;str&quot;&gt;&quot;#txtUserName&quot;&lt;/span&gt;).focusIn(function());&lt;br /&gt;&lt;br /&gt;=&amp;gt; focusOut()&lt;br /&gt;   $(&lt;span class=&quot;str&quot;&gt;&quot;#txtUserName&quot;&lt;/span&gt;).focusOut(function());&lt;br /&gt;&lt;br /&gt;=&amp;gt; hover()&lt;br /&gt;   $(&lt;span class=&quot;str&quot;&gt;&quot;#txtUserName&quot;&lt;/span&gt;).hover(function());&lt;br /&gt;&lt;br /&gt;=&amp;gt; keydown()&lt;br /&gt;   $(&lt;span class=&quot;str&quot;&gt;&quot;#txtUserName&quot;&lt;/span&gt;).keydown(function());&lt;br /&gt;&lt;br /&gt;=&amp;gt; keyup()&lt;br /&gt;   $(&lt;span class=&quot;str&quot;&gt;&quot;#txtUserName&quot;&lt;/span&gt;).keyup(function());&lt;br /&gt;&lt;br /&gt;=&amp;gt; keypress ()&lt;br /&gt;   $(&lt;span class=&quot;str&quot;&gt;&quot;#txtUserName&quot;&lt;/span&gt;).keypress(function());&lt;br /&gt;&lt;br /&gt;=&amp;gt; mousedown()&lt;br /&gt;   $(&lt;span class=&quot;str&quot;&gt;&quot;#txtUserName&quot;&lt;/span&gt;).mousedown(function());&lt;br /&gt;&lt;br /&gt;=&amp;gt; mouseup()&lt;br /&gt;   $(&lt;span class=&quot;str&quot;&gt;&quot;#txtUserName&quot;&lt;/span&gt;).mouseup(function());&lt;br /&gt;&lt;br /&gt;=&amp;gt; mousemove()&lt;br /&gt;   $(&lt;span class=&quot;str&quot;&gt;&quot;#txtUserName&quot;&lt;/span&gt;).mousemove(function());&lt;br /&gt;-----------------------------------&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;AJAX / JSON&lt;/span&gt;&lt;br /&gt;-----------------------------------&lt;br /&gt;$.ajax({&lt;br /&gt;        url : &lt;span class=&quot;str&quot;&gt;&quot;test.html&quot;&lt;/span&gt;,&lt;br /&gt;        type:&lt;span class=&quot;str&quot;&gt;&quot;GET&quot;&lt;/span&gt; ,         &lt;span class=&quot;rem&quot;&gt;//Post&lt;/span&gt;&lt;br /&gt;        data : { id : &lt;span class=&quot;str&quot;&gt;&quot;2&quot;&lt;/span&gt;, pid : &lt;span class=&quot;str&quot;&gt;&quot;1&quot;&lt;/span&gt; },&lt;br /&gt;        context: document.body,&lt;br /&gt;        datatype : &lt;span class=&quot;str&quot;&gt;&quot;html&quot;&lt;/span&gt;        &lt;span class=&quot;rem&quot;&gt;//JSON, XML&lt;/span&gt;&lt;br /&gt;        success : handleResponse,&lt;br /&gt;        error : handleError&lt;br /&gt;});&lt;br /&gt;&lt;br /&gt;Function handleResponse(data)&lt;br /&gt;{&lt;br /&gt;    alert(data);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Function handleError(msg)&lt;br /&gt;{&lt;br /&gt;    alert(msg);&lt;br /&gt;}&lt;br /&gt;-----------------------------------&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsdideas.blogspot.com/feeds/1186462238761456750/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/482602810823403830/1186462238761456750' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/482602810823403830/posts/default/1186462238761456750'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/482602810823403830/posts/default/1186462238761456750'/><link rel='alternate' type='text/html' href='http://jsdideas.blogspot.com/2010/07/jquery.html' title='JQuery'/><author><name>Jayesh Chauhan</name><uri>http://www.blogger.com/profile/07837823503910695576</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-482602810823403830.post-1373581873531740228</id><published>2010-07-11T21:32:00.000-07:00</published><updated>2010-07-14T05:17:29.568-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Enum"/><category scheme="http://www.blogger.com/atom/ns#" term="Javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="JQuery"/><category scheme="http://www.blogger.com/atom/ns#" term="JSON"/><title type='text'>Using Enum in Javascript</title><content type='html'>&lt;pre class=&quot;csharpcode&quot;&gt;&lt;br /&gt;&amp;lt;script type=&lt;span class=&quot;str&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; language=&lt;span class=&quot;str&quot;&gt;&quot;javascript&quot;&lt;/span&gt;&amp;gt;&lt;br /&gt;    var enumTabInfo = { &lt;br /&gt;                        BasicInformation: 1, &lt;br /&gt;                        SkillDetail: 2, &lt;br /&gt;                        EducationDetail: 3, &lt;br /&gt;                        ProjectDetail: 4, &lt;br /&gt;                        CompanyDetail: 5 &lt;br /&gt;                      }&lt;br /&gt;    &lt;br /&gt;    $(document).ready(function(){ &lt;br /&gt;        $(&lt;span class=&quot;str&quot;&gt;&quot;div.UserTab&quot;&lt;/span&gt;).Hide();&lt;br /&gt;        &lt;br /&gt;        var intTabNo = Number($(&lt;span class=&quot;str&quot;&gt;&quot;#&amp;lt;%= hdnCurrentTab.ClientID %&amp;gt;&quot;&lt;/span&gt;).val());&lt;br /&gt;&lt;br /&gt;        &lt;span class=&quot;kwrd&quot;&gt;switch&lt;/span&gt; (intTabNo) {&lt;br /&gt;            &lt;span class=&quot;kwrd&quot;&gt;case&lt;/span&gt; enumPageStep.BasicInformation:&lt;br /&gt;                $(&lt;span class=&quot;str&quot;&gt;&quot;#divBasicInformation&quot;&lt;/span&gt;).show();&lt;br /&gt;                &lt;span class=&quot;kwrd&quot;&gt;break&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;            &lt;span class=&quot;kwrd&quot;&gt;case&lt;/span&gt; enumPageStep.SkillDetail:&lt;br /&gt;                $(&lt;span class=&quot;str&quot;&gt;&quot;#divSkillDetail&quot;&lt;/span&gt;).show();&lt;br /&gt;                &lt;span class=&quot;kwrd&quot;&gt;break&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;            &lt;span class=&quot;kwrd&quot;&gt;case&lt;/span&gt; enumPageStep.EducationDetail:&lt;br /&gt;                $(&lt;span class=&quot;str&quot;&gt;&quot;#divEducationDetail&quot;&lt;/span&gt;).show();&lt;br /&gt;                &lt;span class=&quot;kwrd&quot;&gt;break&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;            &lt;span class=&quot;kwrd&quot;&gt;case&lt;/span&gt; enumPageStep.ProjectDetail:&lt;br /&gt;                $(&lt;span class=&quot;str&quot;&gt;&quot;#divProjectDetail&quot;&lt;/span&gt;).show();&lt;br /&gt;                &lt;span class=&quot;kwrd&quot;&gt;break&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;            &lt;span class=&quot;kwrd&quot;&gt;case&lt;/span&gt; enumPageStep.CompanyDetail:&lt;br /&gt;                $(&lt;span class=&quot;str&quot;&gt;&quot;#divCompanyDetail&quot;&lt;/span&gt;).show();&lt;br /&gt;                &lt;span class=&quot;kwrd&quot;&gt;break&lt;/span&gt;;&lt;br /&gt;        }&lt;br /&gt;    });&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsdideas.blogspot.com/feeds/1373581873531740228/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/482602810823403830/1373581873531740228' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/482602810823403830/posts/default/1373581873531740228'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/482602810823403830/posts/default/1373581873531740228'/><link rel='alternate' type='text/html' href='http://jsdideas.blogspot.com/2010/07/using-enum-in-javascript.html' title='Using Enum in Javascript'/><author><name>Jayesh Chauhan</name><uri>http://www.blogger.com/profile/07837823503910695576</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-482602810823403830.post-5458699667577994774</id><published>2010-07-10T03:39:00.000-07:00</published><updated>2011-05-31T22:16:02.017-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Database"/><category scheme="http://www.blogger.com/atom/ns#" term="Enum"/><category scheme="http://www.blogger.com/atom/ns#" term="Enum Extention"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL 2008"/><title type='text'>Enum Extention</title><content type='html'>&lt;span style=&quot;font-weight:bold;&quot;&gt;Enum Extention :&lt;/span&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; EnumExtention&lt;br /&gt;    {&lt;br /&gt;        &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;static&lt;/span&gt; Dictionary&amp;lt;&lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt;, &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;&amp;gt; GetEnumData(&lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt; Type EnumType)&lt;br /&gt;        {&lt;br /&gt;            Dictionary&amp;lt;&lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt;, &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;&amp;gt; objEnumList = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; Dictionary&amp;lt;&lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt;, &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;&amp;gt;();&lt;br /&gt;&lt;br /&gt;            &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (EnumType != &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt; &amp;amp;&amp;amp; EnumType.IsEnum)&lt;br /&gt;            {&lt;br /&gt;                &lt;span class=&quot;kwrd&quot;&gt;foreach&lt;/span&gt; (&lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt; intCount &lt;span class=&quot;kwrd&quot;&gt;in&lt;/span&gt; Enum.GetValues(EnumType))&lt;br /&gt;                {&lt;br /&gt;                    objEnumList.Add(intCount, Enum.GetName(EnumType, intCount).ToString().Replace(&lt;span class=&quot;str&quot;&gt;&quot;_&quot;&lt;/span&gt;, &lt;span class=&quot;str&quot;&gt;&quot; &quot;&lt;/span&gt;));&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;            &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; objEnumList;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;/pre&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Get Enum Data :&lt;/span&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;br /&gt;        &lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;enum&lt;/span&gt; enumUserType&lt;br /&gt;        {&lt;br /&gt;            Admin,&lt;br /&gt;            Sales_Department,&lt;br /&gt;            Purchase_Department,&lt;br /&gt;            Guest&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        &lt;span class=&quot;kwrd&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; Page_Load(&lt;span class=&quot;kwrd&quot;&gt;object&lt;/span&gt; sender, EventArgs e)&lt;br /&gt;        {&lt;br /&gt;            ddlUserType.DataSource = &lt;span class=&quot;kwrd&quot;&gt;typeof&lt;/span&gt;(enumUserType).GetEnumData();&lt;br /&gt;            &lt;br /&gt;            ddlUserType.DataTextField = &lt;span class=&quot;str&quot;&gt;&quot;Value&quot;&lt;/span&gt;;&lt;br /&gt;            ddlUserType.DataValueField = &lt;span class=&quot;str&quot;&gt;&quot;Key&quot;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;            ddlUserType.DataBind();&lt;br /&gt;        }&lt;br /&gt;&lt;/pre&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Output :&lt;/span&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;br /&gt;&amp;lt;select name=&lt;span class=&quot;str&quot;&gt;&quot;ddlUserType&quot;&lt;/span&gt; id=&lt;span class=&quot;str&quot;&gt;&quot;ddlUserType&quot;&lt;/span&gt;&amp;gt;&lt;br /&gt;    &amp;lt;option &lt;span class=&quot;kwrd&quot;&gt;value&lt;/span&gt;=&lt;span class=&quot;str&quot;&gt;&quot;1&quot;&lt;/span&gt;&amp;gt;Admin&amp;lt;/option&amp;gt;&lt;br /&gt;    &amp;lt;option &lt;span class=&quot;kwrd&quot;&gt;value&lt;/span&gt;=&lt;span class=&quot;str&quot;&gt;&quot;2&quot;&lt;/span&gt;&amp;gt;Sales Department&amp;lt;/option&amp;gt;&lt;br /&gt;    &amp;lt;option &lt;span class=&quot;kwrd&quot;&gt;value&lt;/span&gt;=&lt;span class=&quot;str&quot;&gt;&quot;3&quot;&lt;/span&gt;&amp;gt;Purchase Department&amp;lt;/option&amp;gt;&lt;br /&gt;    &amp;lt;option &lt;span class=&quot;kwrd&quot;&gt;value&lt;/span&gt;=&lt;span class=&quot;str&quot;&gt;&quot;4&quot;&lt;/span&gt;&amp;gt;Guest&amp;lt;/option&amp;gt; &lt;br /&gt;&amp;lt;/select&amp;gt;&lt;br /&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsdideas.blogspot.com/feeds/5458699667577994774/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/482602810823403830/5458699667577994774' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/482602810823403830/posts/default/5458699667577994774'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/482602810823403830/posts/default/5458699667577994774'/><link rel='alternate' type='text/html' href='http://jsdideas.blogspot.com/2010/07/enum-extention.html' title='Enum Extention'/><author><name>Jayesh Chauhan</name><uri>http://www.blogger.com/profile/07837823503910695576</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-482602810823403830.post-4971811221776245032</id><published>2010-07-09T23:19:00.000-07:00</published><updated>2010-07-09T23:23:05.612-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Database"/><category scheme="http://www.blogger.com/atom/ns#" term="OUTPUT Clause"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL 2008"/><title type='text'>OUTPUT Clause</title><content type='html'>&lt;span style=&quot;font-weight:bold;&quot;&gt;SQL QUERY :&lt;/span&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;CREATE&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;TABLE&lt;/span&gt; #tblSource ( ID &lt;span class=&quot;kwrd&quot;&gt;INT&lt;/span&gt;, GroupID &lt;span class=&quot;kwrd&quot;&gt;INT&lt;/span&gt;, Name &lt;span class=&quot;kwrd&quot;&gt;VARCHAR&lt;/span&gt;(10) )&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;CREATE&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;TABLE&lt;/span&gt; #tblTarget ( ID &lt;span class=&quot;kwrd&quot;&gt;INT&lt;/span&gt;, GroupID &lt;span class=&quot;kwrd&quot;&gt;INT&lt;/span&gt;, Name &lt;span class=&quot;kwrd&quot;&gt;VARCHAR&lt;/span&gt;(10) )&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;CREATE&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;TABLE&lt;/span&gt; #tblOutPut ( OutputAction &lt;span class=&quot;kwrd&quot;&gt;VARCHAR&lt;/span&gt;(20), ID &lt;span class=&quot;kwrd&quot;&gt;INT&lt;/span&gt;, GroupID &lt;span class=&quot;kwrd&quot;&gt;INT&lt;/span&gt;, NewValueName &lt;span class=&quot;kwrd&quot;&gt;VARCHAR&lt;/span&gt;(10), OldValueName &lt;span class=&quot;kwrd&quot;&gt;VARCHAR&lt;/span&gt;(10) )&lt;br /&gt;    &lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;INSERT&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;INTO&lt;/span&gt; #tblSource &lt;span class=&quot;kwrd&quot;&gt;VALUES&lt;/span&gt; (1,1,&lt;span class=&quot;str&quot;&gt;&#39;a11&#39;&lt;/span&gt;)&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;INSERT&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;INTO&lt;/span&gt; #tblSource &lt;span class=&quot;kwrd&quot;&gt;VALUES&lt;/span&gt; (2,1,&lt;span class=&quot;str&quot;&gt;&#39;a21&#39;&lt;/span&gt;)&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;INSERT&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;INTO&lt;/span&gt; #tblSource &lt;span class=&quot;kwrd&quot;&gt;VALUES&lt;/span&gt; (3,1,&lt;span class=&quot;str&quot;&gt;&#39;a31&#39;&lt;/span&gt;)&lt;br /&gt;    &lt;br /&gt;    -&lt;span class=&quot;rem&quot;&gt;-- Inserted&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;BEGIN&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;kwrd&quot;&gt;INSERT&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;INTO&lt;/span&gt; #tblTarget&lt;br /&gt;                &lt;span class=&quot;kwrd&quot;&gt;OUTPUT&lt;/span&gt; &lt;br /&gt;                    &lt;span class=&quot;str&quot;&gt;&#39;Inserted&#39;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;AS&lt;/span&gt; OutputAction&lt;br /&gt;                    , INSERTED.ID &lt;br /&gt;                    , INSERTED.GroupID&lt;br /&gt;                    , INSERTED.Name&lt;br /&gt;                    , &lt;span class=&quot;kwrd&quot;&gt;NULL&lt;/span&gt;&lt;br /&gt;                &lt;span class=&quot;kwrd&quot;&gt;INTO&lt;/span&gt; #tblOutPut&lt;br /&gt;            &lt;span class=&quot;kwrd&quot;&gt;SELECT&lt;/span&gt; * &lt;span class=&quot;kwrd&quot;&gt;FROM&lt;/span&gt; #tblSource&lt;br /&gt;            &lt;span class=&quot;kwrd&quot;&gt;UNION&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;ALL&lt;/span&gt;&lt;br /&gt;            &lt;span class=&quot;kwrd&quot;&gt;SELECT&lt;/span&gt; ID + 10, GroupID, Name &lt;span class=&quot;kwrd&quot;&gt;FROM&lt;/span&gt; #tblSource;&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;END&lt;/span&gt;&lt;br /&gt;    &lt;br /&gt;    -&lt;span class=&quot;rem&quot;&gt;-- Updated&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;BEGIN&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;kwrd&quot;&gt;UPDATE&lt;/span&gt; #tblTarget&lt;br /&gt;        &lt;span class=&quot;kwrd&quot;&gt;SET&lt;/span&gt; Name = &lt;span class=&quot;kwrd&quot;&gt;CAST&lt;/span&gt;(ID &lt;span class=&quot;kwrd&quot;&gt;AS&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;VARCHAR&lt;/span&gt;) + &lt;span class=&quot;str&quot;&gt;&#39; : &#39;&lt;/span&gt; + Name&lt;br /&gt;        &lt;span class=&quot;kwrd&quot;&gt;OUTPUT&lt;/span&gt; &lt;br /&gt;            &lt;span class=&quot;str&quot;&gt;&#39;Updated&#39;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;AS&lt;/span&gt; OutputAction&lt;br /&gt;            , INSERTED.ID &lt;br /&gt;            , INSERTED.GroupID&lt;br /&gt;            , INSERTED.Name&lt;br /&gt;            , deleted.Name&lt;br /&gt;        &lt;span class=&quot;kwrd&quot;&gt;INTO&lt;/span&gt; #tblOutPut;&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;END&lt;/span&gt;&lt;br /&gt;    &lt;br /&gt;    -&lt;span class=&quot;rem&quot;&gt;-- Deleted&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;BEGIN&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;kwrd&quot;&gt;DELETE&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;FROM&lt;/span&gt; #tblTarget&lt;br /&gt;            &lt;span class=&quot;kwrd&quot;&gt;OUTPUT&lt;/span&gt; &lt;br /&gt;                &lt;span class=&quot;str&quot;&gt;&#39;Deleted&#39;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;AS&lt;/span&gt; OutputAction&lt;br /&gt;                , deleted.ID &lt;br /&gt;                , deleted.GroupID&lt;br /&gt;                , &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;&lt;br /&gt;                , deleted.Name&lt;br /&gt;            &lt;span class=&quot;kwrd&quot;&gt;INTO&lt;/span&gt; #tblOutPut&lt;br /&gt;        &lt;span class=&quot;kwrd&quot;&gt;WHERE&lt;/span&gt; ID &amp;gt;= 10;&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;END&lt;/span&gt;&lt;br /&gt;    &lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;SELECT&lt;/span&gt; * &lt;span class=&quot;kwrd&quot;&gt;FROM&lt;/span&gt; #tblOutPut&lt;br /&gt;&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;DROP&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;TABLE&lt;/span&gt; #tblSource&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;DROP&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;TABLE&lt;/span&gt; #tblTarget&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;DROP&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;TABLE&lt;/span&gt; #tblOutPut&lt;br /&gt;&lt;/pre&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Output :&lt;/span&gt;&lt;pre&gt;OutputAction         ID          GroupID     NewValueName OldValueName&lt;br /&gt;-------------------- ----------- ----------- ------------ ------------&lt;br /&gt;Inserted             1           1           a11          NULL&lt;br /&gt;Inserted             2           1           a21          NULL&lt;br /&gt;Inserted             3           1           a31          NULL&lt;br /&gt;Inserted             11          1           a11          NULL&lt;br /&gt;Inserted             12          1           a21          NULL&lt;br /&gt;Inserted             13          1           a31          NULL&lt;br /&gt;Updated              1           1           1 : a11      a11&lt;br /&gt;Updated              2           1           2 : a21      a21&lt;br /&gt;Updated              3           1           3 : a31      a31&lt;br /&gt;Updated              11          1           11 : a11     a11&lt;br /&gt;Updated              12          1           12 : a21     a21&lt;br /&gt;Updated              13          1           13 : a31     a31&lt;br /&gt;Deleted              11          1           NULL         11 : a11&lt;br /&gt;Deleted              12          1           NULL         12 : a21&lt;br /&gt;Deleted              13          1           NULL         13 : a31&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsdideas.blogspot.com/feeds/4971811221776245032/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/482602810823403830/4971811221776245032' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/482602810823403830/posts/default/4971811221776245032'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/482602810823403830/posts/default/4971811221776245032'/><link rel='alternate' type='text/html' href='http://jsdideas.blogspot.com/2010/07/output-clause.html' title='OUTPUT Clause'/><author><name>Jayesh Chauhan</name><uri>http://www.blogger.com/profile/07837823503910695576</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-482602810823403830.post-3588920725139762786</id><published>2010-07-09T22:04:00.001-07:00</published><updated>2010-07-09T22:08:03.532-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Database"/><category scheme="http://www.blogger.com/atom/ns#" term="Merge Query"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL 2008"/><title type='text'>Merge Statement with insert into output table</title><content type='html'>&lt;pre class=&quot;csharpcode&quot;&gt;&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;DECLARE&lt;/span&gt; @tblMergeOutput &lt;span class=&quot;kwrd&quot;&gt;TABLE&lt;/span&gt;&lt;br /&gt;    (&lt;br /&gt;        ID                BIGINT &lt;span class=&quot;kwrd&quot;&gt;IDENTITY&lt;/span&gt;(1,1)&lt;br /&gt;        , MergeAction    NVARCHAR(100)&lt;br /&gt;        , InsertedId    &lt;span class=&quot;kwrd&quot;&gt;INT&lt;/span&gt;&lt;br /&gt;        , DeletedId        &lt;span class=&quot;kwrd&quot;&gt;INT&lt;/span&gt;&lt;br /&gt;        , GroupID        &lt;span class=&quot;kwrd&quot;&gt;INT&lt;/span&gt;&lt;br /&gt;    )&lt;br /&gt;&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;CREATE&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;TABLE&lt;/span&gt; #tblSource ( ID &lt;span class=&quot;kwrd&quot;&gt;INT&lt;/span&gt;, GroupID &lt;span class=&quot;kwrd&quot;&gt;INT&lt;/span&gt;, Name &lt;span class=&quot;kwrd&quot;&gt;VARCHAR&lt;/span&gt;(10) )&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;CREATE&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;TABLE&lt;/span&gt; #tblTarget ( ID &lt;span class=&quot;kwrd&quot;&gt;INT&lt;/span&gt;, GroupID &lt;span class=&quot;kwrd&quot;&gt;INT&lt;/span&gt;, Name &lt;span class=&quot;kwrd&quot;&gt;VARCHAR&lt;/span&gt;(10) )&lt;br /&gt;&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;INSERT&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;INTO&lt;/span&gt; #tblSource &lt;span class=&quot;kwrd&quot;&gt;VALUES&lt;/span&gt; (1,1,&lt;span class=&quot;str&quot;&gt;&#39;a11&#39;&lt;/span&gt;)&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;INSERT&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;INTO&lt;/span&gt; #tblSource &lt;span class=&quot;kwrd&quot;&gt;VALUES&lt;/span&gt; (2,1,&lt;span class=&quot;str&quot;&gt;&#39;a21&#39;&lt;/span&gt;)&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;INSERT&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;INTO&lt;/span&gt; #tblSource &lt;span class=&quot;kwrd&quot;&gt;VALUES&lt;/span&gt; (3,1,&lt;span class=&quot;str&quot;&gt;&#39;a31&#39;&lt;/span&gt;)&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;INSERT&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;INTO&lt;/span&gt; #tblSource &lt;span class=&quot;kwrd&quot;&gt;VALUES&lt;/span&gt; (4,1,&lt;span class=&quot;str&quot;&gt;&#39;a41&#39;&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;INSERT&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;INTO&lt;/span&gt; #tblTarget &lt;span class=&quot;kwrd&quot;&gt;VALUES&lt;/span&gt; (1,1,&lt;span class=&quot;str&quot;&gt;&#39;a1&#39;&lt;/span&gt;)&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;INSERT&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;INTO&lt;/span&gt; #tblTarget &lt;span class=&quot;kwrd&quot;&gt;VALUES&lt;/span&gt; (3,1,&lt;span class=&quot;str&quot;&gt;&#39;a3&#39;&lt;/span&gt;)&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;INSERT&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;INTO&lt;/span&gt; #tblTarget &lt;span class=&quot;kwrd&quot;&gt;VALUES&lt;/span&gt; (5,1,&lt;span class=&quot;str&quot;&gt;&#39;a5&#39;&lt;/span&gt;)&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;INSERT&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;INTO&lt;/span&gt; #tblTarget &lt;span class=&quot;kwrd&quot;&gt;VALUES&lt;/span&gt; (6,2,&lt;span class=&quot;str&quot;&gt;&#39;b2&#39;&lt;/span&gt;)&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;INSERT&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;INTO&lt;/span&gt; #tblTarget &lt;span class=&quot;kwrd&quot;&gt;VALUES&lt;/span&gt; (7,2,&lt;span class=&quot;str&quot;&gt;&#39;b1&#39;&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;    &lt;br /&gt;    --&lt;span class=&quot;rem&quot;&gt;-- Method 2 : Using Output insert into table&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;BEGIN&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;kwrd&quot;&gt;INSERT&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;INTO&lt;/span&gt; @tblMergeOutput&lt;br /&gt;            &lt;span class=&quot;kwrd&quot;&gt;SELECT&lt;/span&gt; MergeAction, InsertedId, DeletedID, GroupID &lt;br /&gt;            &lt;span class=&quot;kwrd&quot;&gt;FROM&lt;/span&gt;&lt;br /&gt;            (&lt;br /&gt;                MERGE #tblTarget&lt;br /&gt;                &lt;span class=&quot;kwrd&quot;&gt;USING&lt;/span&gt; (&lt;br /&gt;                        &lt;span class=&quot;kwrd&quot;&gt;SELECT&lt;/span&gt; *&lt;br /&gt;                        &lt;span class=&quot;kwrd&quot;&gt;FROM&lt;/span&gt; #tblSource&lt;br /&gt;                    ) &lt;span class=&quot;kwrd&quot;&gt;AS&lt;/span&gt; tblSource&lt;br /&gt;                        &lt;span class=&quot;kwrd&quot;&gt;ON&lt;/span&gt; tblSource.GroupID = #tblTarget.GroupID&lt;br /&gt;                            &lt;span class=&quot;kwrd&quot;&gt;AND&lt;/span&gt; tblSource.ID = #tblTarget.ID&lt;br /&gt;                &lt;span class=&quot;kwrd&quot;&gt;WHEN&lt;/span&gt; MATCHED &lt;span class=&quot;kwrd&quot;&gt;THEN&lt;/span&gt; &lt;br /&gt;                    &lt;span class=&quot;kwrd&quot;&gt;UPDATE&lt;/span&gt;&lt;br /&gt;                    &lt;span class=&quot;kwrd&quot;&gt;SET&lt;/span&gt; Name = tblSource.Name&lt;br /&gt;                &lt;span class=&quot;kwrd&quot;&gt;WHEN&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;NOT&lt;/span&gt; MATCHED &lt;span class=&quot;kwrd&quot;&gt;THEN&lt;/span&gt;&lt;br /&gt;                    &lt;span class=&quot;kwrd&quot;&gt;INSERT&lt;/span&gt; (&lt;br /&gt;                                ID&lt;br /&gt;                                , GroupID&lt;br /&gt;                                , Name&lt;br /&gt;                            )&lt;br /&gt;                    &lt;span class=&quot;kwrd&quot;&gt;VALUES&lt;/span&gt; ( &lt;br /&gt;                                tblSource.ID&lt;br /&gt;                                , tblSource.GroupID&lt;br /&gt;                                , tblSource.Name&lt;br /&gt;                            )&lt;br /&gt;                &lt;span class=&quot;kwrd&quot;&gt;WHEN&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;NOT&lt;/span&gt; MATCHED &lt;span class=&quot;kwrd&quot;&gt;BY&lt;/span&gt; SOURCE &lt;span class=&quot;kwrd&quot;&gt;AND&lt;/span&gt; #tblTarget.GroupID = 1&lt;br /&gt;                    &lt;span class=&quot;kwrd&quot;&gt;THEN&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;DELETE&lt;/span&gt;&lt;br /&gt;                &lt;span class=&quot;kwrd&quot;&gt;OUTPUT&lt;/span&gt; &lt;br /&gt;                    $&lt;span class=&quot;kwrd&quot;&gt;action&lt;/span&gt;                &lt;span class=&quot;kwrd&quot;&gt;AS&lt;/span&gt; MergeAction&lt;br /&gt;                    , inserted.Id        &lt;span class=&quot;kwrd&quot;&gt;AS&lt;/span&gt; InsertedId&lt;br /&gt;                    , deleted.Id        &lt;span class=&quot;kwrd&quot;&gt;AS&lt;/span&gt; DeletedID&lt;br /&gt;                    , tblSource.GroupID    &lt;span class=&quot;kwrd&quot;&gt;AS&lt;/span&gt; GroupID&lt;br /&gt;            ) &lt;span class=&quot;kwrd&quot;&gt;AS&lt;/span&gt; MergeOutput (MergeAction, InsertedId, DeletedID, GroupID);&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;END&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;SELECT&lt;/span&gt; * &lt;span class=&quot;kwrd&quot;&gt;FROM&lt;/span&gt; #tblTarget &lt;span class=&quot;kwrd&quot;&gt;order&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;by&lt;/span&gt; GroupID, ID&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;SELECT&lt;/span&gt; * &lt;span class=&quot;kwrd&quot;&gt;FROM&lt;/span&gt; @tblMergeOutput&lt;br /&gt;&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;DROP&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;TABLE&lt;/span&gt; #tblSource&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;DROP&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;TABLE&lt;/span&gt; #tblTarget&lt;br /&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsdideas.blogspot.com/feeds/3588920725139762786/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/482602810823403830/3588920725139762786' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/482602810823403830/posts/default/3588920725139762786'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/482602810823403830/posts/default/3588920725139762786'/><link rel='alternate' type='text/html' href='http://jsdideas.blogspot.com/2010/07/merge-statement-with-insert-into-output.html' title='Merge Statement with insert into output table'/><author><name>Jayesh Chauhan</name><uri>http://www.blogger.com/profile/07837823503910695576</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-482602810823403830.post-8404267653628051938</id><published>2010-07-08T23:14:00.001-07:00</published><updated>2012-03-23T03:40:49.150-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL 2008"/><title type='text'>Enable AD Hoc Distributed Queries OPENROWSET</title><content type='html'>By default Ad Hoc Distributed Queries are disabled on SQL server&lt;br /&gt;&lt;br /&gt;If you try to run OPENROWSET you will get this error message&lt;br /&gt;&lt;br /&gt;Server: Msg 15281, Level 16, State 1, Line 1&lt;br /&gt;&lt;span style=&#39;color:red&#39;&gt;&lt;br /&gt;SQL Server blocked access to STATEMENT &#39;OpenRowset/OpenDatasource&#39; of component &#39;Ad Hoc Distributed Queries&#39; because this component is turned off as part of the security configuration for this server. A system administrator can enable the use of &#39;Ad Hoc Distributed Queries&#39; by using sp_configure. For more information about enabling &#39;Ad Hoc Distributed Queries&#39;, see &quot;Surface Area Configuration&quot; in SQL Server Books Online.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;To enable it do this&lt;br /&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;EXECUTE&lt;/span&gt; sp_configure &lt;span class=&quot;str&quot;&gt;&#39;show advanced options&#39;&lt;/span&gt;, 1&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;RECONFIGURE&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;WITH&lt;/span&gt; OVERRIDE&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;GO&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;EXECUTE&lt;/span&gt; sp_configure &lt;span class=&quot;str&quot;&gt;&#39;Ad Hoc Distributed Queries&#39;&lt;/span&gt;, &lt;span class=&quot;str&quot;&gt;&#39;1&#39;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;RECONFIGURE&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;WITH&lt;/span&gt; OVERRIDE&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;GO&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;EXECUTE&lt;/span&gt; sp_configure &lt;span class=&quot;str&quot;&gt;&#39;show advanced options&#39;&lt;/span&gt;, 0&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;RECONFIGURE&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;WITH&lt;/span&gt; OVERRIDE&lt;br /&gt;GO&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsdideas.blogspot.com/feeds/8404267653628051938/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/482602810823403830/8404267653628051938' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/482602810823403830/posts/default/8404267653628051938'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/482602810823403830/posts/default/8404267653628051938'/><link rel='alternate' type='text/html' href='http://jsdideas.blogspot.com/2010/07/enable-ad-hoc-distributed-queries.html' title='Enable AD Hoc Distributed Queries OPENROWSET'/><author><name>Jayesh Chauhan</name><uri>http://www.blogger.com/profile/07837823503910695576</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-482602810823403830.post-3088426145295307637</id><published>2010-07-08T22:54:00.000-07:00</published><updated>2010-07-08T23:14:12.127-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Openrowset"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL 2008"/><title type='text'>Openrowset Command in SQL</title><content type='html'>&lt;span style=&quot;font-weight:bold;&quot;&gt;Syntax :&lt;/span&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;OPENROWSET&lt;/span&gt; &lt;br /&gt;( { &lt;span class=&quot;str&quot;&gt;&#39;provider_name&#39;&lt;/span&gt;, { &lt;span class=&quot;str&quot;&gt;&#39;datasource&#39;&lt;/span&gt;;&lt;span class=&quot;str&quot;&gt;&#39;user_id&#39;&lt;/span&gt;;&lt;span class=&quot;str&quot;&gt;&#39;password&#39;&lt;/span&gt; &lt;br /&gt;   | &lt;span class=&quot;str&quot;&gt;&#39;provider_string&#39;&lt;/span&gt; } &lt;br /&gt;   , {   [ &lt;span class=&quot;kwrd&quot;&gt;catalog&lt;/span&gt;. ] [ &lt;span class=&quot;kwrd&quot;&gt;schema&lt;/span&gt;. ] &lt;span class=&quot;kwrd&quot;&gt;object&lt;/span&gt; &lt;br /&gt;       | &lt;span class=&quot;str&quot;&gt;&#39;query&#39;&lt;/span&gt; &lt;br /&gt;     } &lt;br /&gt;   | &lt;span class=&quot;kwrd&quot;&gt;BULK&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;data_file&#39;&lt;/span&gt;, &lt;br /&gt;       { FORMATFILE =&lt;span class=&quot;str&quot;&gt;&#39;format_file_path&#39;&lt;/span&gt; [ &amp;lt;bulk_options&amp;gt; ]&lt;br /&gt;       | SINGLE_BLOB | SINGLE_CLOB | SINGLE_NCLOB }&lt;br /&gt;} )&amp;lt;bulk_options&amp;gt; ::=&lt;br /&gt;   [ , CODEPAGE = { &lt;span class=&quot;str&quot;&gt;&#39;ACP&#39;&lt;/span&gt; | &lt;span class=&quot;str&quot;&gt;&#39;OEM&#39;&lt;/span&gt; | &lt;span class=&quot;str&quot;&gt;&#39;RAW&#39;&lt;/span&gt; | &lt;span class=&quot;str&quot;&gt;&#39;code_page&#39;&lt;/span&gt; } ] &lt;br /&gt;   [ , ERRORFILE =&lt;span class=&quot;str&quot;&gt;&#39;file_name&#39;&lt;/span&gt; ]&lt;br /&gt;   [ , FIRSTROW = first_row ] &lt;br /&gt;   [ , LASTROW = last_row ] &lt;br /&gt;   [ , MAXERRORS = maximum_errors ] &lt;br /&gt;   [ , ROWS_PER_BATCH =rows_per_batch ] &lt;br /&gt;&lt;/pre&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Import CSV File : &lt;/span&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;SELECT&lt;/span&gt; &lt;br /&gt;    &lt;span class=&quot;str&quot;&gt;&#39;EmployeeInfo.csv&#39;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;AS&lt;/span&gt; FileName&lt;br /&gt;    , &lt;span class=&quot;str&quot;&gt;&#39;.csv&#39;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;AS&lt;/span&gt; FileType&lt;br /&gt;    , BulkColumn&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;FROM&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;OPENROWSET&lt;/span&gt;(&lt;span class=&quot;kwrd&quot;&gt;BULK&lt;/span&gt; N&lt;span class=&quot;str&quot;&gt;&#39;C:\EmployeeInfo.csv&#39;&lt;/span&gt;, SINGLE_CLOB) &lt;span class=&quot;kwrd&quot;&gt;AS&lt;/span&gt; Document;&lt;br /&gt;&lt;/pre&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Output :&lt;/span&gt;&lt;pre&gt;FileName         FileType BulkColumn&lt;br /&gt;---------------- -------- ----------------------------------------------&lt;br /&gt;EmployeeInfo.csv .csv     Eugene Malarky,Grove Street Smithtown,New York&lt;/pre&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Example Of SQL Database :&lt;/span&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;SELECT&lt;/span&gt; JSDTest.*&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;FROM&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;OPENROWSET&lt;/span&gt;(&lt;span class=&quot;str&quot;&gt;&#39;SQLOLEDB&#39;&lt;/span&gt;,&lt;span class=&quot;str&quot;&gt;&#39;PC\SQLSERVER2008&#39;&lt;/span&gt;;&lt;span class=&quot;str&quot;&gt;&#39;sa&#39;&lt;/span&gt;;&lt;span class=&quot;str&quot;&gt;&#39;softweb&#39;&lt;/span&gt;,&lt;br /&gt;   &lt;span class=&quot;str&quot;&gt;&#39;SELECT CategoryName, ProductName&lt;br /&gt;   FROM JSDTest.dbo.Product AS Product&lt;br /&gt;        INNER JOIN JSDTest.dbo.Category AS Category ON Category.CategoryID = Product.CategoryID&lt;br /&gt;   ORDER BY CategoryName, ProductName&#39;&lt;/span&gt;) &lt;span class=&quot;kwrd&quot;&gt;AS&lt;/span&gt; JSDTest&lt;/pre&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Example of MDB :&lt;/span&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;SELECT&lt;/span&gt; a.*&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;FROM&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;OPENROWSET&lt;/span&gt;(&lt;span class=&quot;str&quot;&gt;&#39;Microsoft.Jet.OLEDB.4.0&#39;&lt;/span&gt;, &lt;br /&gt;   &lt;span class=&quot;str&quot;&gt;&#39;c:\MSOffice\Access\Samples\northwind.mdb&#39;&lt;/span&gt;;&lt;span class=&quot;str&quot;&gt;&#39;admin&#39;&lt;/span&gt;;&lt;span class=&quot;str&quot;&gt;&#39;mypwd&#39;&lt;/span&gt;, Orders) &lt;br /&gt;   &lt;span class=&quot;kwrd&quot;&gt;AS&lt;/span&gt; a&lt;br /&gt;&lt;/pre&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Example of Excel :&lt;/span&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;SELECT&lt;/span&gt; *&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;INTO&lt;/span&gt; db1.dbo.table1&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;FROM&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;OPENROWSET&lt;/span&gt;(&lt;span class=&quot;str&quot;&gt;&#39;MSDASQL&#39;&lt;/span&gt;,&lt;br /&gt;    &lt;span class=&quot;str&quot;&gt;&#39;Driver={Microsoft Excel Driver (*.xls)};DBQ=c:\book1.xls&#39;&lt;/span&gt;,&lt;br /&gt;    &lt;span class=&quot;str&quot;&gt;&#39;SELECT * FROM [sheet1$]&#39;&lt;/span&gt;)&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsdideas.blogspot.com/feeds/3088426145295307637/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/482602810823403830/3088426145295307637' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/482602810823403830/posts/default/3088426145295307637'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/482602810823403830/posts/default/3088426145295307637'/><link rel='alternate' type='text/html' href='http://jsdideas.blogspot.com/2010/07/openrowset-command-in-sql.html' title='Openrowset Command in SQL'/><author><name>Jayesh Chauhan</name><uri>http://www.blogger.com/profile/07837823503910695576</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-482602810823403830.post-429917798994013270</id><published>2010-07-08T22:38:00.001-07:00</published><updated>2012-03-23T03:44:35.136-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Bulk Insert"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL 2008"/><title type='text'>Import CSV File using SQL Query</title><content type='html'>&lt;span style=&quot;font-weight:bold;&quot;&gt;SQL Query :&lt;/span&gt;&lt;br /&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;DECLARE&lt;/span&gt; @FileName &lt;span class=&quot;kwrd&quot;&gt;VARCHAR&lt;/span&gt;(100) = &lt;span class=&quot;str&quot;&gt;&#39;C:\EmployeeInfo.csv&#39;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;CREATE&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;TABLE&lt;/span&gt; #UserInfo&lt;br /&gt;(&lt;br /&gt;    UserName    &lt;span class=&quot;kwrd&quot;&gt;VARCHAR&lt;/span&gt;(50)&lt;br /&gt;    , Address    &lt;span class=&quot;kwrd&quot;&gt;VARCHAR&lt;/span&gt;(100)&lt;br /&gt;    , CITY        &lt;span class=&quot;kwrd&quot;&gt;VARCHAR&lt;/span&gt;(10)&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;/*** &lt;span class=&quot;kwrd&quot;&gt;Get&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;Data&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;From&lt;/span&gt; Import &lt;span class=&quot;kwrd&quot;&gt;File&lt;/span&gt; ***/&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;DECLARE&lt;/span&gt; @SqlQuery &lt;span class=&quot;kwrd&quot;&gt;VARCHAR&lt;/span&gt;(2000)&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;SELECT&lt;/span&gt; @SqlQuery =     &lt;span class=&quot;str&quot;&gt;&#39;BULK INSERT&#39;&lt;/span&gt;&lt;br /&gt;                    + &lt;span class=&quot;str&quot;&gt;&#39; #UserInfo&#39;&lt;/span&gt; &lt;br /&gt;                    + &lt;span class=&quot;str&quot;&gt;&#39; FROM&#39;&lt;/span&gt;&lt;br /&gt;                    + &lt;span class=&quot;str&quot;&gt;&#39; &#39;&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;&#39;&lt;/span&gt; + @FileName + &lt;span class=&quot;str&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39; &#39;&lt;/span&gt;&lt;br /&gt;                    + &lt;span class=&quot;str&quot;&gt;&#39; WITH (FIELDTERMINATOR=&#39;&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;,&#39;&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;br /&gt;                    + &lt;span class=&quot;str&quot;&gt;&#39;,ROWTERMINATOR = &#39;&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;&#39;&lt;/span&gt; + &lt;span class=&quot;kwrd&quot;&gt;CHAR&lt;/span&gt;(10) + &lt;span class=&quot;str&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;)&#39;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;EXECUTE&lt;/span&gt; ( @SqlQuery )&lt;br /&gt;/*** &lt;span class=&quot;kwrd&quot;&gt;Get&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;Data&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;From&lt;/span&gt; Import &lt;span class=&quot;kwrd&quot;&gt;File&lt;/span&gt; ***/&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;SELECT&lt;/span&gt; * &lt;span class=&quot;kwrd&quot;&gt;FROM&lt;/span&gt; #UserInfo&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;DROP&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;TABLE&lt;/span&gt; #UserInfo&lt;br /&gt;&lt;/pre&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;CSV File :&lt;/span&gt;&lt;pre&gt;Eugene Malarky,Grove Street Smithtown,New York&lt;br /&gt;Sam Adams,Main Street,Ashville&lt;br /&gt;Loren Sandler,Main Street,Hometown&lt;br /&gt;&lt;/pre&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Output :&lt;/span&gt;&lt;pre&gt;UserName                       Address                        CITY&lt;br /&gt;------------------------------ ------------------------------ ----------&lt;br /&gt;Eugene Malarky                 Grove Street Smithtown         New York&lt;br /&gt;&lt;br /&gt;Sam Adams                      Main Street                    Ashville&lt;br /&gt;&lt;br /&gt;Loren Sandler                  Main Street                    Hometown&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsdideas.blogspot.com/feeds/429917798994013270/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/482602810823403830/429917798994013270' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/482602810823403830/posts/default/429917798994013270'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/482602810823403830/posts/default/429917798994013270'/><link rel='alternate' type='text/html' href='http://jsdideas.blogspot.com/2010/07/import-csv-file-using-sql-query.html' title='Import CSV File using SQL Query'/><author><name>Jayesh Chauhan</name><uri>http://www.blogger.com/profile/07837823503910695576</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-482602810823403830.post-1070472334177447823</id><published>2010-07-08T03:25:00.000-07:00</published><updated>2010-07-08T03:35:38.772-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.Net"/><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Excel Configration"/><title type='text'>Excel Permission Configration for ASP.NET Application</title><content type='html'>Refer this link&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;http://blog.crowe.co.nz/archive/2006/03/02/589.aspx&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsdideas.blogspot.com/feeds/1070472334177447823/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/482602810823403830/1070472334177447823' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/482602810823403830/posts/default/1070472334177447823'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/482602810823403830/posts/default/1070472334177447823'/><link rel='alternate' type='text/html' href='http://jsdideas.blogspot.com/2010/07/excel-permission-configration-for.html' title='Excel Permission Configration for ASP.NET Application'/><author><name>Jayesh Chauhan</name><uri>http://www.blogger.com/profile/07837823503910695576</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-482602810823403830.post-4083534197793648221</id><published>2010-07-08T03:13:00.000-07:00</published><updated>2010-07-08T03:37:18.358-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.Net"/><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Excel Programming"/><title type='text'>Create XLS File in ASP.NET application</title><content type='html'>&lt;span style=&quot;font-weight:bold;&quot;&gt;Class CreateXLS :&lt;/span&gt;&lt;br /&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System;&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System.Collections.Generic;&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System.Linq;&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System.Web;&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; Microsoft.Office.Interop;&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; Microsoft.Office.Interop.Excel;&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System.IO;&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System.Drawing;&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System.Reflection;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; CreateXLS&lt;br /&gt;{&lt;br /&gt;    &lt;span class=&quot;preproc&quot;&gt;#region&lt;/span&gt; Excel Variables&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; Microsoft.Office.Interop.Excel.Application oXL;&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; Microsoft.Office.Interop.Excel._Workbook oWB;&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; Microsoft.Office.Interop.Excel._Worksheet oSheet;&lt;br /&gt;&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;long&lt;/span&gt; iExcelRow = 2;&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;long&lt;/span&gt; iExcelCol = 2;&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;long&lt;/span&gt; iStartRow = 0;&lt;br /&gt;&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; sFromCellNo = &lt;span class=&quot;str&quot;&gt;&quot;&quot;&lt;/span&gt;;&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; sToCellNo = &lt;span class=&quot;str&quot;&gt;&quot;&quot;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;enum&lt;/span&gt; enumXLSFields&lt;br /&gt;    {&lt;br /&gt;        EmployeeName,&lt;br /&gt;        Address,&lt;br /&gt;        AccountNo,&lt;br /&gt;        Earnings,&lt;br /&gt;        Deduction,&lt;br /&gt;        NetSalary&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;float&lt;/span&gt; LogoLeft = 50;&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;float&lt;/span&gt; LogoTop = 15;&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;float&lt;/span&gt; LogoWidth = 52;&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;float&lt;/span&gt; LogoHeight = 52;&lt;br /&gt;    &lt;span class=&quot;preproc&quot;&gt;#endregion&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    &lt;span class=&quot;preproc&quot;&gt;#region&lt;/span&gt; Properties&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; XLSPath { get; set; }&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; XLSFileName { get; set; }&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; XLSSheetName { get; set; }&lt;br /&gt;&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; List&amp;lt;EmployeeInfo&amp;gt; EmployeeList { get; set; }&lt;br /&gt;&lt;br /&gt;    &lt;span class=&quot;rem&quot;&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;rem&quot;&gt;/// Logo Properties&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;rem&quot;&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; LogoFile { get; set; }&lt;br /&gt;    &lt;span class=&quot;preproc&quot;&gt;#endregion&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    &lt;span class=&quot;rem&quot;&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;rem&quot;&gt;/// Cunstructor&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;rem&quot;&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; CreateXLS()&lt;br /&gt;    {&lt;br /&gt;        oXL = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; Microsoft.Office.Interop.Excel.Application();&lt;br /&gt;        oXL.Visible = &lt;span class=&quot;kwrd&quot;&gt;false&lt;/span&gt;;&lt;br /&gt;        oXL.UserControl = &lt;span class=&quot;kwrd&quot;&gt;false&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;        &lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.EmployeeList = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; List&amp;lt;EmployeeInfo&amp;gt;();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;span class=&quot;preproc&quot;&gt;#region&lt;/span&gt; Public Methods&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; GenerateXLSFile()&lt;br /&gt;    {&lt;br /&gt;        &lt;span class=&quot;kwrd&quot;&gt;try&lt;/span&gt;&lt;br /&gt;        {&lt;br /&gt;            &lt;span class=&quot;preproc&quot;&gt;#region&lt;/span&gt; GenrateXLSFile&lt;br /&gt;            GC.Collect();&lt;br /&gt;            oWB = (Microsoft.Office.Interop.Excel._Workbook)(oXL.Workbooks.Add(Missing.Value));&lt;br /&gt;            &lt;span class=&quot;rem&quot;&gt;//oWB = (Microsoft.Office.Interop.Excel._Workbook)(oXL.Workbooks.Add(Microsoft.Office.Interop.Excel.XlWBATemplate.xlWBATWorksheet));&lt;/span&gt;&lt;br /&gt;            oSheet = (Microsoft.Office.Interop.Excel._Worksheet)oWB.ActiveSheet;&lt;br /&gt;            oSheet.Name = &lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.XLSSheetName;&lt;br /&gt;&lt;br /&gt;            &lt;span class=&quot;rem&quot;&gt;/*----------------Main Coding----------------*/&lt;/span&gt;&lt;br /&gt;            InsertLogoFileToSheet();&lt;br /&gt;&lt;br /&gt;            SetXLSTitle((&lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt;)enumXLSFields.EmployeeName, (&lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt;)enumXLSFields.NetSalary, &lt;span class=&quot;str&quot;&gt;&quot;Employee Report&quot;&lt;/span&gt;, 10, &lt;span class=&quot;kwrd&quot;&gt;true&lt;/span&gt;);&lt;br /&gt;&lt;br /&gt;            DisplayEmployeeInfo();&lt;br /&gt;&lt;br /&gt;            SheetAutoFit();&lt;br /&gt;            &lt;span class=&quot;rem&quot;&gt;/*-------------------------------------------*/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;            &lt;span class=&quot;preproc&quot;&gt;#region&lt;/span&gt; XLS File Save into Server Path&lt;br /&gt;&lt;br /&gt;            &lt;span class=&quot;preproc&quot;&gt;#region&lt;/span&gt; Check XLS File &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; Exists&lt;br /&gt;            &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; sFileName = &lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.XLSPath + &lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.XLSFileName + &lt;span class=&quot;str&quot;&gt;&quot;.XLS&quot;&lt;/span&gt;;&lt;br /&gt;            &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (File.Exists(sFileName))&lt;br /&gt;            {&lt;br /&gt;                File.Delete(sFileName);&lt;br /&gt;            }&lt;br /&gt;            &lt;span class=&quot;preproc&quot;&gt;#endregion&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;            &lt;span class=&quot;rem&quot;&gt;//Create BillingXLS Directory&lt;/span&gt;&lt;br /&gt;            &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (!System.IO.Directory.Exists(XLSPath))&lt;br /&gt;            {&lt;br /&gt;                System.IO.Directory.CreateDirectory(XLSPath);&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; strXLSFile = &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;.Format(&lt;span class=&quot;str&quot;&gt;&quot;{0}\\{1}.xls&quot;&lt;/span&gt;, &lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.XLSPath, &lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.XLSFileName);&lt;br /&gt;            &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (File.Exists(strXLSFile))&lt;br /&gt;            {&lt;br /&gt;                File.Delete(strXLSFile);&lt;br /&gt;            }&lt;br /&gt;            oWB.SaveAs(&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;.Format(&lt;span class=&quot;str&quot;&gt;&quot;{0}\\{1}&quot;&lt;/span&gt;, &lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.XLSPath, &lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.XLSFileName), XlFileFormat.xlWorkbookNormal, &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;, &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;, &lt;span class=&quot;kwrd&quot;&gt;false&lt;/span&gt;, &lt;span class=&quot;kwrd&quot;&gt;false&lt;/span&gt;, XlSaveAsAccessMode.xlExclusive, &lt;span class=&quot;kwrd&quot;&gt;false&lt;/span&gt;, &lt;span class=&quot;kwrd&quot;&gt;false&lt;/span&gt;, &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;, &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;, &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;);&lt;br /&gt;            oWB.Close(&lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;, &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;, &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;);&lt;br /&gt;            &lt;span class=&quot;preproc&quot;&gt;#endregion&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;            &lt;span class=&quot;preproc&quot;&gt;#endregion&lt;/span&gt;&lt;br /&gt;        }&lt;br /&gt;        &lt;span class=&quot;kwrd&quot;&gt;catch&lt;/span&gt;&lt;br /&gt;        {&lt;br /&gt;            System.GC.Collect();&lt;br /&gt;        }&lt;br /&gt;        &lt;span class=&quot;kwrd&quot;&gt;finally&lt;/span&gt;&lt;br /&gt;        {&lt;br /&gt;            System.Runtime.InteropServices.Marshal.ReleaseComObject(oSheet);&lt;br /&gt;            System.Runtime.InteropServices.Marshal.ReleaseComObject(oWB);&lt;br /&gt;&lt;br /&gt;            oSheet = &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;;&lt;br /&gt;            oWB = &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; DisplayEmployeeInfo()&lt;br /&gt;    {&lt;br /&gt;        &lt;span class=&quot;preproc&quot;&gt;#region&lt;/span&gt; Header&lt;br /&gt;        iExcelRow++;&lt;br /&gt;&lt;br /&gt;        oSheet.Cells[iExcelRow, iExcelCol + (&lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt;)enumXLSFields.EmployeeName] = &lt;span class=&quot;str&quot;&gt;&quot;Employee Name&quot;&lt;/span&gt;;&lt;br /&gt;        oSheet.Cells[iExcelRow, iExcelCol + (&lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt;)enumXLSFields.Address] = &lt;span class=&quot;str&quot;&gt;&quot;Address&quot;&lt;/span&gt;;&lt;br /&gt;        oSheet.Cells[iExcelRow, iExcelCol + (&lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt;)enumXLSFields.AccountNo] = &lt;span class=&quot;str&quot;&gt;&quot;Account No&quot;&lt;/span&gt;;&lt;br /&gt;        oSheet.Cells[iExcelRow, iExcelCol + (&lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt;)enumXLSFields.Earnings] = &lt;span class=&quot;str&quot;&gt;&quot;Earnings&quot;&lt;/span&gt;;&lt;br /&gt;        oSheet.Cells[iExcelRow, iExcelCol + (&lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt;)enumXLSFields.Deduction] = &lt;span class=&quot;str&quot;&gt;&quot;Deduction&quot;&lt;/span&gt;;&lt;br /&gt;        oSheet.Cells[iExcelRow, iExcelCol + (&lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt;)enumXLSFields.NetSalary] = &lt;span class=&quot;str&quot;&gt;&quot;Net Salary&quot;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;        SetRangeBackColor(iExcelRow, iExcelRow, (&lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt;)enumXLSFields.EmployeeName, (&lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt;)enumXLSFields.NetSalary);&lt;br /&gt;        iExcelRow++;&lt;br /&gt;        &lt;span class=&quot;preproc&quot;&gt;#endregion&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;        &lt;span class=&quot;preproc&quot;&gt;#region&lt;/span&gt; Detail&lt;br /&gt;        iStartRow = iExcelRow;&lt;br /&gt;        &lt;span class=&quot;kwrd&quot;&gt;foreach&lt;/span&gt; (EmployeeInfo Employee &lt;span class=&quot;kwrd&quot;&gt;in&lt;/span&gt; EmployeeList)&lt;br /&gt;        {&lt;br /&gt;            oSheet.Cells[iExcelRow, iExcelCol + (&lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt;)enumXLSFields.EmployeeName] = Employee.EmployeeName;&lt;br /&gt;            oSheet.Cells[iExcelRow, iExcelCol + (&lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt;)enumXLSFields.Address] = Employee.Address;&lt;br /&gt;            oSheet.Cells[iExcelRow, iExcelCol + (&lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt;)enumXLSFields.AccountNo] = Employee.AccountNo;&lt;br /&gt;            oSheet.Cells[iExcelRow, iExcelCol + (&lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt;)enumXLSFields.Earnings] = Employee.Earnings;&lt;br /&gt;            oSheet.Cells[iExcelRow, iExcelCol + (&lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt;)enumXLSFields.Deduction] = Employee.Deduction;&lt;br /&gt;            oSheet.Cells[iExcelRow, iExcelCol + (&lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt;)enumXLSFields.NetSalary] = Employee.NetSalary;&lt;br /&gt;            iExcelRow++;&lt;br /&gt;        }&lt;br /&gt;        &lt;span class=&quot;preproc&quot;&gt;#endregion&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;        &lt;span class=&quot;preproc&quot;&gt;#region&lt;/span&gt; Total&lt;br /&gt;&lt;br /&gt;        &lt;span class=&quot;preproc&quot;&gt;#region&lt;/span&gt; Print Total&lt;br /&gt;        oSheet.Cells[iExcelRow, iExcelCol + (&lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt;)enumXLSFields.EmployeeName] = &lt;span class=&quot;str&quot;&gt;&quot;Total&quot;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;        SetRangeTotal(iExcelRow, (&lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt;)enumXLSFields.Earnings, iStartRow, iExcelRow - 1, (&lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt;)enumXLSFields.Earnings);&lt;br /&gt;        SetRangeTotal(iExcelRow, (&lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt;)enumXLSFields.Deduction, iStartRow, iExcelRow - 1, (&lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt;)enumXLSFields.Deduction);&lt;br /&gt;        SetRangeTotal(iExcelRow, (&lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt;)enumXLSFields.NetSalary, iStartRow, iExcelRow - 1, (&lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt;)enumXLSFields.NetSalary);&lt;br /&gt;        &lt;span class=&quot;preproc&quot;&gt;#endregion&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;        &lt;span class=&quot;preproc&quot;&gt;#region&lt;/span&gt; Range Format&lt;br /&gt;        SetRangeNumberFormat(iStartRow, iExcelRow, (&lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt;)enumXLSFields.Earnings, (&lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt;)enumXLSFields.NetSalary);&lt;br /&gt;        SetRangeBackColor(iExcelRow, iExcelRow, (&lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt;)enumXLSFields.EmployeeName, (&lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt;)enumXLSFields.NetSalary);&lt;br /&gt;        SetRangeBorder(iStartRow, iExcelRow, (&lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt;)enumXLSFields.EmployeeName, (&lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt;)enumXLSFields.NetSalary);&lt;br /&gt;        &lt;span class=&quot;preproc&quot;&gt;#endregion&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;        &lt;span class=&quot;preproc&quot;&gt;#endregion&lt;/span&gt;&lt;br /&gt;    }&lt;br /&gt;    &lt;span class=&quot;preproc&quot;&gt;#endregion&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    &lt;span class=&quot;preproc&quot;&gt;#region&lt;/span&gt; Private Methods&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; InsertLogoFileToSheet()&lt;br /&gt;    {&lt;br /&gt;        &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (File.Exists(&lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.LogoFile))&lt;br /&gt;        {&lt;br /&gt;            oSheet.Shapes.AddPicture(&lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.LogoFile, Microsoft.Office.Core.MsoTriState.msoTrue, Microsoft.Office.Core.MsoTriState.msoTrue, LogoLeft, LogoTop, LogoWidth, LogoHeight);&lt;br /&gt;        }&lt;br /&gt;        SetXLSTitle((&lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt;)enumXLSFields.Address, (&lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt;)enumXLSFields.NetSalary, &lt;span class=&quot;str&quot;&gt;&quot;ABC Inc.&quot;&lt;/span&gt;, 12, &lt;span class=&quot;kwrd&quot;&gt;true&lt;/span&gt;);&lt;br /&gt;&lt;br /&gt;        iExcelRow = 6;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; SheetAutoFit()&lt;br /&gt;    {&lt;br /&gt;        Range oRng = oSheet.get_Range(&lt;span class=&quot;str&quot;&gt;&quot;A1&quot;&lt;/span&gt;, &lt;span class=&quot;str&quot;&gt;&quot;Z1&quot;&lt;/span&gt;);&lt;br /&gt;        oRng.EntireColumn.AutoFit();&lt;br /&gt;        System.Runtime.InteropServices.Marshal.ReleaseComObject(oRng);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; SetXLSTitle(&lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt; StartColumn, &lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt; EndColumn, &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; ColumnHeading, &lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt; FontSize, &lt;span class=&quot;kwrd&quot;&gt;bool&lt;/span&gt; MergeColumn)&lt;br /&gt;    {&lt;br /&gt;        sFromCellNo = ((&lt;span class=&quot;kwrd&quot;&gt;char&lt;/span&gt;)(iExcelCol + StartColumn + 64)) + iExcelRow.ToString();&lt;br /&gt;        sToCellNo = ((&lt;span class=&quot;kwrd&quot;&gt;char&lt;/span&gt;)(iExcelCol + EndColumn + 64)) + iExcelRow.ToString();&lt;br /&gt;&lt;br /&gt;        oSheet.Cells[iExcelRow, iExcelCol + StartColumn] = ColumnHeading;&lt;br /&gt;&lt;br /&gt;        Range oRng = oSheet.get_Range(sFromCellNo, sToCellNo);&lt;br /&gt;        oRng.Font.Name = &lt;span class=&quot;str&quot;&gt;&quot;Arial&quot;&lt;/span&gt;;&lt;br /&gt;        oRng.Font.Size = FontSize;&lt;br /&gt;        oRng.Font.Bold = &lt;span class=&quot;kwrd&quot;&gt;true&lt;/span&gt;;&lt;br /&gt;        &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (MergeColumn)&lt;br /&gt;        {&lt;br /&gt;            oRng.Merge(1);&lt;br /&gt;            oRng.HorizontalAlignment = Microsoft.Office.Interop.Excel.XlHAlign.xlHAlignCenter;&lt;br /&gt;            oRng.Font.Color = Color.White.ToArgb();&lt;br /&gt;            oRng.Interior.Color = Color.FromArgb(128, 128, 128).ToArgb();&lt;br /&gt;            oRng.Interior.Pattern = Microsoft.Office.Interop.Excel.XlPattern.xlPatternSolid;&lt;br /&gt;            oRng.Borders.Value = 1;&lt;br /&gt;            oRng.Borders.Color = Color.Black.ToArgb();&lt;br /&gt;        }&lt;br /&gt;        System.Runtime.InteropServices.Marshal.ReleaseComObject(oRng);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; SetRangeTotal(&lt;span class=&quot;kwrd&quot;&gt;long&lt;/span&gt; DisplayRow, &lt;span class=&quot;kwrd&quot;&gt;long&lt;/span&gt; DisplayColumn, &lt;span class=&quot;kwrd&quot;&gt;long&lt;/span&gt; StartRow, &lt;span class=&quot;kwrd&quot;&gt;long&lt;/span&gt; EndRow, &lt;span class=&quot;kwrd&quot;&gt;long&lt;/span&gt; RangeColumn)&lt;br /&gt;    {&lt;br /&gt;        sFromCellNo = ((&lt;span class=&quot;kwrd&quot;&gt;char&lt;/span&gt;)(iExcelCol + RangeColumn + 64)) + StartRow.ToString();&lt;br /&gt;        sToCellNo = ((&lt;span class=&quot;kwrd&quot;&gt;char&lt;/span&gt;)(iExcelCol + RangeColumn + 64)) + EndRow.ToString();&lt;br /&gt;&lt;br /&gt;        oSheet.Cells[DisplayRow, iExcelCol + DisplayColumn] = &lt;span class=&quot;str&quot;&gt;&quot;=SUM(&quot;&lt;/span&gt; + sFromCellNo + &lt;span class=&quot;str&quot;&gt;&quot;:&quot;&lt;/span&gt; + sToCellNo + &lt;span class=&quot;str&quot;&gt;&quot;)&quot;&lt;/span&gt;;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; SetRangeNumberFormat(&lt;span class=&quot;kwrd&quot;&gt;long&lt;/span&gt; StartRow, &lt;span class=&quot;kwrd&quot;&gt;long&lt;/span&gt; EndRow, &lt;span class=&quot;kwrd&quot;&gt;long&lt;/span&gt; StartColumn, &lt;span class=&quot;kwrd&quot;&gt;long&lt;/span&gt; EndColumn)&lt;br /&gt;    {&lt;br /&gt;        sFromCellNo = ((&lt;span class=&quot;kwrd&quot;&gt;char&lt;/span&gt;)(iExcelCol + StartColumn + 64)) + StartRow.ToString();&lt;br /&gt;        sToCellNo = ((&lt;span class=&quot;kwrd&quot;&gt;char&lt;/span&gt;)(iExcelCol + EndColumn + 64)) + EndRow.ToString();&lt;br /&gt;&lt;br /&gt;        Range oRng = oSheet.get_Range(sFromCellNo, sToCellNo);&lt;br /&gt;        oRng.NumberFormat = &lt;span class=&quot;str&quot;&gt;&quot;###,###,##0.00&quot;&lt;/span&gt;;&lt;br /&gt;        System.Runtime.InteropServices.Marshal.ReleaseComObject(oRng);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; SetRangeBorder(&lt;span class=&quot;kwrd&quot;&gt;long&lt;/span&gt; StartRow, &lt;span class=&quot;kwrd&quot;&gt;long&lt;/span&gt; EndRow, &lt;span class=&quot;kwrd&quot;&gt;long&lt;/span&gt; StartColumn, &lt;span class=&quot;kwrd&quot;&gt;long&lt;/span&gt; EndColumn)&lt;br /&gt;    {&lt;br /&gt;        sFromCellNo = ((&lt;span class=&quot;kwrd&quot;&gt;char&lt;/span&gt;)(iExcelCol + StartColumn + 64)) + StartRow.ToString();&lt;br /&gt;        sToCellNo = ((&lt;span class=&quot;kwrd&quot;&gt;char&lt;/span&gt;)(iExcelCol + EndColumn + 64)) + EndRow.ToString();&lt;br /&gt;&lt;br /&gt;        Range oRng = oSheet.get_Range(sFromCellNo, sToCellNo);&lt;br /&gt;        oRng.Borders.Value = 1;&lt;br /&gt;        oRng.Borders.Color = Color.Black.ToArgb();&lt;br /&gt;        System.Runtime.InteropServices.Marshal.ReleaseComObject(oRng);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; SetRangeBackColor(&lt;span class=&quot;kwrd&quot;&gt;long&lt;/span&gt; StartRow, &lt;span class=&quot;kwrd&quot;&gt;long&lt;/span&gt; EndRow, &lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt; StartColumn, &lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt; EndColumn)&lt;br /&gt;    {&lt;br /&gt;        sFromCellNo = ((&lt;span class=&quot;kwrd&quot;&gt;char&lt;/span&gt;)(iExcelCol + StartColumn + 64)) + StartRow.ToString();&lt;br /&gt;        sToCellNo = ((&lt;span class=&quot;kwrd&quot;&gt;char&lt;/span&gt;)(iExcelCol + EndColumn + 64)) + EndRow.ToString();&lt;br /&gt;&lt;br /&gt;        Range oRng = oSheet.get_Range(sFromCellNo, sToCellNo);&lt;br /&gt;        oRng.Font.Name = &lt;span class=&quot;str&quot;&gt;&quot;Arial&quot;&lt;/span&gt;;&lt;br /&gt;        oRng.Font.Bold = &lt;span class=&quot;kwrd&quot;&gt;true&lt;/span&gt;;&lt;br /&gt;        oRng.Font.Color = Color.Black.ToArgb();&lt;br /&gt;        oRng.Interior.Color = System.Drawing.Color.FromArgb(192, 192, 192).ToArgb();&lt;br /&gt;        System.Runtime.InteropServices.Marshal.ReleaseComObject(oRng);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; SetRangeBold(&lt;span class=&quot;kwrd&quot;&gt;long&lt;/span&gt; StartRow, &lt;span class=&quot;kwrd&quot;&gt;long&lt;/span&gt; EndRow, &lt;span class=&quot;kwrd&quot;&gt;long&lt;/span&gt; StartColumn, &lt;span class=&quot;kwrd&quot;&gt;long&lt;/span&gt; EndColumn)&lt;br /&gt;    {&lt;br /&gt;        sFromCellNo = ((&lt;span class=&quot;kwrd&quot;&gt;char&lt;/span&gt;)(iExcelCol + StartColumn + 64)) + StartRow.ToString();&lt;br /&gt;        sToCellNo = ((&lt;span class=&quot;kwrd&quot;&gt;char&lt;/span&gt;)(iExcelCol + EndColumn + 64)) + EndRow.ToString();&lt;br /&gt;&lt;br /&gt;        Range oRng = oSheet.get_Range(sFromCellNo, sToCellNo);&lt;br /&gt;        oRng.Font.Name = &lt;span class=&quot;str&quot;&gt;&quot;Arial&quot;&lt;/span&gt;;&lt;br /&gt;        oRng.Font.Bold = &lt;span class=&quot;kwrd&quot;&gt;true&lt;/span&gt;;&lt;br /&gt;        oRng.Font.Color = Color.Black.ToArgb();&lt;br /&gt;        oRng.Interior.Color = System.Drawing.Color.FromArgb(192, 192, 192).ToArgb();&lt;br /&gt;        System.Runtime.InteropServices.Marshal.ReleaseComObject(oRng);&lt;br /&gt;    }&lt;br /&gt;    &lt;span class=&quot;preproc&quot;&gt;#endregion&lt;/span&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; EmployeeInfo&lt;br /&gt;{&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; EmployeeName { get; set; }&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; Address { get; set; }&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; AccountNo { get; set; }&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;float&lt;/span&gt; Earnings { get; set; }&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;float&lt;/span&gt; Deduction { get; set; }&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;float&lt;/span&gt; NetSalary { get; set; }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;ProcessXLS.ASPX :&lt;/span&gt;&lt;br /&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;partial&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; ProcessXLS : System.Web.UI.Page&lt;br /&gt;{&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; Page_Load(&lt;span class=&quot;kwrd&quot;&gt;object&lt;/span&gt; sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;        GenrateXLS();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; GenrateXLS()&lt;br /&gt;    {&lt;br /&gt;        CreateXLS objXLS = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; CreateXLS();&lt;br /&gt;&lt;br /&gt;        objXLS.EmployeeList.Add(&lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; EmployeeInfo() { EmployeeName = &lt;span class=&quot;str&quot;&gt;&quot;Eugene Malarky&quot;&lt;/span&gt;, Address = &lt;span class=&quot;str&quot;&gt;&quot;Grove Street, Smithtown&quot;&lt;/span&gt;, AccountNo = &lt;span class=&quot;str&quot;&gt;&quot;A001&quot;&lt;/span&gt;, Earnings = 1500, Deduction = 450, NetSalary = 1050 });&lt;br /&gt;        objXLS.EmployeeList.Add(&lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; EmployeeInfo() { EmployeeName = &lt;span class=&quot;str&quot;&gt;&quot;Sam Adams&quot;&lt;/span&gt;, Address = &lt;span class=&quot;str&quot;&gt;&quot;Main Street, Suite 1000, Ashville&quot;&lt;/span&gt;, AccountNo = &lt;span class=&quot;str&quot;&gt;&quot;A002&quot;&lt;/span&gt;, Earnings = 1250, Deduction = 320, NetSalary = 930 });&lt;br /&gt;        objXLS.EmployeeList.Add(&lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; EmployeeInfo() { EmployeeName = &lt;span class=&quot;str&quot;&gt;&quot;Loren Sandler&quot;&lt;/span&gt;, Address = &lt;span class=&quot;str&quot;&gt;&quot;Main Street, Hometown&quot;&lt;/span&gt;, AccountNo = &lt;span class=&quot;str&quot;&gt;&quot;A003&quot;&lt;/span&gt;, Earnings = 1800, Deduction = 550, NetSalary = 1250 });&lt;br /&gt;&lt;br /&gt;        objXLS.XLSPath = Server.MapPath(&lt;span class=&quot;str&quot;&gt;&quot;XLSFiles&quot;&lt;/span&gt;);&lt;br /&gt;        objXLS.XLSFileName = &lt;span class=&quot;str&quot;&gt;&quot;EmployeeSalary&quot;&lt;/span&gt;;&lt;br /&gt;        objXLS.XLSSheetName = &lt;span class=&quot;str&quot;&gt;&quot;EmployeeList&quot;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;        objXLS.LogoFile = Server.MapPath(&lt;span class=&quot;str&quot;&gt;&quot;XLSFiles/JDLogo.jpeg&quot;&lt;/span&gt;);&lt;br /&gt;&lt;br /&gt;        objXLS.GenerateXLSFile();&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;Sample XLS File&lt;/strong&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKrcswyU6TGpbKhZKLqZpDl4R5n5MHirXQfN5X2qK9W_hDeCucTtL30CyQfokY1kn2orRDLGl-og8dalJV0DGzu5G4JPCUEftzQ75WE2tOvxEC6lBsqAOlOrUt1nczYR8C-xoyrYQzPQYF/s1600/SampleXLS.PNG&quot;&gt;&lt;img style=&quot;cursor:pointer; cursor:hand;width: 320px; height: 182px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKrcswyU6TGpbKhZKLqZpDl4R5n5MHirXQfN5X2qK9W_hDeCucTtL30CyQfokY1kn2orRDLGl-og8dalJV0DGzu5G4JPCUEftzQ75WE2tOvxEC6lBsqAOlOrUt1nczYR8C-xoyrYQzPQYF/s320/SampleXLS.PNG&quot; border=&quot;0&quot; alt=&quot;&quot;id=&quot;BLOGGER_PHOTO_ID_5491479130682811074&quot; /&gt;&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsdideas.blogspot.com/feeds/4083534197793648221/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/482602810823403830/4083534197793648221' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/482602810823403830/posts/default/4083534197793648221'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/482602810823403830/posts/default/4083534197793648221'/><link rel='alternate' type='text/html' href='http://jsdideas.blogspot.com/2010/07/create-xls-file-in-aspnet-application.html' title='Create XLS File in ASP.NET application'/><author><name>Jayesh Chauhan</name><uri>http://www.blogger.com/profile/07837823503910695576</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKrcswyU6TGpbKhZKLqZpDl4R5n5MHirXQfN5X2qK9W_hDeCucTtL30CyQfokY1kn2orRDLGl-og8dalJV0DGzu5G4JPCUEftzQ75WE2tOvxEC6lBsqAOlOrUt1nczYR8C-xoyrYQzPQYF/s72-c/SampleXLS.PNG" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-482602810823403830.post-8500997808728338185</id><published>2010-07-07T21:55:00.002-07:00</published><updated>2012-03-23T03:44:05.225-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Database"/><category scheme="http://www.blogger.com/atom/ns#" term="Merge Query"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL 2008"/><title type='text'>MERGE Statement and compatibility level</title><content type='html'>In SQL 2008 Merge Statement when execute and give the error like this&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color:red&quot;&gt;Incorrect syntax near &#39;MERGE&#39;. You may need to set the compatibility level of the current database to a higher value to enable this feature. See help for the SET COMPATIBILITY_LEVEL option of ALTER DATABASE.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold; color:blue&quot;&gt;Solution&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;SQL Command&lt;/span&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;ALTER&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;DATABASE&lt;/span&gt; &amp;lt;DBName&amp;gt;&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;SET&lt;/span&gt; COMPATIBILITY_LEVEL = 100 &lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsdideas.blogspot.com/feeds/8500997808728338185/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/482602810823403830/8500997808728338185' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/482602810823403830/posts/default/8500997808728338185'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/482602810823403830/posts/default/8500997808728338185'/><link rel='alternate' type='text/html' href='http://jsdideas.blogspot.com/2010/07/merge-statement-and-compatibility-level.html' title='MERGE Statement and compatibility level'/><author><name>Jayesh Chauhan</name><uri>http://www.blogger.com/profile/07837823503910695576</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-482602810823403830.post-7937023765725245080</id><published>2010-07-05T02:30:00.000-07:00</published><updated>2010-07-08T03:37:28.977-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.Net"/><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Delegate"/><title type='text'>Delegate using in ASPX Page and user control</title><content type='html'>&lt;span style=&quot;font-weight: bold;&quot;&gt;In ASPX Page :&lt;/span&gt;&lt;br /&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;partial&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; Activity_ContactActivity : Page&lt;br /&gt;{&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; Page_Load(&lt;span class=&quot;kwrd&quot;&gt;object&lt;/span&gt; sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;        MonthActivity1.LoadWeekTabInformation += &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; UserControls_Activity_MonthActivity.LoadTabInformation(MonthActivity1_LoadWeekTabInformation);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; MonthActivity1_LoadWeekTabInformation()&lt;br /&gt;    {&lt;br /&gt;        &lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.ActivityDate = MonthActivity1.ActivityDate;&lt;br /&gt;        &lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.CurrentActivityTab = enumContactActivityTab.Week;&lt;br /&gt;        LoadActivityInformation();&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;In User Control Page :    &lt;/span&gt;&lt;br /&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;partial&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; UserControls_Activity_MonthActivity : UserControl&lt;br /&gt;{&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;delegate&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; LoadTabInformation();&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;event&lt;/span&gt; LoadTabInformation LoadWeekTabInformation;&lt;br /&gt;&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; DisplayWeekTabInformation()&lt;br /&gt;    {&lt;br /&gt;        LoadWeekTabInformation();&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsdideas.blogspot.com/feeds/7937023765725245080/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/482602810823403830/7937023765725245080' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/482602810823403830/posts/default/7937023765725245080'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/482602810823403830/posts/default/7937023765725245080'/><link rel='alternate' type='text/html' href='http://jsdideas.blogspot.com/2010/07/delegate-using-in-aspx-page-and-user.html' title='Delegate using in ASPX Page and user control'/><author><name>Jayesh Chauhan</name><uri>http://www.blogger.com/profile/07837823503910695576</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>