Pages

Monday, December 15, 2014

Re-sharper 9.

Resharper

A Productivity Tool for Visual Studio.

Hi Everyone, Today I read news that resharper 9 has been released, so thought knowing more details about it. same I am sharing here which can help you to manage your code in very effective and efficient manner.


So what is resharper?
as per http://www.jetbrains.com/
It is the one thing for .NET developers that removes fear of change. Refactoring is just so darn easy that change isn't scary.

Why should we use it?
So...Resharper having so many advantages which I m listing below will help in every dimesion of programming.

ReSharper Features:
1.      Code quality analysis
ReSharper provides continuous code quality analysis in C#, VB.NET, XAML, XML, ASP.NET, ASP.NET MVC, JavaScript, HTML, and CSS, detecting errors and problems before you even compile.
ReSharper applies over 1700 code inspections to your code at design time so you can instantly see whether your current file or even your whole solution contains any errors or problems.
1.      Eliminate errors and code smells:
ReSharper instantly detects and highlights errors as you code, right in the editor. Errors are highlighted with either red font or curly underline. If you roll the mouse pointer over an error, its description is displayed in a tooltip.

2.     Instantly traverse your entire solution:
Not only is ReSharper capable of analyzing a specific code file for errors, but it can extend its analysis skills to cover your whole solution. Suppose that you changed the visibility of a member from public to internal, assuming that it was only used inside the current assembly. At this stage, ReSharper finds no errors in the current file. Then, you switch on Solution-Wide Analysis and ReSharper discovers that something went wrong. You jump to the next error in solution and you find out that someone used this member from outside of the current assembly.

3.     Safely change your code base:
ReSharper provides Structural Search and Replace to find custom code constructs and replace them with other code constructs. What's even more exciting is that it's able to continuously monitor your solution for your search patterns, highlight code that matches them, and provide quick-fixes to replace the code according to your replace patterns.

4.     Code editing helpers:
Multiple code editing helpers including extended IntelliSense, hundreds of instant code transformations, auto-importing namespaces, rearranging code and displaying documentation.

5.     Compliance to coding standards:
Code formatting and cleanup to get rid of unused code and ensure compliance to coding standards.

7.      Code generation:
You don't have to write properties, overloads, implementations, and comparers by hand: use code generation actions to handle boilerplate code faster.


What's New in ReSharper 9?

ReSharper 9 supports Visual Studio 2015 Preview, C#6.0 and regular expressions; brings more bulk quick-fixes; vastly improves support for JavaScript & TypeScript; presents a new file layout editor and navigation actions. It is also based on a new platform, reducing memory consumption when ReSharper is installed in Visual Studioalong with dotCover, dotTrace, and/or dotMemory.


Refrences:

Facebook Search and Microsoft Bing....We are not together anymore... :(

Facebook DUMPED Bing


Facebook Users, Its a Breaking news for you.....Facebook has stopped including results from Microsoft Corp's Bing search engine on its social networking site.

The move, comes as Facebook has revamped its own search offerings, introducing a tool on Monday that allows users to quickly find past comments and other information posted by their friends on Facebook.

Facebook Chief Executive Mark Zuckerberg has flagged search as one of the company's key growth initiatives, noting in July that there were more than 1 billion search queries occurring on Facebook every day and hinting that the vast amount of information that users share within Facebook could eventually replace the need to search the Web for answers to certain questions.

Microsoft's search engine only kicked in when Facebook's own querying system failed to deliver the relevant results.
Facebook and Microsoft have a longstanding relationship dating back to Microsoft's $240 million investment in Facebook, for a 1.6 percent stake in the company, in October 2007. As part of that deal, Microsoft provided banner ads on Facebook's website in international markets.

Facebook stopped using Microsoft banner ads in 2010 as it moved to take more control of its advertising business. But Facebook, during that same time, expanded its use of Microsoft Bing search results to international versions of its service.

But, for nearly two years now, Microsoft's search function has been unable to ferret around within Facebook's social graph where the real ad money is understood to be found.
And now, as noted by Reuters, Facebook has altogether dumped Microsoft, following the launch of its rejigged search product earlier this week.


Refrences:

Thursday, December 11, 2014

How to repeat header on each page in SSRS.


1. Click anywhere on report page.
2. Click On Advanced Mode.

3. Click on Static and see in Property window.

4. Make RepeatOnNewPage = True, and you DID IT :)



Pass data to partial view in MVC


Refrence Link: link

At view:

<div>
    <table id="tableDetails">
        <tr>
            <td rowspan="6">
                @Html.Partial("RestaurentAddressPartial", new DiningTable.Models.Address{ Id = 1, Flat = "D-1033", Steet1 = "Devi Homes", Steet2 = "Near Hafeezpet petrol Pump", ZipCode = "500049", City = "Hyderabad" })
            </td>
            <td rowspan="6">
                @Html.Partial("RestaurentAddressPartial", new DiningTable.Models.Address { Id = 1, Flat = "D-1034", Steet1 = "Devi Homes", Steet2 = "Near Hafeezpet petrol Pump", ZipCode = "500049", City = "Hyderabad" })
            </td>
        </tr>       
    </table>    
</div>

At Partial view:

@model  DiningTable.Models.Address

<h4>Address:</h4>
<p>
    @Html.DisplayFor(m => m.Flat)<br />
    @Html.DisplayFor(m => m.Steet1)<br />
    @Html.DisplayFor(m => m.Steet2)<br />
    @Html.DisplayFor(m => m.City)<br />
    @Html.DisplayFor(m => m.ZipCode)<br />
</p>

OutPut:


Friday, November 28, 2014

How to identify the TFS process template programmatically?

TfsClientCredentials crd = new TfsClientCredentials(true);
                        Uri uri = new Uri(this.Context.ConnectionString);

                        TfsTeamProjectCollection tfs = new TfsTeamProjectCollection(uri, crd);

                        ICommonStructureService css = (ICommonStructureService)tfs.GetService(typeof(ICommonStructureService));

                        ProjectInfo projectInfo = css.GetProjectFromName(this.Context.CommandParameters["ProjectName"].ToString());
                            String projectName;
                            String prjState;
                            int templateId = 0;
                            ProjectProperty[] projectProperties;


                            css.GetProjectProperties(
                                projectInfo.Uri, out projectName, out prjState, out templateId, out projectProperties);

Console.WriteLine(projectProperties[2].Value); //This will give you process template name


Refrence: Link

Tuesday, November 25, 2014

Export anything to excel

protected void LinkProcess_Click(object sender, EventArgs e)
    {
        try
        {
            Warning[] warnings;
            string[] streamids;
            string mimeType;
            string encoding;
            string extension;

            byte[] bytes = KMIReportViewer.ServerReport.Render(
               "Excel", null, out mimeType, out encoding, out extension,
               out streamids, out warnings);

            Response.ContentType = "application/ms-excel";
            Response.OutputStream.Write(bytes, 0, bytes.Length);
            Response.AddHeader("Content-Disposition", "attachment;filename=ReviewFinding.xls");

        }
        catch (Exception)
        {
        }
    }

Wednesday, November 12, 2014

SQL datediff days except saturday sunday

For workdays, Monday to Friday with a single SELECT:
DECLARE @StartDate DATETIME
DECLARE @EndDate DATETIME
SET @StartDate = '2008/10/01'
SET @EndDate = '2008/10/31'


SELECT
   (DATEDIFF(dd, @StartDate, @EndDate) + 1)
  -(DATEDIFF(wk, @StartDate, @EndDate) * 2)
  -(CASE WHEN DATENAME(dw, @StartDate) = 'Sunday' THEN 1 ELSE 0 END)
  -(CASE WHEN DATENAME(dw, @EndDate) = 'Saturday' THEN 1 ELSE 0 END)


Refrence: link

Thursday, October 30, 2014

ASP.net Sequence of Events in master page, ASP page, user control, nested user-control and control.

Here UC: UserControl  SubUC: Sub UserControl
Refrence: Link

Tuesday, September 23, 2014

sql data from rows to columns transpose without pivot

PIVOTs need an aggregate function, because you could have multiple entries in the original table. If you know you only have one value per key, then just use MIN().
Also, '$row1', '$row2', '$row3' are now columns and need to be delimited like columns
select * 
from (
  select 
  name,propertyvalue, displayname
  from indexrows
) a
PIVOT 
(
MIN(propertyvalue)
for [displayname] in ([$row1], [$row2], [$row3])
) as pivot

Friday, August 22, 2014

How to select all columns except only one column in sql server

DECLARE @columnList Varchar(1000), @SQLStatment VARCHAR(4000)
SET @columnList = ''
select @columnList = @columnList + Name + ' , ' from syscolumns where id = object_id('sample_tablename') AND Name != 'Id_columnnames'
SELECT @SQLStatment = 'SELECT ' + Substring(@columnList ,1,len(@columnList)-1) + ' From sample_tablename'
EXEC(@SQLStatment)

Friday, June 6, 2014

Kendo PopUp Resize

$("#kendoUploadPPR").kendoWindow({
        actions: ["Maximize", "Close"],
        draggable: false,
        height: "600px",
        modal: true,
        pinned: false,
        position: {
            top: 100,
            left: 100
        },
        resizable: false,
        title: "PPR Details",
        width: "1000px"
       });

JavaScript code for checking total document or file size at client side

// Javascript code for checking total document size.

                                var filesize1 = 0;
                                var filesize2 = 0;
                                var filesize3 = 0;
                                var filesize4 = 0;
                                var filesize5 = 0;
                             
                                $('#ctl00_ContentPlaceHolder1_gvReuploadDocs_ctl' + '02' + '_fuReuploadPath').bind('change', function () {
                                    filesize1 = Math.round(this.files[0].size / 1024);
                                    $('#ctl00_ContentPlaceHolder1_gvReuploadDocs_ctl' + '02' + '_lblFU').text(filesize1 + "KB");
                                    EnableDisableUpdate();
                                });

                                $('#ctl00_ContentPlaceHolder1_gvReuploadDocs_ctl' + '03' + '_fuReuploadPath').bind('change', function () {
                                    filesize2 = Math.round(this.files[0].size / 1024);
                                    $('#ctl00_ContentPlaceHolder1_gvReuploadDocs_ctl' + '03' + '_lblFU').text(filesize2 + "KB");
                                    EnableDisableUpdate();
                                });

                                $('#ctl00_ContentPlaceHolder1_gvReuploadDocs_ctl' + '04' + '_fuReuploadPath').bind('change', function () {
                                    filesize3 = Math.round(this.files[0].size / 1024);
                                    $('#ctl00_ContentPlaceHolder1_gvReuploadDocs_ctl' + '04' + '_lblFU').text(filesize3 + "KB");
                                    EnableDisableUpdate();
                                });

                                $('#ctl00_ContentPlaceHolder1_gvReuploadDocs_ctl' + '05' + '_fuReuploadPath').bind('change', function () {
                                    filesize4 = Math.round(this.files[0].size / 1024);
                                    $('#ctl00_ContentPlaceHolder1_gvReuploadDocs_ctl' + '05' + '_lblFU').text(filesize4 + "KB");
                                    EnableDisableUpdate();
                                });

                                $('#ctl00_ContentPlaceHolder1_gvReuploadDocs_ctl' + '06' + '_fuReuploadPath').bind('change', function () {
                                    filesize5 = Math.round(this.files[0].size / 1024);
                                    $('#ctl00_ContentPlaceHolder1_gvReuploadDocs_ctl' + '06' + '_lblFU').text(filesize5 + "KB");
                                    EnableDisableUpdate();
                                });

                                function EnableDisableUpdate() {
                                    if ((filesize1 + filesize2 + filesize3 + filesize4 + filesize5) > 10000) {
                                        changeColor('red');
                                        $('#ctl00_ContentPlaceHolder1_btnUpload').attr('disabled', 'disabled');
                                        alert("Document size more than 10 MB please reduce size.");
                                    } else {
                                        changeColor('green');
                                        $('#ctl00_ContentPlaceHolder1_btnUpload').removeAttr('disabled');
                                    }
                                }

                                function changeColor(color) {
                                    $('#ctl00_ContentPlaceHolder1_gvReuploadDocs_ctl' + '02' + '_lblFU').css({ color: color });
                                    $('#ctl00_ContentPlaceHolder1_gvReuploadDocs_ctl' + '03' + '_lblFU').css({ color: color });
                                    $('#ctl00_ContentPlaceHolder1_gvReuploadDocs_ctl' + '04' + '_lblFU').css({ color: color });
                                    $('#ctl00_ContentPlaceHolder1_gvReuploadDocs_ctl' + '05' + '_lblFU').css({ color: color });
                                    $('#ctl00_ContentPlaceHolder1_gvReuploadDocs_ctl' + '06' + '_lblFU').css({ color: color });
                                }

Kendo file upload to check file type at client side

<script type="text/javascript">
    function onUpload(e) {
        // Array with information about the uploaded files
        var files = e.files;

        // Check the extension of each file and abort the upload if it is not .jpg
        $.each(files, function() {
            if (this.extension != ".jpg") {
                alert("Only .jpg files can be uploaded")
                e.preventDefault();
                return false;
            }
        });
    }
</script>






Microsoft Excel Application entry missing in DCOMCNFG

1. Click start button, in start search bar, type in  "DCOMCNFG.EXE" (without quote) and then press enter.
2. Click Computer->DCOM Config, locate component with CLSID {00024500-0000-0000-C000-000000000046}and modify the permission.

00020812-0000-0000-C000-000000000046

00024500-0000-0000-C000-000000000046


Link

Tuesday, February 4, 2014

Tuesday, January 28, 2014

RadGrid Does Not Render Opening Table Tag in Visual Studio 2013

ANSWER

Add below key in your Web.Config file

 

<AppSettings>
 <add key="vs:EnableBrowserLink" value="false" />
</AppSettings>