Pages

Thursday, October 31, 2013

DateTime minvalue in C#.Net

Here we discuss about set DateTime.MinValue. When you try to assign a DateTime to the null literal in the C# language, The compiler will give an error "Cannot convert null to System.DateTime".

Instead of assigning the DateTime to null, you can use the readonly field DateTime.MinValue

Example :

DateTime date1;
date1=DateTime.MinValue

Output :

1/1/0001 12:00:00 AM

Monday, September 30, 2013

2 - 3 Years experience .net interview questions

Here i list out questions - part 1 were asked in 2 - 3 years experience in .net,c# and sql server

  1. Tell about Design Patterns?
  2. What is GAC and explain?
  3. Difference between web service and remoting?
  4. Difference between response.redirect and server.transfer?
  5. Tell about Application Events?
  6. What are Custom Control and User Control? 
  7. Tell about Page life cycle ?
  8. What is cross page postback?
  9. What are the access modifiers and explain?
  10. Tell about real need of interface?
  11. Explain OOPS concepts?
  12. Can multiple catch blocks be executed?
  13. What is Jagged Arrays?
  14.  What are the differences between System.String and System.Text.StringBuilder classes?
  15. What’s the difference between the System.Array.CopyTo() and System.Array.Clone() ? 
  16. What are delegates? 
  17. What are the difference between clustered and a non-clustered index?
  18. What are the different index configurations a table can have?
  19. What is CHECK Constraint?
  20. What is an execution plan? When would you use it? How would you view the execution plan? 

Thursday, September 19, 2013

Invalid temp directory in chart handler configuration [c:\TempImageFiles\].

Here we discuss how to solve the asp:chart error like 'Invalid temp directory in chart handler configuration [c:\TempImageFiles\].'  Try to remove the virtual directory path !!

Old web.config snippet



Please follow the below step the error will resolved. 

web.config snippet




Tuesday, September 17, 2013

Disable Multiple times button click event example using asp.net,c#,javascript

Here we discuss how to avoid multiple times button click. 

Script Snippet:

  1. Create java script function like below there we can get button object and using java script 




HTML Snippet:


         
C# Snippet:

  1. Write below code in asp:button click event and create array list and set desire time as loop count 




SQL Server Query for remove first / last character in a string

Hi now we can see how to remove first / last character in a string SQL Server.


Query for remove first char

Example

DECLARE @rollid NVARCHAR(MAX)
SET @rollid=',18,24,40,'
SELECT Substring(@rollid, 2, (len(@rollid))) as Rollno

Result
18,24,40,

Query for remove last character from string

Example

DECLARE @rollid NVARCHAR(MAX)
SET @rollid='18,24,40,'
SELECT Substring(@rollid, 1, (len(@rollid)-1)) as Rollno

Result
18,24,40

SQL Query to display rows value into single column

Query for display last one week record of rollnos and its displayed in single column with sepeartor in between nos

declare @rollid nvarchar(max)=''        
select @rollid=@rollid+convert(varchar(5012),rollno)+',' from studentrecord(nolock) where stuid in('18','16') and cdate >=DATEADD(day,-7, getdate())order by CONVERT(VARCHAR(10), cdate, 103) desc   
select @rollid 

Based on dropdown selection dynamically set texbox maximumlength Using jquery

Here i explain how to set textbox maximumlenght depends on dropdown selection. Follow the below simples steps to get the result.

Script snippet:

 function drpchange() {
        if ($('#<%=searchtooldrp.ClientID %> :selected').text() != "Emp Name") {
            $('#<%=searchtooltxt.ClientID %>').attr("maxlength", "10");   
        }
    }

HTML snippet:


Monday, September 16, 2013

How we can customize your Gridview report while printing and viewing

Let see how can we achieve this. some times we have code to generate report using Gridview and user wants to print a page of your report. 

By setting simple css declartion we can do.


Set maxlength of textbox dynamically with javascript or jQuery


Today we are discussed about how to set maxlength in textbox using JQuery and javascript. Kindly look at the example and how we can achieve this.

Single textbox we can  set maxlength dynamically. 

sample code:







sample jquery:

$("#user_srch").attr('maxlenght','8');

Tuesday, June 12, 2012

What is the difference between 3 Tier architecture and MVC

 

Hi,

Both are looks similar but there is some vital difference.

S.No

3 Tier Architecture

MVC

1 It is a linear Architecture It is a Triangular Architecture
2 Client never access DAL directly Can Access
3 Code file along with UI Codes are Well separated concern
4 Each tiers developments are depended Model, View and Controller are developed independently and finally integrated

Hope this will helps you.

Wednesday, June 6, 2012

To Get Gridview Header using Javascript Function

Hi All,

Some situation we need to get dynamic header names..For example if you use gridview and show your db values. The below example will you explain how is it possible get gridview header name in javascript.

Step 1: Create New Project

Step 2: Create a new webpage. Its name like 'girdvheader.aspx'

Sample Code snapshot


Build and run the application.. we will get the girdview header names like this