adsense

Friday, December 23, 2011

Intersect, Except, Union, All and Any

This article examines some of the little used T-SQL items function and see if they work for you

reade more

http://www.sqlservercentral.com/articles/T-SQL/67545/

cheers
Samitha



Thursday, December 22, 2011

INSERT, UPDATE and DELETE against a Database Snapshot


This article demonstrates that it is possible to run an INSERT, UPDATE or DELETE against a Database Snapshot. 

http://sqlcat.com/sqlcat/b/msdnmirror/archive/2011/10/17/successfully-execute-an-insert-update-and-delete-against-a-database-snapshot.aspx

cheers
Samitha

URL Redirect Checker

When the amount of links on your site begin to grow, you'll be faced with all sorts of dead links, structure changes and more. It's important that you provide as many re-directs as you can when this happens, and that they work. Use this URL Redirect Checker to check any re-direct link.

cheers,
Samitha

Tuesday, December 20, 2011

Visual Studio 2011 Developer Preview

Check out the new features and functionalities in the developer preview.

http://msdn.microsoft.com/en-us/vstudio/hh127353

Cheers,

Samitha

Download Microsoft SQL Server 2012 Release Candidate (RC)

Experience the full value of SQL Server 2012 now. The release candidate is a production-quality release that gives you the chance to download, preview, and deploy the full marquee capabilities being delivered in SQL Server 2012.

http://technet.microsoft.com/en-us/evalcenter/hh225126.aspx?prod=SQL%25tech=CL%20%25type=DL%25prog=eval 

Cheers,
Samitha

Wednesday, October 26, 2011

get the current row in GridView Row Command

This not directly possible in ASP.NET.  Following article discusses a workaround to get the current row in GridView RowCommand event.

http://ranafaisal.wordpress.com/2008/03/31/how-to-get-the-current-row-in-gridview-row-command-event/ 

The inline code for gridview displayed below.

<asp:GridView ID="grdTrackedItems" runat="server" AutoGenerateColumns="False" Width="330px"
            BorderStyle="None" OnRowEditing="EditRecord" OnRowCommand="RowCommand">
            <Columns>
              <asp:TemplateField HeaderText="Name">
                <ItemTemplate>
                  <asp:Label ID="lblItem" runat="server" Text='<%# Eval("Item") %>' />
                </ItemTemplate>
              </asp:TemplateField>
              <asp:TemplateField>
                <ItemTemplate>
                  <asp:ImageButton ID="imgDelete" runat="server" ImageUrl="~/Resources/Images/Delete.png"
                    Height="12" Width="12" ToolTip="Delete" CommandName="Delete" />
                </ItemTemplate>
                <ItemStyle Width="22px" />
              </asp:TemplateField>
              <asp:TemplateField>
                <ItemTemplate>
                  <asp:ImageButton ID="imgEdit" runat="server" ImageUrl="~/Resources/Images/Edit.png"
                    Height="12" Width="12" ToolTip="Edit" />
                </ItemTemplate>
                <ItemStyle Width="22px" />
              </asp:TemplateField>
            </Columns>
          </asp:GridView>


Make sure you are handling the OnRowEditing event(keep it blank)
protected void EditRecord(object sender, GridViewEditEventArgs e)
{
    
}

 
Cheers,
Happing coding
Samtha

Friday, October 21, 2011

Linq Select Top X

use flowing linq query to ger top x (x is no of rows required) for the result


var result= (from t in tblItems.AsEnumerable()
                   select t).Take(x);

cheers
Samitha


Monday, October 17, 2011

Upgrading an ASP.NET 3.5 Web site that has a 3.5 Chart control to ASP.NET 4 requires changes to web.config and register directive

If you have used Microsoft Chart control in your VS 2008 project and upgraded to VS 2010 following steps should be followed to upgrade to Chart control 4.0 (Extracted from Visual Studio 2010 Read me).


Updgrading an ASP.NET 3.5 Web site that has a 3.5 Chart control to ASP.NET 4 will cause the following error on build:
Error 1 The type 'System.Web.UI.DataVisualization.Charting.Chart' exists in both 'c:\Windows\assembly\GAC_MSIL\System.Web.DataVisualization\3.5.0.0__31bf3856ad364e35\System.Web.DataVisualization.dll' and 'c:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Web.DataVisualization.dll' C:\Websites\Vs2008Sp1_Website_35_Cs_WithChart\Default.aspx 15
To resolve this issue:
References that still point to the 3.5 Chart control in web.config after upgrade must be updated to reference version 4.
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID">lt;controls>
<add tagPrefix="asp" namespace="System.Web.UI.DataVisualization.Charting" assembly="System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</controls>
</pages>
<httpHandlers>
<add path="ChartImg.axd" verb="GET,HEAD" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
</httpHandlers>
......
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<handlers>
<remove name="ChartImageHandler"/>
<add name="ChartImageHandler" preCondition="integratedMode" verb="GET,HEAD" path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</handlers>
</system.webServer>
......
Register directive in the Web forms page must be removed or updated to reference version 4.
<%@ Register assembly="System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" namespace="System.Web.UI.DataVisualization.Charting" tagprefix="asp" %>
The existing System.Web.DataVisualization assembly in the bin folder may have to be deleted because this assembly is part of the .NET Framework 4.


Friday, October 7, 2011

copy Microsoft.ReportViewer.ProcessingObjectModel.dll

When you are trying to build a project with Microsoft Reports you may not be able to build it successfully. You'll be needed to copy the Microsoft.ReportViewer.ProcessingObjectModel.dll to your bin directory of the web project. Following article gives the detailed steps do it.

http://am22tech.com/s/22/FORUM1/default.aspx?g=posts&m=804

cheers
samitha





Ms Chart assembly loading problem

Following error will be given when you trying to open the page first time with chart control in the designer. (newly formatted machines).

.
FileLoadException: Could not load file or assembly 'System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. Failed to grant minimum permission requests. (Exception from HRESULT: 0x80131417)]

Following thread discusses the method to fix above issue.

http://social.msdn.microsoft.com/Forums/en/MSWinWebChart/thread/d976b659-264a-4731-935c-08c02865002f

The solution proposed by msdn needs improved solved my problem.


Cheers
samitha

Wednesday, September 7, 2011

Running a WCF Service on IIS 7

In order to tun a WCF service in IIS7, some of the features should be enabled that are not set by default. Following article describes the steps to enable those features.

http://weblogs.asp.net/dwahlin/archive/2009/07/21/running-a-wcf-service-on-iis-7.aspx

In addition if your WCF service exposes an endpoint using basicHttpBinding, then it should be possible for the .NET 2.0 client to consume it.

Cheers,
Samitha


Wednesday, August 31, 2011

Hosting and Consuming WCF Services

I wanted to create and consume a WFC service as it provides improved performance with compared to web services. It was not easy as one would have liked as you have to manually set bindings in the web.config. Following link provides additional details and will be a good starting point.

http://msdn.microsoft.com/en-us/library/bb332338.aspx

Cheers
Samitha



Thursday, August 25, 2011

passing max value for nvarchar from code

 .I recently used the nvarchar(max) data type for one of the SP and had difficulty setting the parameter size from code. Setting the parameter the size to -1 to get it to work.

read more
http://weblogs.asp.net/jeffwids/archive/2008/08/15/nvarchar-max-parameters-need-the-size-set-to-1.aspx

cheers
samitha




Wednesday, August 10, 2011

Object already exists error in RSACryptoServiceProvider

This also seems to be a common error that ll come across. I had the same problem,
Changing the  KeyContainerName proved to be the solution for me.

More info
http://social.msdn.microsoft.com/forums/en-US/netfxbcl/thread/f7b9f928-a794-47f2-a5bd-9f64ca375040/.

regards
samitha

Friday, August 5, 2011

Could not find installable ISAM file

Seems to be this is a common error that will be a nightmare for some ppl. The following works with both Excel 2003 and 2007. I could not test it on  Excel 2010...!!!

read more
http://social.msdn.microsoft.com/Forums/en-US/adodotnetdataproviders/thread/cdd1cbe4-22c0-4a07-b97b-d2039ae6d83e/

regards,
samitha

Monday, July 25, 2011

Workaround for ASP.NET AjaxControlToolkit Combo Box issue

ComboBox is one of the exotic controls present in AjaxControlToolkit . But I have come across some problems while using it.
They are :
  1. After clearing all the items of Combo Box , the selected item does not get cleared , even after post back.
  2. Sometimes after binding the data , Combo box is not displaying the first item or It remains blank or It will be displayed only when we move in/out focus in the combo box.

    workaround for this is provided in following link

    http://www.mindfiresolutions.com/Workaround-for-ASPNET-AjaxControlToolkit-Combo-Box-issue-832.php

    cheers
    samitha 

Monday, June 27, 2011

ASP.NET AJAX CollapsiblePanelExtender - Tips and Tricks

Here are some useful tricks for the AJAX collapsible panel. I wanted to programmatically expand the collapsible panel but only succeed it when I set CollapsiblePanelExtender1.ClientState = "false";

http://www.dotnetcurry.com/ShowArticle.aspx?ID=230

Cheers,
samitha






Thursday, June 23, 2011

XLSExport

A CLR procedure utilizing the NPOI library to export the results of a passed stored procedure to an Excel spreadsheet.


cheers
samitha


Saturday, June 11, 2011

Choosing the Right Join

What do SQL joins and the "teach a man to fish" Chinese proverb have in common? SQL joins, like regular expressions, are one of those commonplace programming tasks in which true success is entirely dependent upon your ability to conceptualize the outcome. Fail to do so and you'll likely wind up spending a few hours in a frustrating round of trial and error. Like regular expressions, the proliferation of online examples has actually contributed to the frustration, providing the equivalent of a day's worth of fish rather than the proverbial fishing pool

read more
http://www.developer.com/db/3-sql-join-concepts-to-help-you-choose-the-right-join.html

cheers
samitha

Index Management

This article demonstrates an Index Management strategy to tackle day to day performance issues due to improper indexes.  

read more
http://www.sqlservercentral.com/articles/Indexing/68079/


 cheers
samitha
 


Tuesday, June 7, 2011

Encrypting Custom Configuration Sectionsa

This includes both the connection string and machine key sections.  See Scott Guthrie's post for some good references.  Note that if your application runs in a clustered environment you will need to share a custom key using the RSA provider as described in an MSDN article.

regards
samitha

Tuesday, May 31, 2011

Create and Publish a Website on the Internet Using Microsoft WebMatrix

These short videos demonstrate how you can create a website and publish it on the internet using Microsoft WebMatrix, and then synchronize it with the development box

cheers
samitha.

Windows Phone 7 app making

Use this simple app maker to make your first app in minutes

http://blog.appmakr.com/app-making-in-mere-minutes/

cheers
samitha

Using Extended Events to troubleshoot SQL Server issues

As a DBA, you'll encounter elusive performance, connectivity and locking problems that you'll need to troubleshoot. There are many tools that you can use such as Profiler. In addition to these tools, SQL Server 2008 offers extended events ("XEvents"), which you can use as a powerful tracing system. By default, the "system_health" extended events session is always on, and can provide you help to locate the source of trouble much faster

read more
http://www.mssqltips.com/tip.asp?tip=2369

cheers
samitha

Thursday, May 19, 2011

PowerPivot for Microsoft Excel 2010

Microsoft® PowerPivot for Microsoft® Excel 2010 provides ground-breaking technology, such as fast manipulation of large data sets (often millions of rows), streamlined integration of data, and the ability to effortlessly share your analysis through Microsoft® SharePoint 2010.

read more
http://www.powerpivot.com/learn.aspx

download

http://www.microsoft.com/downloads/info.aspx?na=46&SrcFamilyId=E081C894-E4AB-42DF-8C87-4B99C1F3C49B&SrcDisplayLang=en&u=http%3a%2f%2fdownload.microsoft.com%2fdownload%2fA%2fB%2fC%2fABC4B8B3-653F-4439-8E66-5B418E72DD13%2f1033%2fPowerPivot_for_Excel_amd64.msi

cheers
samitha

Tuesday, May 10, 2011

Building Better HTML5

E9 features updated and new developer tools, including a new network analysis tab, updated DOM and CSS inspectors, a script formatter, debugger, and profiler, tools that help developers preview their sites in IE's different browser and document modes, quickly clear the browser cache, validate HTML, and more

http://blogs.msdn.com/b/somasegar/archive/2011/04/07/building-better-html5.aspx 

cheers
samitha

SQL Azure Migration Wizard

There’s a project over on code plex to come up with a mechanism for validating databases and generating the necessary scripts to allow you to move those databases, and data, over to SQL Azure

http://www.sqlservercentral.com/blogs/scarydba/archive/2011/5/9/sql-azure-migration-wizard.aspx

cheers
samitha

Using SQL Server Resource Governor to Control Resource Utilization

This article introduces SQL Server Resource Governor and provides a detailed walkthrough of using Resource Governor to manage the resource utilization of SQL Server

 http://www.sql-server-performance.com/articles/per/resource_governor_system_resources_p1.aspx

cheers
samitha

Friday, April 22, 2011

Server-side Tracing

SQL Trace is one of my favorite SQL Server features. Tracing in SQL server allows one to selectively capture and record valuable details of SQL Server Database Engine events that would otherwise be discarded. Information captured with these events is useful for a variety of purposes, such as performance analysis, troubleshooting, forensics, establishing baselines and proactively identifying problem areas.

Read more
http://www.sqlservercentral.com/articles/SQL+Trace/71693/

cheers
samitha

New Training from Microsoft Learning on YouTube

Visit the Microsoft Learning YouTube channel to check out some of the new playlists now available. They include Visual Studio 2010—The Best Path from Ideas to Solutions, Experiencing the Microsoft SharePoint 2010 User Interface, the Microsoft Certification Tutorial, and Windows Azure Platform and Interoperability. Receive complimentary training through Learning Snacks in the Training Catalog.



cheers
samitha

development across platforms in Microsoft Visual Studio 2010

One of the most exciting new features slated to be included with the release of SQL Server 2011, code-named Denali, is a toolset Microsoft says will advance the art of database development. This new feature -- tentatively named SQL Server Development Tools (SSDT) and code-named Juneau -- is built within Microsoft Visual Studio 2010 and uses the Windows Presentation Foundation shell.

As a result, SSDT supports a unified development environment that provides functionality for both data-tier and application-tier developers across SQL Server platforms, including support for Microsoft's cloud-based database.



read more
http://searchsqlserver.techtarget.com/feature/Finally-development-across-platforms-in-Microsoft-Visual-Studio-2010?asrc=EM_NLT_13721951&track=NL-417&ad=827652 

cheers
samitha

Sunday, March 13, 2011

How to Connect to a SQL 2005 Server When You Are Completely Locked Out

If you need to connect to a SQL server and don't have the 'sa' password plus the builtin\administrators account has been removed then Rudy Panigas shows us what you need to know

read more
http://www.sqlservercentral.com/articles/Administration/68271/

cheers
samitha

Visual Studio 2010 SP1

Visual Studio 2010 SP1 provides a comprehensive set of bug fixes, software tweaks and feature additions to Microsoft's flagship IDE. The improvements address responsiveness, stability and performance of Visual Studio 2010, according to Microsoft. Visual Studio 2010 SP1 has been available as a public beta since December.

Visual Studio 2010 SP 1 is available today for download to MSDN subscribers, at this location. SP1 will be available for public download on March 10 from this page.

cheers
samitha

WordPress for Windows

Get the most popular open-source blogging, publishing, and content management system with a deep plugin and theme architecture that allows for limitless possibilities. Microsoft is teaming up with the WordPress Community to make using WordPress on Windows even easier and a great choice for everyone


read more and download
http://www.microsoft.com/web/wordpress?WT.mc_id=ban-f-us-wag-wp-internetcom&CR_CC=200032649&&CCID=20148284203786154&QTR=ZZf201103081434380Za20148284Zg96Zw0Zm0Zc203786154Zs9272ZZ&CLK=606110313085509836&news=promo&eml=samithaslk@yahoo.com&&exp=y

Cheers
samitha

Tuesday, March 1, 2011

Check Your JavaScript with JSHint


Paul Irish and Anton Kovalyov have launched an online tool for checking your JavaScript code for errors and problems. JSHint aims to be more flexible and support more environments than JSLint, a similar tool created by Douglas Crockford.  Paul Irish and Anton Kovalyov have launched an online tool for checking your JavaScript code for errors and problems. JSHint aims to be more flexible and support more environments than JSLint, a similar tool

http://jshint.com/
cheers
samitha

Thursday, February 17, 2011

downloading a .pdf document from a datagrid which is under a update panel

I want to get the GridView's html code before page render. I just used GridView.RenderControl() method.   The gridview was inside an update panel.

----------Here Comes My Code---------------
        System.IO.StringWriter stringWrite = new System.IO.StringWriter();
        System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
        GridView gv = new GridView(); //Dummy data gridview
        gv.DataSourceID = "SqlDataSource1";
        
        gv.DataBind();
        try
        {
            gv.RenderControl(htmlWrite);
        }
        catch (Exception ex)
        {
            Response.Write(ex.Message);
        }
When you run the above code following error will be generated
Error:

sys.webforms.PageRequestManagerParserException: The message received from the server could not be parsed.Common causes for this error are when the response is modified by calls to Response.Write ,response filters ,http modules or server trace is enabled

Details:Error Parsing near "%Pdf-1.4" %[] []


I  solved the issue with the below code

<Triggers >
<ajax:PostBackTrigger ControlID ="btnPrint" />

</Triggers>

Wednesday, February 2, 2011

Get Microsoft WebMatrix and Streamline Your Site Development Now

WebMatrix is the easiest way to build, test and deploy Web sites. WebMatrix installs in minutes and elegantly integrates a Web server, database and programming frameworks into a single integrated experience. Connect from WebMatrix to Visual Studio or SQL Server Express to take advantage of Microsoft's professional tools and servers

Read more and download
http://www.microsoft.com/web/webmatrix/

Cheers
samitha

Top 7 Tools for Microsoft Azure

Developers always build an ecosystem of small tools and utilities around every platform they love and Microsoft Azure is no different. Take a look at seven great tools to make your cloud computing life a little easier. They range from making it easier to work with your storage accounts, to migrating data, to one that will even help you manage your charges. Spend some time this holiday season sharpening your saw and playing with some new tools
read more
http://www.codeguru.com/csharp/.net/article.php/c18451

cheers
samitha

Preventing Security Exploits Caused by Concurrency Bugs

Jinx, a new software quality tool that reliably identifies concurrency bugs, points out the causality
of such bugs and enables developers to verify that their patches and software fixes have eliminated these bugs.

read more
http://adtmag.com/whitepapers/2010/11/corensic-preventing-security-exploits-caused-by-concurrency.aspx?tc=page0&pc=c342em02&utm_source=webmktg&utm_medium=E-Mail&utm_campaign=c342em02

cheers
samitha