Tuesday, February 9, 2010

Kikk

Thursday, January 28, 2010

Oracle interview questions 1

What is a mutating trigger? How would you resolve it?


---- Mutating trigger is trigger that is currently being modified by DML operation.



To avoid Mutating trigger there are many ways. One of the best approach is to make use of the after trigger which clearly takes care of concurrency problems associated with mutating triggers .When after trigger is used only after the process of current updating is finished the next process gets processed.



What is the difference between owner’s rights and definers rights in PL/SQL?



-----By default, stored procedures and SQL methods execute with the privileges of their owner, not their current user. Such definers’ rights subprograms are bound to the schema in which they reside, allowing you to refer to objects in the same schema without qualifying their names. For example, if schemas SCOTT and BLAKE both have a table called dept, a procedure owned by SCOTT can refer to dept rather than SCOTT.DEPT. If user BLAKE calls SCOTT's procedure, the procedure still accesses the dept table owned by SCOTT.



How would you prevent unauthorized use of privileges granted to a Role?



----By creating a Role with a password



What is a deadlock? What causes it and how can it be resolved?



--- A dead lock can occur when two or more users are waiting for data locked by each other. We can resolve this by rolling back one of the statements involved in dead lock.



How can you tell if a tablespace has excessive fragmentation?



--- If a select against the dba_free_space table shows that the count of tablespaces extents is greater than the count of its data files, then it is fragmented.



What is the replacement for Stats pack in 10g?



--- Automated Workload Repository (AWR) feature, and the proactive monitoring it provides through Automatic Database Diagnostic Monitor (ADDM). It is the replacement for STATSPACK.



In which data dictionary table or view would you look to determine at which time a snapshot or MVIEW was last successfully refreshed?



--- You can query the DBA_REGISTERED_MVIEWS data dictionary view at a master site or ... view site to obtain the last refresh times for each materialized view



You’re getting "busy buffer waits" – how can you find out what is causing it?



---- Buffer busy waits are common in an I/O-bound Oracle system, as evidenced by any system with read (sequential/scattered) waits in the top-five waits in the Oracle STATSPACK report



The main way to reduce buffer busy waits is to reduce the total I/O on the system. This can be done by tuning the SQL to access rows with fewer block reads (i.e., by adding indexes).



What is the replacement for export/import in 10g



--- Oracle 10g's new Data Pump utility is designed as the eventual replacement for the original Oracle Import and Export utilities.



Silverlight interview questions


I tried to post some Xaml code but due to blogger restrictions i was unable  post it.

What is Silverlight

Silverlight is a cross-browser, cross-platform and cross-device browser plug-in that helps companies design, develop and deliver applications and experiences on the Web. A free download that installs in seconds, Silverlight enables a new class of rich, secure and scalable cross-platform experiences.


What is XAML ?

Extensible Application Markup Language (XAML, pronounced zammel) is a declarative XML-based language created by Microsoft which is used to initialize structured values and objects.


What is the difference between WPF and Silverlight?

* Silverlight uses a particular implementation of a XAML parser, with that parser being part of the Silverlight core install. In some cases, the parsing behavior differs from the parsing behavior in Windows Presentation Foundation (WPF), which also has a particular implementation. More information.

* WPF Supports for ADO.Net but coming to the part of Silverlight it doesn't support for ADO.Net but uses a System.Data and a WCF/Web Service to communicate with Data

* WPF is for Windows Development and Silverlight is for Web Development.



Can you name built-in layout panels you have been using with Silverlight?

 Canvas, Stack-panel and Grid


What is Storyboard?

Storyboard is a Silverlight class with controls animations with a timeline, and provides object and property targeting information for its child animations



How can you implement following functionality: clicking left mouse on the ellipse should start ellipse movement to the right, ellipse should stop after moving 200px ?

In the answer you are looking for following steps:

1. Ellipse should have on mouse click event handler: either MouseLeftButtonUp or MouseLeftButtonDown, as following MouseLeftButtonUp=”AnimationStart”


2. Canvas should include Storyboard in the resource section :

Canvas.Resources>








3. Storyboard should contain double animation object:



4. Storyboard.TargetProperty should be set to (Canvas.Left) and Storyboard.TargetName should be set to name of ellipse object i.e. ellipseTest





How can you set image Source dynamically from C# application to” test.png” file?

Surprisingly it is not as straight forward as it might sound, but anyone who seriously worked with Silverlight should be easily answer it.


One of the ways is: img.Source = new BitmapImage(new Uri("test.png", UriKind.Relative));


How can you implement following functionality: clicking left mouse on the box should start box movement to the right, but instead of having linear speed object should move rapidly when it begins, slows down, and then speeds up again before it ends.


In this question you are looking for Key-frame animations, particulary SplineDoubleKeyFrame and Bezier interpolation.


To animate with a key-frame animation:


• Add Translate Transform Property to Rectangle object

< Rectangle x:Name="test" Height="20" Width="20" Canvas.Left="0" Canvas.Top="10" >





x:Name="saTranslateTransform"

X="0" Y="0" />



• Declare the animation and specify its Duration, as you would for a From/To/By animation.

• For each target value, create a key frame of the appropriate type, set its value and KeyTime, and add it to the animation's KeyFrames collection.

• Associate the animation with a property, as you would with a From/To/By animation

• Set KeySpline property to represent accelerate – slow down behaviour


Silverlight 1.0 uses JavaScript, while Silverlight 2.0 uses C# (managed code) for event handling. We will be describing the event model for Silverlight 2.0.

The event handlers are defined in the code-behind file that backs the XAML definition of your User Interface (UI), namely mypage.xaml.cs.



The Silverlight Event Mode

In Silverlight, there are two event cases:

Input events

Non-input events.


Input Events: The browser that hosts the Silverlight plug-in handles initial input stimulus for the input events. This is because Silverlight works within the plug-in architecture of the hosting browser. From the browser, the event is sent to the Silverlight plug-in. Then, it is raised as an event in the Silverlight Object Model.


Non-input Events: They report a state change to a particular object, for example, the state change events that report asynchronous download state or progress of actions initiated by Web Client. Some non-input events provide lifetime information of objects at a framework level. For example the FrameworkElement.Loaded event


Some events, such as OnError, can only be handled by the Silverlight plug-in instance and exist within the HTML Document Object Model (DOM). These events need to be continually exposed and possibly handled by any script working with the plug-in instance in the DOM. Therefore; these events are not passed to the managed programming model.


What features are available in the Silverlight 1.1 Alpha?

The Silverlight 1.1 Alpha includes all the features available in Silverlight 1.0 Beta plus a number of new features focused primarily on improving the developer productivity and power, including:


* Managed code support

* Support for dynamic languages including managed Microsoft JScript and Python

* Rich UI control model based on WPF

* Improved networking stack with support for REST, RSS, JSON, and POX

* Enhanced, two-way HTML/AJAX bridge

* Comprehensive and consistent base class library

* Support for LINQ (LINQ to Objects, LINQ to XML)


Can we add the reference of a Class library project in Silverlight application project?


No, You can't add the reference of a Class library inside the Silverlight application project. You can only add the reference of another Silverlight application project inside a Silverlight application project. However, you can add the reference of a Web Service or WCF services.



What is Silverlight.js file?


Silverlight.js is a helper file which enables Web sites to create advanced Silverlight installation and instantiation experiences.

For more details visit http://code.msdn.microsoft.com/silverlightjs


What is the .xap file inside ClientBin folder of consuming Silverlight application?


Following is a very good FAQ about the .xap posted on asp.net page.


What does XAP mean?

XAP (pronounced ZAP) is the file extension for a Silverlight-based application package (.xap). This file contains the compressed assemblies and resources of a Silverlight 2 application.


What is a .xap file?

A .xap file is a Silverlight-based application package (.xap) that is generated when the Silverlight project is built.


Why is XAP important?

Tools, such as Visual Studio 2008 with the Microsoft Silverlight Tools Beta 2 for Visual Studio 2008, allow you to create Silverlight applications that are heavily client based using managed code. You can use managed code, such as C# or Visual Basic, and benefit by using the tools that you are used to working with.

How does XAP work?

Once you have created the .xap file (explained below), the Silverlight 2 plug-in downloads the file and runs it in a separate work space.


How do I use a .xap file?

A .xap file is used to contain and transfer the assemblies and resources of a managed code application. This managed code application must be run within the Silverlight 2 browser plug-in.

Visit http://forums.asp.net/t/1277554.aspx for complete details.



What is the use of ClientBin folder?

ClientBin folder is used to place the .xap file of Silverlight application. You can keep this anywhere in your web application but this is the default that is used by the Silverlight.


What is the parent xaml tag of Silverlight page?

UserControl is the parent xaml tag of the Silverlight page. All other tags are placed under UserControl tag.



xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

Width="400" Height="300">









How to change the default page of the Silverlight application?



To change the default page of Silverlight application, you need to set the RootVisual property inside the Application_Startup even of App.xaml file.

private void Application_Startup(object sender, StartupEventArgs e)

{

this.RootVisual = new YourPage();

}

Or if not then you can just specify by right clicking on the page and choose the option as "Set as startup page"



When you create a new project in Silverlight through Visual Studio, how many xaml files are created and what are the uses of those files?


When we create a Silverlight application from Visual Studio, two (2) xaml files are created into the Silverlight project.

They are:

1. App.xaml - App.xaml is a file used to declare shared resources like brushes, various style objects etc. and to handle the global application level event (this is almost similar to global.asax file in asp.net application). By default following events are created in the App.xaml.cs file.

Application_Startup

Application_Exit

Application_UnhandledException

ReportErrorToDOM



2. MainPage.xaml or Page.xaml - This page is the default page of the Silverlight application and when the silverlight application runs this becomes the default page to appear (this page is like the default.aspx page of asp.net application)



Which programming language can be used to write the backend of the Silverlight application?


We can either use Visual C# or Visual Basic to code the backend of the silverlight application. Here backend means the code behind files for the Sivlerlight pages. In fact Ruby,Python can also be used for backend of a silverlight application.


Which language is used to design the layout in Silverlight?


To design the layout of the Silverlight application, XAML language is used. Extensible Application Markup Language (XAML, pronounced zammel [ˈzæmɫ̩]) is a declarative XML-based language created by Microsoft which is used as a user interface markup language to define UI elements, data binding, eventing, and other features.



How to set Silverlight contents width as 100%?

Generally you can't set the UserControl width in % like 100% so that the Silverlight contents can spread in the full screen. To get the 100% width of the screen you can set width="auto" and height="auto".


Can you provide a list of Layout Management Panels and when you will use them?

Canvas Panel:

use a canvas for simple layouts and when there is no need to resize panel. Controls can overlapped each other when resizing the panel.


Stack Panel:

use this for grouping controls in a stack (horizontal/vertical). Controls do not overlapped.



Grid Panel:

most flexible, multi row/columns layouts. Similar to a HTML table



How can style elements be applied? (similar to a CSS file/skins)

Styles elements are supported in the form of application resources. An app.xaml file can be created containing an application resource Xml construct. The target type for each style is set to the control on which the style needs to be applied.


App.xaml:







Page.xaml:



...




Is ADO.NET objects supported in Silverlight Project?

No, Silverlight project doesn't support normal ADO.NET objects like DataTable, DataSet, DataColumn, Database connection providers like SqlConnection, OledbConnection objects.

You can use System.Data namespace but that contains Services related stuffs not ADO.NET stuffs.



What is contained in the AppManifest.xaml file in silverlight?

The AppManifest.xaml file contains the deployment details needed to run the silverlight application.



How does Silverlight 2 differ from Adobe Flash?

In .Net background so in my views you can get C# / Vb.net compiled code but in Flash there is only action script.

You can find difference in depth at : http://silverlight.net/forums/t/3015.aspx

SSIS interview questions

1. What is SSIS?

ANS: SQL Server Integration Services (SSIS), a component of Microsoft SQL Server, is a platform for data integration and workflow applications


2. SSIS full form?

ANS: SQL Server Integration Services


3. Use of SSIS?

ANS: It features a fast and flexible data warehousing tool used for data extraction, transformation, and loading (ETL). The tool may also be used to automate maintenance of SQL Server databases and updates to multidimensional cube data.

4. When was SSIS released?

ANS: First released with Microsoft SQL Server 2005, SSIS replaced Data Transformation Services, which had been a feature of SQL Server since Version 7.0. Unlike DTS, which was included in all versions, SSIS is only available in the "Standard" and "Enterprise" editions.


5. Which is NOT a method that you can use to configure package configurations in SSIS packages?

ANS: HKEY_LOCAL_MACHINE hive in the windows Registry



6. You are using SSIS to import a plain text file to SQL Server. You have found that some text files do not have a standard format. For example, the last field order date does not exist for some records. What is the best method you should use to import this file to SQL Server?

ANS: Use a flat file connection and Transformation option of the script component. The use some code gets the order date



7. What is the measure you need to use to measure similarity between a set of values in a Fuzzy Lookup?

ANS: _Similarity



8. What is the connection manager you should use to import an Excel 2007 file into SQL Server using SSIS?

ANS: Microsoft Office 12.0 Access Database Engine OLE DB Provider with Extended property set to Excel 12.0



9. Which is the slowly changing dimension method that you can't us in a data flow task in SSIS?

ANS: Type 3 dimensions



10. What is the data flow transformation that needs a sorted data stream?

ANS: Merge Join


11. What is a Checkpoint Restart?

ANS: Data flow tasks and Control flow define restart points



12. How you can send HTML email messages from SSIS?

ANS: Using a script control task



13. How can you set the value 2007-08-21 02:00 AM in a SSIS variable?

ANS: Define the date time variable and pass it to a script component and add time component



14. State some of the SSIS tasks available?

ANS: Some of the tasks available in SSIS are:

o Data Flow Task

o Data Preparation Tasks

o File System Tasks

o SQL Server Tasks



15. In SQL Server 2005 Integration Services, if you want to import a flat file very quickly that contains only integer data, what type of parsing should you use?

ANS: Fast Parse: The fast parse mode that is set on columns for a flat file source connection can import a limited set of data types extremely quickly.



16. How do you deploy SSIS packages?

ANS: There are two steps in the package deployment process:

o The first step is to build the Integration Services project to create a package deployment utility.

o The second step is to copy the deployment folder that was created when you built the Integration Services project to the target computer, and then run the Package Installation Wizard to install the packages.



17. What is error flow redirection?

ANS: If an error happens in ETL process in SSIS package, instead of letting failures stop package execution, it is good practice to configure and handle potential processing errors as they occur within the transformation. While you might choose to ignore failures to ensure your package runs successfully, it is often better to redirect the failed row to another processing path where the data and the error can be persisted, examined and reprocessed at a later time.



18. How do you store package configurations?

ANS: Package configurations let you set run-time properties and variables from outside of the development environment. Configurations allow you to develop packages that are flexible and easy to both deploy and distribute. Microsoft SQL Server 2005 Integration Services offers the following configuration types: 1. XML configuration file 2.Environment variable 3.Registry entry 4.Parent package variable 5.SQL Server table


19. What does a control flow do?

ANS: A control flow manages the workflow of the package. Pretty self-explanatory it controls the flow of how the package is run. Sorry to use the words control flow in the definition, but this is a real easy one.


20. Generically explain what happens inside a data flow task?

ANS: It moves data from nearly any source, performs different transforms to the data, and then sends to nearly any destination.


21. ETL full form?

ANS: Extract, Transform, and Load

22. Explain what ETL is?

ANS: Extract, Transform, and Load. Basically pulls the data from a location, change/transforms the data somehow, and then loads it in a new location.



23. Which task would you use to copy, move or delete files?

ANS: File System Task

24. Which transform would you use to split your data based on conditions you define?

ANS: Conditional Split

25. Explain what breakpoints?

ANS: Breakpoints put pauses in your package. It’s a great tool for debugging a package because you can place a breakpoint on a task and it will pause the package based on execution events.

26. Why we use Break points?

ANS: A reason to use breakpoints is when we have a looping container and we want to see how my variables are changed by the loop. We would place a watch window on the package and type the variable name in. Set a break point on the container to stop after each iteration of the loop.



27. SSIS features a wizard what does it do?

ANS: That lets users to create packages which moves data from a single data source to a destination with no transformations.


28. Explain Import/Export Wizard.

ANS: The Wizard is appropriate for use to quickly move data into or out of SQL Server from or to a variety of sources, including text files and other SQL Server instances.

29. Developers tasked with creating or maintaining SSIS packages use a visual development tool based on Microsoft Visual Studio called?

ANS: The SQL Server Business Intelligence Development Studio (BIDS).
30. What is BIDS?

ANS: Server Business Intelligence Development Studio

sql server interview questions 1

1. What is RDBMS?

 ANS: Relational Data Base Management Systems (RDBMS) are database management systems that maintain data records and indices in tables. Relationships may be created and maintained across and among the data and tables. In a relational database, relationships between data items are expressed by means of tables. Interdependencies among these tables are expressed by data values rather than by pointers. This allows a high degree of data independence. An RDBMS has the capability to recombine the data items from different files, providing powerful tools for data usage.

2. What are the properties of the Relational tables?

ANS: Relational tables have six properties:

1. Values are atomic.

2. Column values are of the same kind.

3. Each row is unique.

4. The sequence of columns is insignificant.

5. The sequence of rows is insignificant.

6. Each column must have a unique name.

3. What are different normalization forms?

 ANS: 1NF, 2NF, 3NF, BCNF (Boyce Codd Normal Form), 4NF, 5NF, ONF and DKNF.

4. What is Stored Procedure?

 ANS: A stored procedure is a named group of SQL statements that have been previously created and stored in the server database. Stored procedures accept input parameters so that a single procedure can be used over the network by several clients using different input data. And when the procedure is modified, all clients automatically get the new version. Stored procedures reduce network traffic and improve performance. Stored procedures can be used to help ensure the integrity of the database. e.g. sp_helpdb, sp_renamedb, sp_depends etc.

5. What is Trigger?

ANS: A trigger is a SQL procedure that initiates an action when an event (INSERT, DELETE or UPDATE) occurs. Triggers are stored in and managed by the DBMS. Triggers are used to maintain the referential integrity of data by changing the data in a systematic fashion. A trigger cannot be called or executed; DBMS automatically fires the trigger as a result of a data modification to the associated table. Triggers can be viewed as similar to stored procedures in that both consist of procedural logic that is stored at the database level.

6. What is Nested Trigger?

 ANS: A trigger can also contain INSERT, UPDATE and DELETE logic within itself, so when the trigger is fired because of data modification it can also cause another data modification, thereby firing another trigger. A trigger that contains data modification logic within itself is called a nested trigger.

7. What is View?

ANS: A simple view can be thought of as a subset of a table. It can be used for retrieving data, as well as updating or deleting rows. Rows updated or deleted in the view are updated or deleted in the table the view was created with. It should also be noted that as data in the original table changes, so does data in the view, as views are the way to look at part of the original table. The results of using a view are not permanently stored in the database.

8. What is a Linked Server?

ANS: Linked Servers is a concept in SQL Server by which we can add other SQL Server to a Group and query both the SQL Server dbs using T‐SQL Statements. With a linked server, you can create very clean, easy to follow, SQL statements that allow remote data to be retrieved, joined and combined with local data. Stored Procedure sp_addlinkedserver, sp_addlinkedsrvlogin will be used add new Linked Server

9. What is Collation?

 ANS: Collation refers to a set of rules that determine how data is sorted and compared. Character data is sorted using rules that define the correct character sequence, with options for specifying case sensitivity, accent marks, kana character types and character width.

10. What is Difference between Function and Stored Procedure?

ANS: UDF can be used in the SQL statements anywhere in the WHERE/HAVING/SELECT section where as Stored procedures cannot be. UDFs that return tables can be treated as another rowset. This can be used in JOINs with other tables. Inline UDF's can be thought of as views that take parameters and can be used in JOINs and other Rowset operations.

11. What are different Types of Join?

 ANS: There are four types.

1. Cross Join

2. Inner Join

3. Outer Join (Left Outer Join, Right Outer Join and Full Outer Join)

4. Self Join

12. What are primary keys and foreign keys?

ANS: Primary keys are the unique identifiers for each row. They must contain unique values and cannot be null. Due to their importance in relational databases, Primary keys are the most fundamental of all keys and constraints. A table can have only one Primary key. Foreign keys are both a method of ensuring data integrity and a manifestation of the relationship between tables.

13. What is Identity?

 ANS: Identity (or AutoNumber) is a column that automatically generates numeric values. A start and increment value can be set, but most DBA leave these at 1. A GUID column also generates numbers; the value of this cannot be controlled. Identity/GUID columns do not need to be indexed.

14. Which TCP/IP port does SQL Server run on? How can it be changed?

 ANS: SQL Server runs on port 1433. It can be changed from the Network Utility TCP/IP properties –> Port number, both on client and the server.

15. What is OLTP (Online Transaction Processing)?

ANS: In OLTP online transaction processing systems relational database design use the discipline of data modeling and generally follow the Codd rules of data normalization in order to ensure absolute data integrity. Using these rules complex information is broken down into its most simple structures (a table) where all of the individual atomic level elements relate to each other and satisfy the normalization rules.

16. When is the use of UPDATE_STATISTICS command?

ANS: This command is basically used when a large processing of data has occurred. If a large amount of deletions any modification or Bulk Copy into the tables has occurred, it has to update the indexes to take these changes into account. UPDATE_STATISTICS updates the indexes on these tables accordingly.

17. What is the difference between a HAVING CLAUSE and a WHERE CLAUSE?

ANS: They specify a search condition for a group or an aggregate. But the difference is that HAVING can be used only with the SELECT statement. HAVING is typically used in a GROUP BY clause. When GROUP BY is not used, HAVING behaves like a WHERE clause. Having Clause is basically used only with the GROUP BY function in a query whereas WHERE Clause is applied to each row before they are part of the GROUP BY function in a query.

18. What are the properties of Sub-Queries?

ANS:

1. A sub query must be enclosed in the parenthesis.

2. A sub query must be put in the right hand of the comparison operator, and

3. A sub query cannot contain an ORDER‐BY clause.

4. A query can contain more than one sub query.

19. What are different Types of Sub-Queries?

 ANS:

1. Single‐row sub-query, where the sub‐query returns only one row.

2. Multiple‐row sub-query, where the sub‐query returns multiple rows,. and

3. Multiple column sub-query, where the sub‐query returns multiple columns

20. What is SQL Profiler?

ANS: SQL Profiler is a graphical tool that allows system administrators to monitor events in an instance of Microsoft SQL Server. You can capture and save data about each event to a file or SQL Server table to analyze later.

21. What are the authentication modes in SQL Server? How can it be changed?

ANS: Windows mode and Mixed Mode ‐ SQL & Windows. To change authentication mode in SQL Server click Start, Programs, Microsoft SQL Server and click SQL Enterprise Manager to run SQL Enterprise Manager from the Microsoft SQL Server program group. Select the server then from the Tools menu select SQL Server Configuration Properties, and choose the Security page.

22. Which command using Query Analyzer will give you the version of SQL server and operating system?
ANS: SELECT SERVERPROPERTY ('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition').

23. What is SQL Server Agent?

ANS: SQL Server agent plays an important role in the day‐to‐day tasks of a database administrator (DBA). It is often overlooked as one of the main tools for SQL Server management. Its purpose is to ease the implementation of tasks for the DBA, with its full‐function scheduling engine, which allows you to schedule your own jobs and scripts.

24. What is Log Shipping?

ANS: Log shipping is the process of automating the backup of database and transaction log files on a production SQL server, and then restoring them onto a standby server. Enterprise Editions only supports log shipping. In log shipping the transactional log file from one server is automatically updated into the backup database on the other server. If one server fails, the other server will have the same db and can be used this as the Disaster Recovery plan. The key feature of log shipping is that it will automatically backup transaction logs throughout the day and automatically restore them on the standby server at defined interval.

25. Name 3 ways to get an accurate count of the number of records in a table?

 ANS:

1. SELECT * FROM table1

2. SELECT COUNT(*) FROM table1

3. SELECT rows FROM sysindexes WHERE id = OBJECT_ID(table1) AND indid < 2

26. What does it mean to have QUOTED_IDENTIFIER ON? What are the implications of having it OFF?

ANS: When SET QUOTED_IDENTIFIER is ON, identifiers can be delimited by double quotation marks, and literals must be delimited by single quotation marks. When SET QUOTED_IDENTIFIER is OFF, identifiers cannot be quoted and must follow all Transact‐SQL rules for identifiers.

27. What is the difference between a Local and a Global temporary table?

ANS: A local temporary table exists only for the duration of a connection or, if defined inside a compound statement, for the duration of the compound statement. A global temporary table remains in the database permanently, but the rows exist only within a given connection. When connection is closed, the data in the global temporary table disappears. However, the table definition remains with the database for access when database is opened next time.

28. What is BCP? When does it used?

 ANS: BulkCopy is a tool used to copy huge amount of data from tables and views. BCP does not copy the structures same as source to destination. BULK INSERT command helps to import a data file into a database table or view in a user‐specified format.

29. What is CHECK Constraint?

 ANS: A CHECK constraint is used to limit the values that can be placed in a column. The check constraints are used to enforce domain integrity.

C# Interview Questions

1. C# was developed by

ANS: Microsoft

2. What is C#?

ANS: Programming Language

3. How do you inherit from a class in C#?

ANS: Place a colon and then the name of the base class. Notice that it’s double colon in C++.

4. Does C# support multiple inheritances?

ANS: No, uses interfaces instead.

5. When you inherit a protected class-level variable, who is it available to?

ANS: Classes in the same namespace.

6. Are private class-level variables inherited?

ANS: Yes, but they are not accessible, so looking at it you can honestly say that they are not inherited.

7. Describe the accessibility modifier protected internal.

ANS: It’s available to derived classes and classes within the same Assembly.

8. C# provides a default constructor for me. I write a constructor that takes a string as a parameter, but want to keep the no parameter one. How many constructors should I write?

ANS: Two. Once you write at least one constructor, C# cancels the freebie constructor, and now you have to write one yourself, even if there’s no implementation in it.

9. What’s the top .NET class that everything is derived from?

ANS: System. Object.

10. How’s method overriding different from overloading?

ANS: When overriding, you change the method behavior for a derived class. Overloading simply involves having a method with the same name within the class.

11. What does the keyword virtual mean in the method definition?
ANS: The method can be over-ridden.

12. Can you declare the override method static while the original method is non-static?

ANS: No, you can’t, the signature of the virtual method must remain the same, only the keyword virtual is changed to keyword override.

13. Can you override private virtual methods?

ANS: No, moreover, you cannot access private methods in inherited classes, have to be protected in the base class to allow any sort of access.


14. Can you prevent your class from being inherited and becoming a base class for some other classes?

ANS: Yes, that’s what keyword sealed in the class definition is for. The developer trying to derive from your class will get a message: cannot inherit from sealed class Whatever Base Class Name. It’s the same concept as final class in Java.


15. Can you allow class to be inherited, but prevent the method from being over-ridden?

ANS: Yes, just leave the class public and make the method sealed.

16. What’s an abstract class?

ANS: A class that cannot be instantiated. A class that must be inherited and have the methods over-ridden. Essentially, it’s a blueprint for a class without any implementation.

17. When do you absolutely have to declare a class as abstract?

ANS: When at least one of the methods in the class is abstract. When the class itself is inherited from an abstract class, but not all base abstract methods have been over-ridden.

18. What’s an interface class?

ANS: It’s an abstract class with public abstract methods all of which must be implemented in the inherited classes.

19. Why can’t you specify the accessibility modifier for methods inside the interface?

ANS: They all must be public.


20. And if they have conflicting method names?

ANS: This might cause a problem on a higher-level scale if similarly named methods from different interfaces expect different data, but as far as compiler cares you’re okay.


21. What’s the difference between an interface and abstract class?

ANS: In the interface all methods must be abstract; in the abstract class some methods can be concrete. In the interface no accessibility modifiers are allowed, which is ok in abstract classes.

22. How can you overload a method?

ANS: Different parameter data types, different number of parameters, different order of parameters.


23. If a base class has a bunch of overloaded constructors, and an inherited class has another bunch of overloaded constructors, can you enforce a call from an inherited constructor to an arbitrary base constructor?

ANS: Yes, just place a colon and then keyword base in the overloaded constructor definition inside the inherited class.


24. What’s the difference between System.String and System.StringBuilder classes?

ANS: System.String is immutable; System.StringBuilder was designed with the purpose of having a mutable string where a variety of operations can be performed.


25. What’s the advantage of using System.Text.StringBuilder over System.String?

ANS: String Builder is more efficient in the cases, where a lot of manipulation is done to the text. Strings are immutable, so each time it’s being operated on, a new instance is created.


26. What’s the difference between the System.Array.CopyTo () and System.Array.Clone ()?

ANS: The first one performs a deep copy of the array, the second one is shallow.


27. How can you sort the elements of the array in descending order?

ANS: By calling Sort () and then Reverse () methods.
28. What’s the C# equivalent of C++ catch (…), which was a catch-all statement for any possible exception?

ANS: A catch block that catches the exception of type System. Exception. You can also omit the parameter data type in this case and just write catch {}.


29. Can multiple catch blocks be executed?

ANS: No, once the proper catch code fires off, the control is transferred to the finally block (if there are any), and then whatever follows the finally block.

30. What’s a delegate?
ANS: A delegate object encapsulates a reference to a method. In C++ they were referred to as function pointers.

Tuesday, January 26, 2010

Adding YouTube Videos to Your BlogSpot Blog

Do you want to embed a video from YouTube.com to share it with your visitors through your BlogSpot blogs, it is pretty easy to do that.
1- Choose your favorite video from YouTube.com.

2- At the left, you will see a code which titled by "Embedded".

3- Copy the code and add it to your post through the HTML window "Not compose window".

4- Add your comment on that video and publish the post.



That is all, happy blogging

Dealing with blog title.

For people who have a blog at Blogger.com, you always see the titles of the posts are in very bad order where the blog name comes before the post name, like this:

Blog Name: Post Title.

This order is very bad for both visitors and search engines, so you need to change the order of post titles to get the post title come first to be like this:

Post Title - Blog Title. You can observe this good order here in my blog.

To change the order of post titles, just make the following:

1- Open your Blogger Dashboard.

2- Go to "Layout" >> "Edit HTML".

3- Find this code at the beginning of the template HTM:


Replace it with this code:


4- Save your new template and enjoy the new SEO optimized post titles.

Free Blog Posts

You are welcome to publish any number of posts here in itsfuntolive blog, my blog is  doing very well with Google search engines. You can get rank one in Google for any long tail keyword.

By adding a link to your website, blog, landing page ..etc, you will receive very targeted traffic. If you do affiliate marketing, Google Adsense, Blogging and need some good traffic, just publish you posts here.

Submission Guidelines:

1- Your post must be at least 200 words.

2- It mustn't be published in any other place.

3- You can add only one external link.

4- Your post must be in proper spelling and grammar English.



You can send your post through this Email:
ngkumar1985@gmail.com

Importance of fun in life

Life is full of tensions of all kinds. Modern living has become quite stressful, making it necessary for people to find some time to have fun.
As people grow in their personal and professional life, their responsibilities grow and they become tense. The modern day life demands a lot on our physical, mental and emotional resources. You need to be alert all the time to achieve your goals in life.
Personal life can induce stress for lots of people. Relationships, if not working out, can be stressful for people. Many young people suffer in romantic relationships. Even married couples go through lots of mental pain if they have to go through the whole process of divorce. Young people, who do not have any relationship with the apposite sex, feel lonely and may become stressful. Old people in their retirement age feel alone and anxious if there is no one to look after them.
Professional life can make people go through lots of emotional disturbances. When a man loses his job he becomes worried about his financial support. A person without money can face lots of trouble. Working in some companies can be stressful. There are tensions related to raise, promotion, job security, etc. Internal politics in a company may also make your stressed out.
As seen recently, any economic recession at a large scale can bring in lots of misery to a large number of people worldwide. More than a million people lost their jobs in the recent economic recession in 2008. The recession had less impact in the fast growing markets like Indian and China, but in developed countries it had more impact.
It is important to relax yourself in the tense world. If you get too much stressed in life find some time to enjoy yourself. Find some excuse to rewind yourself. Go to a bar, theater or just have fun with your family members.

How To Handle A Heckler



Till now this is the best way to handle a heckler check it out