Sunday, December 15, 2013

Jquery datepicker prevent from selecting future date in Asp.Net

Hello Friends,

Today I am writing this post for developer who face problem to disable future date using Jquery datepicker in asp.net.



First of all you have to use "jquery-1.7.1.min.js","Jquery-ui.min.js" and "jquery-ui.css that can be dowload it form 
http://jqueryui.com/download/all/ and add in your page. 

For add datepicker add below code inside tag.

        $(document).ready(function () {             var d = new Date();
            var curr_year = d.getFullYear();
            $("#<%= txtBirthDate.ClientID  %>").datepicker(
        {
           yearRange: '1900:' + curr_year,
          changeMonth: true,
          changeYear: true,
          maxDate: '-1d',
          buttonImage: '../Theme/image/icon_calendar.png',
          buttonImageOnly: true,
          showOn: 'button',
          dateFormat: 'DD, MM d, yy'
        });
});






and Add a Textbox with Id="txtBirthDate" in your Asp.net Page.

Enjoy coding.....

If you like this post share it.. If you encounter any problems, feel free and 
comment below to find solution. Share Your Experience with us.


Tuesday, October 8, 2013

Quick Link For Download Visual Studio 2013 RC



Friday, September 13, 2013

Difference between Local Temp Table and Global Temp Table ?

What is the difference between Local Temp Table and Global Temp Table ?

Temporary tables are temporary storage structures.
You may use temporary tables to store data that you
will manipulate before arriving at a final format. 
 
Local Temp Table: 
The hash (#) character (prefix with tablename) is used to declare a temporary table 
as it is prepended to the table name. A single hash (#) specifies a local temporary table.
 Local temporary tables are available to the current connection for the user, so they 
disappear when the user disconnects. Within SQL Server, temporary tables are stored 
in the Temporary Tables folder of the tempdb database.
Syntax for creating Local Temp Table
Create table #tempLocalTableName(EmpId int, EmpName varchar(50), EmpAdd varchar(100))

Global Temp Table:
Global temporary tables may be created with double hashes (##) (Prefix with table name).
 These are available to all users via all connections, and they are deleted only when all
 connections are closed. Once created, these tables are used just like permanent tables;
 they should be deleted when you are finished with them. 
Syntax for creating Temp Table
Create table ##tempGlobalTableName(EmpId int, EmpName varchar(50), EmpAdd varchar(100))




If you like this post share it.. If you encounter any problems, feel free and

comment below to find solution. Share Your Experience with us.

 



Sunday, September 1, 2013

.Net Interviews Question For Beginners

Hello Friends,

Today I am writing this post because of in Interviews I have faced so many question when I was beginners. So, I think I should share these question with you.


Interview I

1. Tell about your technical profile.
2. What was your role in your project?
3. In which module you have worked explain?
4. Describe GridView events (Paper).
5. How to change Label's color based on Label's value  (Paper)?
6. Write the code to perform edit and delete operations using  GridView        (Paper).
7. What are the Validation controls in ASP.Net?
8. How you will implement Custom Validator Control functionality (Paper)?
9. What are Generics?
10. What is the  difference between HashTable and Dictionary?
11. What is Ajax and  Jquery?
12. Which control have you used in AJAX?
13. What is the use of ModalPopUpExtender (Paper)?
14. WCF Basics (Types of binding)
15. What are Database Constraints?
16. Difference between Primary and Unique key?
17. Difference between Function and Procedure?
18. Can we store DataSet in View State?
19. When we will store DataSet in Session then which memory will be filled client side or server side?
20. Difference between reference and out parameter?
21. How to execute stored procedure?

Interview II

1. What is View State?

2. Where is View State is saved and how View State value is retained
between Post Back. (Practical)?
3. Form Authentication Process (Using Web.Config file and Database in paper).
4. If View State value is "X" and I have changed it to "Y" in Page_Load
then what will be the final value of View State?
5. Page Life cycle with use.
6. Performance Analyzer tool.
7. How to declare unique key?
8. Diff. between Equi join and Right outer join (Paper)?
9. Define Caching types.
10. How to implement SQL Cache (Paper)?
11. How to call Web service using AJAX (Paper)?
12. How to change Color of Label using Jquery (Paper)?
13. What is Table Object/Variable?
14. How to call stored procedure using Entity Framework?
15. What is the difference between Overloading and Overriding?
16. What is the difference between ExecuteScalar() and ExecuteNonQuery()?
17. What if I will pass Select * in ExecuteScalar()?


Interview III

1. Tell me about projects.

2. Your role in project.
3. Which performance tool you have used?
4. Define abstract class and interface?
5. Why to use static members?
6. What is partial class and advantages?
7. GridView and DataList differences.
8. State Management type.
9. What is view state and use?
10. Caching techniques.
11. WCF and Web service differences.
12. Define WCF contracts.
13. Define design pattern.
14. What is facade pattern?
15. Triggers use and types.
16. Define cursor.
17. Difference between clustered and non-clustered index.
18. How many clustered index can be declared for a table.
19. What is view?
20. What is AJAX and Update-panel?
21. If you have 2 Update-panel then how to update one update panel from second?

Interview IV

1. Define your Technical skills.

2. Your Role in project.
3. Define features of OOPS.
4. How you will replace the functionality of parent class function in
child class.(Paper)
5. Difference between Interface and abstract class (Use).
6. Functions of CLR.
7. Where you will use Cookie, Session and View State.
8. What are InProc and OutProc Session?
9. If you will save session in OutProc then where it will be saved.
and when it will be expired.
10. Difference between Web service and WCF
11. Design pattern.
12. Write sequence of select query-

 [ WITH ]
SELECT select_list [ INTO new_table ]
 [ FROM table_source ]
 [ WHERE search_condition ]
[ GROUP BY group_by_expression ]
[ HAVING search_condition ]
[ ORDER BY order_expression [ ASC | DESC ] ]


13. What is ROW_NUMBER () in SQL Server?
14.  Difference between Union and Join.
15. Return value for ExecuteNonQuery().
16. Can we execute DML command in ExecuteScalar()?
17. Difference between DataSet and DataReader.
18. If provider is given OracleClient then can we connect with SQL Server?

19. Where you have used JQuery in your project?
20. Namespace for web-part (SharePoint)    - System.Web.UI.WebControls.WebParts Namespace
21. For creating a site what are the main concepts you need to consider 
in UL layer, middle-ware and Database Layer.


For More Interviews Question Click Here:

Sql Interview Questions And Answers Part II


If you like this post share it.. If you encounter any problems, feel free and 
comment below to find solution. Share Your Experience with us.


Difference between Asp.Net MVC 3 and MVC 4

Hello Friends,

Today I am writing this post because of this is very important question in interview as well as you should know the difference between MVC3 and MVC4. So let enjoy this.
                                  
MVC
ASP.NET MVC  is a framework for building scalable, standards-based web applications
using well-established design patterns and the power of ASP.NET and the .NET Framework.

BEST/NEW FEATURES OF MVC 3

1.Integrated Scaffolding system extensible via NuGet
2.HTML 5 enabled project templates
3.Expressive Views including the new Razor View 
   Engine
4.Powerful hooks with Dependency Injection and
   Global Action Filters
5.Rich JavaScript support with unobtrusive JavaScript, jQuery  Validation, and JSON binding



BEST/NEW FEATURES OF MVC 4

1.
ASP.NET Web API
2.Refreshed and modernized default project
    templates
3.New mobile project template
4.Many new features to support mobile apps
5.Enhanced support for asynchronous methods



If you like this post share it.. If you encounter any problems, feel free and 
comment below to find solution. Share Your Experience with us.




Monday, August 26, 2013

Create Connection String in Asp.net using web.config file

Hello Friends,

Today I am writing this post because of I found out that beginners got a problem to create connection with database in web config file in asp.net. So, Solution is here. Enjoy it.....

Web Config File

<configuration>

  <connectionStrings>

    <add name="nameofConnection" connectionString="Data Source=servername; Initial Catalog=DatabaseName; User ID=UserName; Password=Password;"/>

  </connectionStrings>

  <system.web>
    <compilation debug="false" targetFramework="4.0" />
  </system.web>

</configuration>


Default.aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">
    <title>Connection String Demo</title>
</head>

<body>
    <form id="form1" runat="server">
    <div>
        <asp:GridView runat="server" ID="GridView1">
        </asp:GridView>
    </div>
    </form>
</body>
</html>



Default.aspx.cs

Add System.Configuration and System.Data.SqlClient namespace to add connection with sql.


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;

public partial class _Default : System.Web.UI.Page
{
   protected void Page_Load(object sender, EventArgs e)

   {

string connectionString = ConfigurationManager.ConnectionStrings["nameofConnection"].ConnectionString;

string query = "SELECT ProductID, ProductName, UnitPrice FROM tblProduct";
       
SqlDataAdapter da = new SqlDataAdapter(query, connectionString);

DataTable table = new DataTable();

da.Fill(table);

GridView1.DataSource = table;

GridView1.DataBind();

   }
}

If you like this post share it.. If you encounter any problems, feel free and comment below to find solution. Share Your Experience with us.










Sunday, August 25, 2013

Creating a virtual directory in IIS 7.5 and 7.0

Hello Friends,

Many times we face the problem to host our website on local
machine to createa virtual directory, So solutions is here for creating virtual directory in IIS 7.5 and 7.0.

Since IIS 7, there exists a separate concept for a virtual directory and an application.
You can map a virtual directory to a physical directory that is located on a local  a or remote computer. The physical directory (under the specified name of the virtual directory) then becomes part of the application's URL.
An application, on the other hand, is a group of files that provides services over protocols. So if you want to run your website as http://localhost/Demo, you have to use an application instead of a virtual directory and specify Demo as the application's alias.

To create a virtual directory:
Open IIS Manager
On Windows 7: Open Start -> Control Panel -> System and Security category ->
                        Administrative Tools -> Internet Information Services (IIS) Manager.


         On Windows Server 2008 or Windows Vista: Open 
Start -> Control Panel ->
              System and Maintenance category -> Administrative Tools ->
                                      Internet Information Services (IIS) Manager.
Expand local computer -> Sites -> right-click on Default Web Site (or other website if you're running multiple websites on the same computer) and choose Add Virtual Directory... 

An Add Virtual Directory dialog appears.
Enter the Virtual Directory Alias. If you want the website to run as http://localhost/KenticoCMSDemo, enter alias KenticoCMSDemo.
Type a path or browse to the physical directory that contains the chosen directory.


5. Click 
OK.
The system creates a new virtual directory.
Right-click the virtual directory and choose Convert to Application.
An Add Application dialog appears.
7.Click Select... and choose the ASP.NET v4.0 application pool from the drop-down menu.

8. Click OK.
The system converts the virtual directory to an application.
Alternatively, you can create an application in one step by right-clicking a web site and choosing Add Application... and filling the required information in the Add Application dialog as mentioned above.
Configuring application pools in IIS 7 and IIS 7.5
Application Pools provide you with additional level of website management. They are supported only by Windows Server 2003/2008/Vista/7. You can configure them in the Internet Information Services (IIS) Manager under local computer -> Application Pools.


  
You can check and change the assigned application pool by right-clicking an application under local computer -> Sites -> Default Web Site (or other web site) and selecting Manage Application -> Advanced Settings...

  
You can set the Recycling and other options by right-clicking on an application pool under local computer -> Application Pools and selecting Advanced Settings....

  

If you like this post share it.. If you encounter any problems, feel free and comment
 below to find solution. Share Your Experience with us.