Friday, October 24, 2014

Could not load file or assembly 'Microsoft.Reportviewer.Winforms Version=8.0.0.0” while generating Report

Solution :- 

Application have a this error when some files which require to run report viewer are missing.
There are two important files which needs to be on production environment to run report successfully.

Microsoft.ReportViewer.Common.dll
Microsoft.ReportViewer.WinForms.dll

For WebApplication Error Application needs below two dll's.
Microsoft.ReportViewer.Common.dll
Microsoft.ReportViewer.WebForms.dll

To resolve this install the ReportViewer Redistributable component from one of the following locations:

http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=21916 (Visual Studio 2005 components)

or

http://www.microsoft.com/download/en/details.aspx?id=6576 (Visual Studio 2008 components)

Other way to get this redistributable.

C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\ReportViewer\ReportViewer.exe

Install this and you all set to run reportviewer.

Tuesday, December 25, 2012

How to change hasehd password if you don't know the current password using asp.net membership provide ?

Many programmers stuck into above problem. the solution is reset the password randomly and pass that into the change method.

 

MembershipUser u = Membership.GetUser();
u.ChangePassword(u.ResetPassword(), "myAwesomePassword");




Enjoy !!!

Friday, December 21, 2012

How to secure webservice in asp.net.

Hello Frd's

While working with web service in asp.net one main question that stick on my mind is how I make secure  my web service.

I am going to publish web service in public domain any one can use it after knowing web url. I found very good discussion from asp.net forum let me share with you.


Securing a web service can be achieved at many levels, it is up to you to which level you may want to do.

1) Customised Token Based:

Have a web method where user may provide his credentials. Credentials could be username and password; this is quite similar to login page of the web form application. So, once user passes his username and password system validates these credentials against the database system generates a unique token (which is generally guid) and saves this against userid ion the database. This token is returned to the user as well. So, now onwards whenever user acceses other web methods (of functional nature) this token will need to be passes along as parameter. Before actually processing the call system validates this token against the database. If it is validated user is allowed to process the web method call. Additionally, just like session in the web forms application, you may control the timeout as well. for e.g. the token may remain valid for some pre-defined time and post that whenever user tries to access any method token gets expired and user is denied the request. You may set this timeout during login web method call.

2) WSE 3.0 Authentication:  

Web Services Enhancements (WSE) is a webservice standard which provides cross-platform security for webservices. Following URL will provide a step-by-step detail on how to use WSE 3.0 for authenticating webservices with your custom user database.

http://aleemkhan.wordpress.com/2007/09/18/using-wse-30-for-web-service-authentication/

Following link describes in detail how to develop and apply authentication, authorization, and secure communication techniques to secure ASP.NET Web services and Web service messages. It describes security from the Web service perspective and shows you how to authenticate and authorize callers and how to flow security context through a Web service. It also explains, from a client-side perspective, how to call Web services with credentials and certificates to support server-side authentication.


http://msdn.microsoft.com/en-us/library/aa302390.aspx#secnetch10_authstrategies

Pass Argument when opening page from Link button/Hyperlink from gridview.


Hello,

use below code to pass argument to new opening page.

Suppose we are try to open EmpDetail page by cliking on HyperLink.

<asp:HyperLink ID="mylink" runat="server"
         NavigateUrl='<%# Eval("EmpID","EmpDetail.aspx?EmpId={0}") %>' Text='<%# Eval("EmpName") %>'>
</asp:HyperLink>


Enjoy !!!!

Thursday, December 6, 2012

How to Create Add-In Setup for Visual Studio.

Hello,

Create Setup for Add-In is similar step which we are following to create windows application setup. only one thing that we keep in mind is files location of setup files.

Follow below step to make Add-in Setup.

1. Create "Visual studio installer" Project.



2. Create "custome folder" from File system window.



    In Above main point remember to change default location. Change it to "[PersonalFolder]\Visual Studio 2010\Addins"

3. Add .dll,.Addin  and .xml file in to windows installer.



Now build and Run installer.

Enjoy !!!!

Let me know if you face any problem. if you able to build setup then just comment on below.