Powered by Blogger.

Working with enterprise library for data access in asp.net Part-3

To work with enterprise library you have to download required from this URL. Here we will use Enterprise Library 5.0 version. We need to give reference in Bin folder to the following dlls: Microsoft.Practices.EnterpriseLibrary.Common.dll Microsoft.Practices.EnterpriseLibrary.Configuration.Design.dll

Asp.Net MVC4 sample application

we will make a sample application using Asp.Net MVC4. Open Visual Studio 2010, then go to File -> New Project. This will open the New Project dialog box. From there make sure .Net Framework 4 is selected. Then select the Visual C# -> Web templates list. From the web template lists, Select ASP.NET MVC 4 Web Application and give a name.

Object Oriented Programming (OOP) concepts in .Net

Mainly there are 3 things in OOPs concept. 1- Inheritance 2- Abstraction 3- Polimorphism Inheritance is one of the key feature of oops concept and C# supports inheritance. Inheritance is a process of deriving the new class from already existing class. It allows you to reuse existing code.

Tutorial on MVVM with WPF

MVVM is nothing but Model view and viewModel.This is the best architecture for WPF. VIEW: A View is defined in XAML and should not have any logic in the code-behind. It binds to the view-model by only using data binding. The View contains the visual controls that will be shown to the user.This is the UI.

WCF tutorial and example in C#.Net

We will discuss how to create a WCF service and how we can consume the WCF service. Open Visual Studio 2010, then go to File -> New -> Project. Then from the New Project dialog box, From the Installed Templates Select WCF from the left hand site, And then Choose WCF Service Library and Give a proper name and Click on OK.

Saturday, June 21, 2014

This backend version is not supported to design database diagrams or tables error in sql server 2008

In this post we will discuss how to resolve the error "this backend version is not supported to design database diagrams" which comes in sql server 2008.

Also you can check out:

- ModalPopupExtender background css not coming when showing from code behind in asp.net

- ModalPopupExtender example in Ajax in Asp.Net

- Reset auto increment sql server 2008 - Reset Table Identity Sql Server 2008

Recently I got this error as "this backend version is not supported to design database diagrams" which comes in SQL Server 2008.

I opened SQL Server 2012 database in SQL Server 2008 R2. Then I got the error.


Solution-1:
One very easy solution is to install SQL Server 2012.

Solution-2:
The second solution is install SP2 for  SQL Server 2008 R2. This solution work for me.

Thursday, June 5, 2014

File upload control within ajax updatepanel with update progress template asp.net

In this post we will discuss how we can use file upload control within Ajax Update Panem with Update progress template in Asp.Net.

Also you can check out:

- Clear textboxes inside a form in C#.Net

- Array and ArrayList in C#.Net

- Reset auto increment sql server 2008 - Reset Table Identity Sql Server 2008

Recently I have got a requirement like, we want to have a file upload control where we want to upload a file and then on the button click we want to process something and during processing we want to show a progress icon so that user will be able to know something is happening.

We can easily use a Ajax Progress template but we are using a file upload control which always needs a postback to work properly, it will not work with asynchronous postback.

so every time you can check FileUpload1.HasFile, it will return false.

To achieve this we have to use the PostBackTrigger like below:

  <Triggers>
                        <asp:PostBackTrigger ControlID = "btnGenerate" />
   </Triggers>

In the above case it will return true.

But the Progress icon will not work, to make this work we need to write a javascript function and need to call in the OnClientClick method of the button click.

Here is the full code:

<script type="text/javascript">
    function showProgressforGenerate() {
var updateProgress = $get("<%= UpdateProgress1.ClientID %>");
            updateProgress.style.display = "inline-block";
            document.getElementById('loadingimg').style.display = "none";
            document.getElementById('progressBackgroundFilter_UpdatePanel').innerHTML = '<asp:Image ID="LoadImage" runat="server" ImageUrl="../images/loading-1.gif" /><br/><strong>Generating..</strong>';
        }
Upload a File <asp:FileUpload ID="fUpload" runat="server" />
<asp:UpdatePanel ID="upLoadProducts" runat="server" UpdateMode="Conditional">
             <ContentTemplate>
<asp:Button ID="btnGenerate" runat="server" Text="Generate" CssClass="buttonHPBlue" OnClick="btnGenerate_Click" OnClientClick="showProgressforGenerate()"/>
                <asp:Button ID="btnCancel" runat="server" Text="Cancel" CssClass="buttonHPGray" OnClick="btnCancel_Click" />
  <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="upLoadProducts" DynamicLayout="true">
                                 <ProgressTemplate>
                                 <div id="progressBackgroundFilter_UpdatePanel" >
                                 </div>
                                 <div id="processMessage_UpdatePanel">
                                    <div id="loadingimg"> &nbsp;<img id="Img1" alt="progress" runat="server" src="../images/loading-1.gif" /></div></div>
                                 </ProgressTemplate>
                </asp:UpdateProgress>
              
                   
            </ContentTemplate>
                <Triggers>
                        <asp:PostBackTrigger ControlID = "btnCancel" />
                        <asp:PostBackTrigger ControlID = "btnGenerate" />
                    </Triggers>
            </asp:UpdatePanel>