Get benefited from interview Q/A and Online Test section. Subscribe to this blog to get updates directly in your mail box.
Best View in Google Crome, Mozilla firefox or IE 7 or above
Showing posts with label Dotnet Basics. Show all posts
Showing posts with label Dotnet Basics. Show all posts

Sunday, April 6, 2014

Difference between constructor and method in c#

This is a very basic question mainly asked in Beginner level interviews (1 to 2 years of experience).
The interviewer can twist the question as below as well.


  • Difference between method and constructor in c#
  • Difference between constructor and method in dotnet with example
  • Difference between methods and constructors in object oriented programming


Answer:

Here are few differences between Constructor and methods in bullet points.


Constructor:
1. Name of constructor should be same as class name
2. Constructor is used to initialize class members (variables). It is used to create an instance of  a class.
3. Returns nothing. Hence no return type.
4. Called implicitly at the time of object creation


Method:
1. Name is independent from class name
2. Method is having some functionality. It is used to perform some operations.
3. Must return something. If nothing to return, explicitly return type should be void.
4. Need to be called explicitly


Tuesday, February 12, 2013

What are the commonly used classes in System.Data.SqlClient?



Here are the commonly used classes in System.Data.SqlClient:

SqlCommand:
Represents a Transact-SQL statement or stored procedure to execute against a SQL Server database.

SqlCommandBuilder:
Automatically generates single-table commands used to reconcile changes made to a DataSet with the associated SQL Server database.

SqlConnection:
Represents an open connection to a SQL Server database.

SqlDataAdapter:
Represents a set of data commands and a database connection that are used to fill the DataSet and update a SQL Server database.

SqlDataReader:
Provides a means of reading a forward-only stream of rows from a SQL Server database.

SqlTransaction:
Represents a Transact-SQL transaction to be made in a SQL Server database.

For more ADO.Net Interview Questions, click here.




What is the Namespace for using SQL Server database in Dotnet Application?

System.Data.SqlClient namespace is the .NET Framework Data Provider for SQL Server.

The .NET Framework Data Provider for SQL Server describes a collection of classes used to access a SQL Server database in the managed space. Using the SqlDataAdapter, you can fill a memory-resident DataSet, which you can use to query and update the database.

For the commonly used classes in System.Data.SqlClient, click here.

For more ADO.Net Interview Questions, click here.

Monday, December 26, 2011

How to Learn Dotnet Basics?

This article is intended for Students, freshers or experienced professionals who want to learn dotnet as beginners.

Classroom training in Dotnet:

To get started and familiarize with Dotnet Tools and Techniques , a classroom training in dotnet is very helpful. You can learn many things in a short span of time. So, enroll yourself in a good Dotnet training programme.

Online tutorials:

There are many useful websites that guides you with Dotnet step by step tutorials, examples etc. There are also a lot of dotnet videos tutorials available in the internet.

Here are some useful websites to get started:
http://www.asp.net/web-forms/tutorials
http://www.asp.net/web-forms/videos
http://www.dotnetspider.com/tutorials
http://www.w3schools.com
http://asp.net-tutorials.com
http://www.csharp-station.com/Tutorial/

There are many more useful websites on Dotnet tutorials. If you come across a good website, do share in comments.

Books:

.Net Programming Black Book
Microsoft Press books
Wrox Publication

  © Blogger templates Shiny by Ourblogtemplates.com 2008

Back to TOP