Binary Bits

Bits & Pieces By Kannan

How to run SQL Profiler without SysAdmin rights?

February 24
by Kannan 24. February 2010 13:05

In SQL Server 2000, to run SQL Profiler the sysadmin needs to grant permissions to the user running the trace. In SQL Server 2005 and 2008, the option exists of granting permissions to Profiler so that users do not need to be a member of the sysadmin group by using the code below:
 

USE master
GO
GRANT ALTER TRACE TO <username>;
GO


If the permission needs to be revoked, use the code below:

USE master
GO
DENY ALTER TRACE TO <username>;
GO

Source: http://www.sql-server-performance.com/faq/How_to_run_SQL_Profiler_without_sysadmin_rights_p1.aspx

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: ,

Programming

Business Application Using Silverlight 3

December 15
by Kannan 15. December 2009 18:42

I am in phase of learning Silverlight 3 & .NET RIA services.

Came across the link containing a great example. http://blogs.msdn.com/brada/archive/2009/03/17/mix09-building-amazing-business-applications-with-silverlight-3.aspx

So thought of bookmarking it in my blog.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: ,

Programming | Web Site Links

Visual Studio 2008 SP1 Stepping and Breakpoint Issues

November 09
by Kannan 9. November 2009 17:20

Recently I was trying to debugging Silverlight code in a server running Windows Server 2008 with Visual Studio 2008 Team Edition, but the debug stepping was not working and no break point will be hit.

I was searching all the net and finally found a link where it was informed that Visual Studio 2008 SP1 has issues in stepping into breakpoint when the code is debugged in Server Class Multi Core Processor or Multi Processor environment.

Solution:

  1. Open Visual Studio but do not open any projects.
  2. Start the Task Manager (Ctrl+Shift+Esc) and navigate to the “Processes” tab.
    Right-click on devenv.exe and select “Set Affinity…” (this option is only available on multi-processor or multi-core machines).
    Uncheck every CPU except one and click OK.

Open your project and debug as normal.

Workaround notes and limitations:

  1. If you restart Visual Studio, you will have to repeat these steps.
  2. If you are attaching to a process to debug, you should perform the above steps on your target process before attaching Visual Studio.  (If you are debugging foo.exe, change the affinity on foo.exe.)

More Information: http://social.msdn.microsoft.com/Forums/en-US/vsdebug/thread/f3fcb4fb-8a08-4fa0-8d58-9ed6f3eb1193

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , ,

Programming

ASP.NET E-Mail Validation With Regular Expression Validator Using The Right Validation Expression

October 02
by Kannan 2. October 2008 12:15

ASP.NET comes with validation controls with which we can validate input values.

One of the most common situation is validating e-mail address. Some of the web sites online provide a Validation Expression which sometimes misses out the top level domain part.

The following is the Validation Expression which I found to be working perfectly.

<asp:TextBox ID="txtUserEmail" runat="server" />
<asp:RequiredFieldValidator ID="rfvUserEmail" runat="server" ControlToValidate="txtUserEmail" ErrorMessage="*"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="rfvUserEmailValidate" runat="server" ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" ControlToValidate="txtUserEmail" ErrorMessage="Invalid Email Format"></asp:RegularExpressionValidator>
Note: I have added RequiredFieldValidator as RegularExpressionValidator check only for the format

Finding ASP.NET Grid View&rsquo;s Column Index Based On It&rsquo;s Column Accessible Header Text.

September 26
by Kannan 26. September 2008 10:47

When we develop application there is a good chance that the column location might change depending upon the requirements.

In certain situations like accessing a particular cell in a grid view we have to use index value. At this particular situation the following helper method could come useful to identify a particular column’s index value

private int FindGridColumnIndex(GridView gridView, string accessibleHeaderText)
{
    for (int index = 0; index < gridView.Columns.Count; index++)
    {
        if (String.Compare(gridView.Columns[index].AccessibleHeaderText, accessibleHeaderText, true) == 0)
            return index;
    }
    return -1;
}

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , , ,

Programming