Complete Information on .Net Assemblies working in the form of FAQ.
- .NET Assembly FAQ - Part 1
- .NET Assembly FAQ - Part 2 - Attributes
- .Net Assembly FAQ - Part 3- Strong Name and Signing
- .NET Assembly FAQ - Part 4 - Global Assembly Cache
You will find discussion topics for ASP.net, C#, JQuery, AJAX, SQL, VB.net, .Net Framework, WCF, WPF, WWF, WSS 3.0, MOSS 2007, OOPs Concepts, SQL Server, Programming.
Complete Information on .Net Assemblies working in the form of FAQ.
SQL Optimization Tips
• Use views and stored procedures instead of heavy-duty queries.
This can reduce network traffic, because your client will send to
server only stored procedure or view name (perhaps with some
parameters) instead of large heavy-duty queries text. This can be used
to facilitate permission management also, because you can restrict
user access to table columns they should not see.
• Try to use constraints instead of triggers, whenever possible.
Constraints are much more efficient than triggers and can boost
performance. So, you should use constraints instead of triggers,
whenever possible.
• Use table variables instead of temporary tables.
Table variables require less locking and logging resources than
temporary tables, so table variables should be used whenever possible.
The table variables are available in SQL Server 2000 only.
• Try to use UNION ALL statement instead of UNION, whenever possible.
The UNION ALL statement is much faster than UNION, because UNION ALL
statement does not look for duplicate rows, and UNION statement does
look for duplicate rows, whether or not they exist.
• Try to avoid using the DISTINCT clause, whenever possible.
Because using the DISTINCT clause will result in some performance
degradation, you should use this clause only when it is necessary.
• Try to avoid using SQL Server cursors, whenever possible.
SQL Server cursors can result in some performance degradation in
comparison with select statements. Try to use correlated sub-query or
derived tables, if you need to perform row-by-row operations.
• Try to avoid the HAVING clause, whenever possible.
The HAVING clause is used to restrict the result set returned by the
GROUP BY clause. When you use GROUP BY with the HAVING clause, the
GROUP BY clause divides the rows into sets of grouped rows and
aggregates their values, and then the HAVING clause eliminates
undesired aggregated groups. In many cases, you can write your select
statement so, that it will contain only WHERE and GROUP BY clauses
without HAVING clause. This can improve the performance of your query.
• If you need to return the total table's row count, you can use
alternative way instead of SELECT COUNT(*) statement.
Because SELECT COUNT(*) statement make a full table scan to return the
total table's row count, it can take very many time for the large
table. There is another way to determine the total row count in a
table. You can use sysindexes system table, in this case. There is
ROWS column in the sysindexes table. This column contains the total
row count for each table in your database. So, you can use the
following select statement instead of SELECT COUNT(*): SELECT rows
FROM sysindexes WHERE id = OBJECT_ID('table_name') AND indid < 2 So,
you can improve the speed of such queries in several times.
• Include SET NOCOUNT ON statement into your stored procedures to stop
the message indicating the number of rows affected by a T-SQL statement.
This can reduce network traffic, because your client will not receive
the message indicating the number of rows affected by a T-SQL statement.
• Try to restrict the queries result set by using the WHERE clause.
This can results in good performance benefits, because SQL Server will
return to client only particular rows, not all rows from the table(s).
This can reduce network traffic and boost the overall performance of
the query.
• Use the select statements with TOP keyword or the SET ROWCOUNT
statement, if you need to return only the first n rows.
This can improve performance of your queries, because the smaller
result set will be returned. This can also reduce the traffic between
the server and the clients.
• Try to restrict the queries result set by returning only the
particular columns from the table, not all table's columns.
This can results in good performance benefits, because SQL Server will
return to client only particular columns, not all table's columns.
This can reduce network traffic and boost the overall performance of
the query.
1.Indexes
2.avoid more number of triggers on the table
3.unnecessary complicated joins
4.correct use of Group by clause with the select list
5 In worst cases Denormalization
Index Optimization tips
• Every index increases the time in takes to perform INSERTS, UPDATES
and DELETES, so the number of indexes should not be very much. Try to
use maximum 4-5 indexes on one table, not more. If you have read-only
table, then the number of indexes may be increased.
• Keep your indexes as narrow as possible. This reduces the size of
the index and reduces the number of reads required to read the index.
• Try to create indexes on columns that have integer values rather
than character values.
• If you create a composite (multi-column) index, the order of the
columns in the key are very important. Try to order the columns in the
key as to enhance selectivity, with the most selective columns to the
leftmost of the key.
• If you want to join several tables, try to create surrogate integer
keys for this purpose and create indexes on their columns.
• Create surrogate integer primary key (identity for example) if your
table will not have many insert operations.
• Clustered indexes are more preferable than nonclustered, if you need
to select by a range of values or you need to sort results set with
GROUP BY or ORDER BY.
• If your application will be performing the same query over and over
on the same table, consider creating a covering index on the table.
• You can use the SQL Server Profiler Create Trace Wizard with
"Identify Scans of Large Tables" trace to determine which tables in
your database may need indexes. This trace will show which tables are
being scanned by queries instead of using an index.
• You can use sp_MSforeachtable undocumented stored procedure to
rebuild all indexes in your database. Try to schedule it to execute
during CPU idle time and slow production periods.
sp_MSforeachtable @command1="print '?' DBCC DBREINDEX ('?')"
For SQL SERVER Frequently Asked Interview Questions
SQL Server FAQ Interview Questions
SQL Queries FAQ
T-SQL Queries
1. 2 tables
Employee Phone
empid
empname
salary
mgrid empid
phnumber
2. Select all employees who doesn't have phone?
SELECT empname
FROM Employee
WHERE (empid NOT IN
(SELECT DISTINCT empid
FROM phone))
3. Select the employee names who is having more than one phone numbers.
SELECT empname
FROM employee
WHERE (empid IN
(SELECT empid
FROM phone
GROUP BY empid
HAVING COUNT(empid) > 1))
4. Select the details of 3 max salaried employees from employee table.
SELECT TOP 3 empid, salary
FROM employee
ORDER BY salary DESC
5. Display all managers from the table. (manager id is same as emp id)
SELECT empname
FROM employee
WHERE (empid IN
(SELECT DISTINCT mgrid
FROM employee))
6. Write a Select statement to list the Employee Name, Manager Name
under a particular manager?
SELECT e1.empname AS EmpName, e2.empname AS ManagerName
FROM Employee e1 INNER JOIN
Employee e2 ON e1.mgrid = e2.empid
ORDER BY e2.mgrid
7. 2 tables emp and phone.
emp fields are - empid, name
Ph fields are - empid, ph (office, mobile, home). Select all employees
who doesn't have any ph nos.
SELECT *
FROM employee LEFT OUTER JOIN
phone ON employee.empid = phone.empid
WHERE (phone.office IS NULL OR phone.office = ' ')
AND (phone.mobile IS NULL OR phone.mobile = ' ')
AND (phone.home IS NULL OR phone.home = ' ')
8. Find employee who is living in more than one city.
Two Tables:
Salary
SELECT empname, fname, lname
FROM employee
WHERE (empid IN
(SELECT empid
FROM city
GROUP BY empid
HAVING COUNT(empid) > 1))
9. Find all employees who is living in the same city. (table is same
as above)
SELECT fname
FROM employee
WHERE (empid IN
(SELECT empid
FROM city a
WHERE city IN
(SELECT city
FROM city b
GROUP BY city
HAVING COUNT(city) > 1)))
10. There is a table named MovieTable with three columns - moviename,
person and role. Write a query which gets the movie details where Mr.
Amitabh and Mr. Vinod acted and their role is actor.
SELECT DISTINCT m1.moviename
FROM MovieTable m1 INNER JOIN
MovieTable m2 ON m1.moviename = m2.moviename
WHERE (m1.person = 'amitabh' AND m2.person = 'vinod' OR
m2.person = 'amitabh' AND m1.person = 'vinod') AND (m1.role = 'actor')
AND (m2.role = 'actor')
ORDER BY m1.moviename
11. There are two employee tables named emp1 and emp2. Both contains
same structure (salary details). But Emp2 salary details are incorrect
and emp1 salary details are correct. So, write a query which corrects
salary details of the table emp2
update a set a.sal=b.sal from emp1 a, emp2 b where a.empid=b.empid
12. Given a Table named "Students" which contains studentid, subjectid
and marks. Where there are 10 subjects and 50 students. Write a Query
to find out the Maximum marks obtained in each subject.
13. In this same tables now write a SQL Query to get the studentid
also to combine with previous results.
14. Three tables – student , course, marks – how do go @ finding name
of the students who got max marks in the diff courses.
SELECT student.name, course.name AS coursename, marks.sid, marks.mark
FROM marks INNER JOIN
student ON marks.sid = student.sid INNER JOIN
course ON marks.cid = course.cid
WHERE (marks.mark =
(SELECT MAX(Mark)
FROM Marks MaxMark
WHERE MaxMark.cID = Marks.cID))
15. There is a table day_temp which has three columns dayid, day and
temperature. How do I write a query to get the difference of
temperature among each other for seven days of a week?
SELECT a.dayid, a.dday, a.tempe, a.tempe - b.tempe AS Difference
FROM day_temp a INNER JOIN
day_temp b ON a.dayid = b.dayid + 1
OR
Select a.day, a.degree-b.degree from temperature a, temperature b
where a.id=b.id+1
16. There is a table which contains the names like this. a1, a2, a3,
a3, a4, a1, a1, a2 and their salaries. Write a query to get grand
total salary, and total salaries of individual employees in one query.
SELECT empid, SUM(salary) AS salary
FROM employee
GROUP BY empid WITH ROLLUP
ORDER BY empid
17. How to know how many tables contains empno as a column in a database?
SELECT COUNT(*) AS Counter
FROM syscolumns
WHERE (name = 'empno')
18. Find duplicate rows in a table? OR I have a table with one column
which has many records which are not distinct. I need to find the
distinct values from that column and number of times it's repeated.
SELECT sid, mark, COUNT(*) AS Counter
FROM marks
GROUP BY sid, mark
HAVING (COUNT(*) > 1)
19. How to delete the rows which are duplicate (don't delete both
duplicate records).
SET ROWCOUNT 1
DELETE yourtable
FROM yourtable a
WHERE (SELECT COUNT(*) FROM yourtable b WHERE b.name1 = a.name1 AND
b.age1 = a.age1) > 1
WHILE @@rowcount > 0
DELETE yourtable
FROM yourtable a
WHERE (SELECT COUNT(*) FROM yourtable b WHERE b.name1 = a.name1 AND
b.age1 = a.age1) > 1
SET ROWCOUNT 0
20. How to find 6th highest salary
SELECT TOP 1 salary
FROM (SELECT DISTINCT TOP 6 salary
FROM employee
ORDER BY salary DESC) a
ORDER BY salary
21. Find top salary among two tables
SELECT TOP 1 sal
FROM (SELECT MAX(sal) AS sal
FROM sal1
UNION
SELECT MAX(sal) AS sal
FROM sal2) a
ORDER BY sal DESC
22. Write a query to convert all the letters in a word to upper case
SELECT UPPER('test')
23. Write a query to round up the values of a number. For example even
if the user enters 7.1 it should be rounded up to 8.
SELECT CEILING (7.1)
24. Write a SQL Query to find first day of month?
SELECT DATENAME(dw, DATEADD(dd, - DATEPART(dd, GETDATE()) + 1,
GETDATE())) AS FirstDay
Datepart Abbreviations
year yy, yyyy
quarter qq, q
month mm, m
dayofyear dy, y
day dd, d
week wk, ww
weekday dw
hour hh
minute mi, n
second ss, s
millisecond ms
25. Table A contains column1 which is primary key and has 2 values (1,
2) and Table B contains column1 which is primary key and has 2 values
(2, 3). Write a query which returns the values that are not common for
the tables and the query should return one column with 2 records.
SELECT a.col1
FROM a, b
WHERE a.col1 <>
(SELECT b.col1
FROM a, b
WHERE a.col1 = b.col1)
UNION
SELECT b.col1
FROM a, b
WHERE b.col1 <>
(SELECT a.col1
FROM a, b
WHERE a.col1 = b.col1)
26. There are 3 tables Titles, Authors and Title-Authors. Write the
query to get the author name and the number of books written by that
author, the result should start from the author who has written the
maximum number of books and end with the author who has written the
minimum number of books.
27.
UPDATE emp_master
SET emp_sal =
CASE
WHEN emp_sal > 0 AND emp_sal <= 20000 THEN (emp_sal * 1.01) WHEN emp_sal > 20000 THEN (emp_sal * 1.02)
END
For More SQL SERVER Frequently Asked Interview Questions
Collection of Differences which are frequently asked
How do i get .Net Job?
One of the Group member of dotnetguts@yahoogroups.com ask the question, How do i get ".Net Job", Well this again common question. Here are few tips for getting Jobs in .Net, "Asp.net Jobs", "C# Jobs", "Vb.net Jobs".
Step 1:
Get the required knowledge of technology in which you want a Job.
I suggest you to refer this post if you are "New to .Net"
Step 2:
Collect FAQs for .Net, C#, Asp.net, Vb.net
.Net FAQs Links Collection
Step 3:
Judge your status of expertise and make a comfortable list of FAQ, which you can prepare. While preparing question checklist for interview don't forget to mark questions bold, which you feel important, so that it will be helpful during last minute reference.
Step 4:
Now you have gather enough knowledge to appear for interview, so next step comes is presentation, You need to market yourself. You need to understand the needs of a firm you are going to target, and present yourself accordingly.
Here are Few "Interview Presentation" Tips
Step 5:
Apply for Jobs. Find Jobs at popular websites like "Naukri.com", "Monster.com", "Timesjob.com", now a days a popular media to find job is on blog, so find jobs @ "MyDailyJob.blogspot.com" and such blog. Make sure that you have an effective resume before you apply. Considerate each application as opportunity, remember "God help those who help themselves", so never make careless effort. Company should feel your interest, earness and willingness for Job.
Step 6:
On Interview day, Dress yourself decent, professional and in which you feel comfortable. Be on Time.
Step 7:
Prepare a Backup checklist. It is not possible for everyone to know everything and even interviewer know that, so Show the points which differentiates you from others.
Example of How to show your specialities
a) Show that you are willing to learn new things.
b) How best you can handle situation during tuff moment. ie. Don't loose temper during tuff situation.
c) What you do if you don't know something. ie. Tell them i use forum to get answer of my query, I have subscribe to following helpful groups, GOOGLE best way to search your any questions.
d) Your programming style. Interviewer might be a programmer and he is looking for someone who writes good code which easily manageable, so if possible do preapre a small checklist of your programming style and keep forward to them.
e) Show your extra efforts, certification or any good work.
Step 8:
Follow-up email., after completion of your interview it is necessary to send a Follow-up email thanking them, it will last a longer impression and will give chance to considerate among other candidates.
Step 9:
If After applying all your best, you didn't get job, so dear friend don't loose the hope, this is the time for making you internally stronger, say yourself that some "Good Opportunity is waiting for you". If possible try reading some motivation books or thoughts which will inspire you, and refill a new energy to work hard. "MyDailyFun.blogspot.com" contains Motivationa and Inspiration stories, so if you feel bit down cheerup yourself, and get back on work, because without effort no gain.
Good Luck
Tips for H1B Interview 1) What is .Net Platform? Microsoft .NET is a software development platform based on virtual machine architecture. Dot Net Platform is: Ã Language Independent – dot net application can be developed different languages (such as C#, VB, C++, etc.) Ã Platform Independent – dot net application can be run on any operating system which has .net framework installed. Ã Hardware Independent – dot net application can run on any hardware configuration It allows us to build windows based application, web based application, web service, mobile application, etc. 2) What is .Net Framework? .Net Framework provides a foundation upon which .net application and xml webservices are built and executed. 5) .Net Compliant Languages – Language which supports .Net Programming. Eg: VB, C#, C++, J#, etc. 6) .Net Application – Application which is developed using .Net Framework. 7) .Net Framework Class Library – It consist of thousands of Pre-developed classes that can be used to build application. 8) Common Language Specification (CLS) – It defines features that all .net compatible language should support. 9) Common Type System (CTS) – All .net supported languages will produce code that is ultimately based on these type. 10) Common Language Runtime (CLR) – It provides an “managed” environment in which .net application can execute. It provides following services : 1. Language Integration 2. Memory Management (Memory Allocation and Garbage Collection) 3. Memory Type Safety (Memory Leaks) 4. Security 11) Microsoft Intermediate Language (MSIL) An intermediate language generated by compiler is called MSIL. All .Net assemblies are represented in MSIL. The main Advantage of using MSIL is it provides equal performance for multiple language programming, as code is compiled to native code. Eg: Performance of application developed in C# is similar to VB.net or any other .Net compliant language that is because of MSIL. 12) Managed Environment Code that operates within the CLR is called managed code. Managed code benefits from the services that the CLR offers, including garbage collection, memory management, security, etc. 13) Unmanaged Environment Code that does not operate within the CLR is called unmanaged code. Unmanaged code does not get benefits offered by CLR including garbage collection, memory management, security, etc. Eg. COM components are unmanaged code. 14) Advantage provided by Dot Net Framework Language Independent, that is programmer can concentrate more on problem than to learn new language. What is ADO.net ADO.net is data access architecture for the Microsoft .NET Framework.
- Be Polite
- Take deep breath and Relax.
- Listen Carefully and Answer upto the point.
H1B Visa Interview FAQ
Interview
Good Morning
Why you want to go USA?
For Working.
Which company you are going?
Your company name
What is turnover of your present company and USA company?
$xxx,xx,xxx P.A.
How many employees in USA company?
Employees Strength of your company
How you came to know about this company?
Thru Dice.com Job Site.
Why you are going after so long? (Sometimes they ask to candidate who appear after long time of approval)
Explain Valid reason, or in case no valid reason you may try that you are working on Important project when you received approval.
Where are you working currently?
Your present company name, what they are working in and how many employee strength. Example: I am working with abc co., which works mainly into web development with xxx no. of employees.
What is your current salary?
Your currently salary.
Why is your salary is low as compare to other IT Professional? (They do ask this question, specially to people coming from small town with less salary as compare to salary in big cities)
Explain the valid reason. Example: Sir I am coming from abc town, wherein monthly expense is just Rsxxx. In short you need to convince him that your salary is good in your town as compare to other cities.
What is the salary you will get in USA?
$xxxxxP.A. + other benefits which includes Medical Insurance, Relocation and Performance Appraisal.
Why is your salary low when compared to other US Companies?
There will be increase after six months, also I will be getting Medical Insurance + Relocation + Performance Appraisal.; And still the pay is good when compared to pay in Australia or India. Not only money there are several factors like.. Challenging projects, career growth etc which made me to accept the offer with synergy.
How were you Selected? Or How many rounds of interviews the USA company conducted? What are they?
They had conducted 3 Rounds of Interview, 2 Technical and 1 HR Interview. All were telephonic interview.
What is the Address of the Company?
Address of your company
When did you applied for Job?
January 2007
When and how did you get interviewed?
Telephonic Interview was scheduled via email, during evening hours.
How long the interview lasted?
Technical Interview was lasted about 30 minutes. And HR Interview was lasted for 15 minutes.
What did you talk in the interview?
They asked me question about what is my education, how much I scored and other questions related to technical.
Who and when your H1 was filed.
ABC company has filed my petition (After acceptance, they have asked me send all my documents for visa processing.)
How did you find your attorney/lawyer?
My company has managed the lawyer in N.J.
Who had taken interview for you?
Interviewer Name
What is your HR Name?
HR Name
Can you give me the dates of your interview?
Somewhere in Feb 2007 or Exact date if you remember
Who are the clients for your USA company?
Example: IBM, Computer Horizon Corp., Comsys Inc., Sapphire Technologies, Satnam Data Systems.
What are the technologies you are working on?
.Net Technologies (Asp.net, C#)
Who is the President/CEO of US company?
Name of CEO of your company
What kind of projects US company is working on? Or Employer’s Main Business areas?
They mainly focus on ERP based Project, Banking Application, CRM, Web development.
What is the annual turn over of the company?
Gross Annual Income $xxxxxxxx
What does your US employer do?
They Offer consulting services in various fields of IT.
Why are you changing your Job?
For Career Growth and to enhance skill
Why you want to work in US?
For Career Growth, it give me chance to work with various client environment, it will help me to improve my skill set.
Have you applied for any other Country?
NO.
Do you know what is the leaving cost in US specific to the place where you are going?
35K P.A.
When did you received your offer letter?
Date when you received your offer letter. (Approximation do in case you are not aware of exact date).
What is the current project you are going to work?
Name the project or In case project is not decided than you can say project will be allocated ones I would settle and join my company in USA.
What is your current role?
Software Engineer
What is your role in US company?
Programmer Analyst
Where are you going to work in US?
ABC company, Mountain Lake, N.J.
What is your designation in US company?
Programmer Analyst
What are your responsibilities as a programmer analyst?
• Analyze user requirement
• Designing the application
• Programming the application
• Testing Application
Which Technologies are u going to work in US?
I am going to work on ASP.net Technology. I had done my certification in .NET
When did US company founded?
In year 1995
When are you planned to travel?
2nd Week of October
How will you survive for the first month?
Company will take care of my accommodation, initially I would be staying at hotel.
Have you been to any other country before?
--- Answer it.
If yes then, When had you been in USA
March 2007
When had you return from USA
April 2007
What was the purpose of your trip
It was a business trip
What work do you do in your present company? Or What kind of Project you are currently working on?
I am software engineer, my work is to identify requirement and providing equivalent web-based solution.
Explain me in detail what work you have to do? What websites you have developed?
I have to make websites like ecommerce websites, bloggers.com websites, etc, etc.
How much time you are being with employer
X year.
What were you doing before you join your present company.
I was working with XYZ Information and Technology
Will you come back to India?
Yes.
When you will be back to india?
Within 2 years
Why you want to return back?
My Marriage will be after year and I can take advantage of opportunities in India after returning to USA.
H1B Technical Interview FAQ
Note: Generally they don't ask technical questions during H1B Interview in Consulate, but it is always good to be prepared in case of cross checking. Tip: Be Confident, as they are not technical people they just want to ensure that you are not fake entity.
Do Prepare with Main Terminology, example if you claim to expert in .Net you should able to explain what is .Net, similarly for SQL than you should
Sample Questions
3) Two main Components of .Net Framework
Difference between
For More Details on H1B VisaH1B Overview
- 221g Refusal Information
- Administrative Processing Information
Understanding DateTime and TimeSpan in .Net through real time example
What is the difference between "==" and "object.EqualsTo"
"==" Vs "Object.EqualsTo"
'==' only compares the value where as 'object.equalsto' compares the both value as well as type
Both are used for comparison and both returns the boolean value (true/false)
Case 1. In case a and b both are different datatype then also a.Equals(b) can be used to compare but incase of == we cant even compile the code if a and b are different data type
Example1 for "==" Vs "Object.EqualsTo":
int a=0;
string b="o";
if(a.Equals(b))
{
//do something
}
//above code will compile successfully and internally the int b will convert to object type and compare
if(a==b)
{
//do something
}
//above code will give you the compilation error
Case 2. by using == we cant compare two object but Equals method will able to compare both the object internally
Example 2 for "==" Vs "Object.EqualsTo":
a==b is used to compare references where as a.Equals(b) is used to compare the values they are having.
for e.g
class Mycar
{
string colour;
Mycar(string str)
{
colour = str;
}
}
Mycar a = new Mycar("blue");
Mycar b = new Mycar("blue");
a==b // Returns false
a.Equals(b) // Returns true
Difference between Close() and Dispose() Method
Close() Vs Dispose Method
The basic difference between Close() and Dispose() is, when a Close() method is called, any managed resource can be temporarily closed and can be opened once again. It means that, with the same object the resource can be reopened or used. Where as Dispose() method permanently removes any resource ((un)managed) from memory for cleanup and the resource no longer exists for any further processing.
Example showing difference between Close() and Dispose() Method:
using System;
using System.Data;
using System.Data.SqlClient;
public class Test
{
private string connString = "Data Source=COMP3;Initial Catalog=Northwind;User Id=sa;Password=pass";
private SqlConnection connection;
public Test()
{
connection = new SqlConnection(connString);
}
private static void Main()
{
Test t = new Test();
t.ConnectionStatus();
Console.ReadLine();
}
public void ConnectionStatus()
{
try
{
if(connection.State == ConnectionState.Closed)
{
connection.Open();
Console.WriteLine("Connection opened..");
}
if(connection.State == ConnectionState.Open)
{
connection.Close();
Console.WriteLine("Connection closed..");
}
// connection.Dispose();
if(connection.State == ConnectionState.Closed)
{
connection.Open();
Console.WriteLine("Connection again opened..");
}
}
catch(SqlException ex)
{
Console.WriteLine(ex.Message+"\n"+ex.StackTrace);
}
catch(Exception ey)
{
Console.WriteLine(ey.Message+"\n"+ey.StackTrace);
}
finally
{
Console.WriteLine("Connection closed and disposed..");
connection.Dispose();
}
}
}
In the above example if you uncomment the "connection.Dispose()" method and execute, you will get an exception as, "The ConnectionString property has not been initialized.".This is the difference between Close() and Dispose().
What is the difference between Copy and Clone Method.
Copy Vs Clone Method
Clone will copy the structure of a data where as
Copy will copy the complete structure as well as data .
.Net Framework 3.0, WPF, WCF, WF, XAML Interview FAQ
What is .Net Framework 3.0
The Microsoft .NET Framework 3.0 (formerly WinFX), is the new managed code programming model for Windows.
It combines the power of the .NET Framework 2.0 with four new technologies: Windows Presentation Foundation (WPF), Windows Communication Foundation (WCF), Windows Workflow Foundation (WF), and Windows CardSpace (WCS, formerly "InfoCard").
Use the .NET Framework 3.0 today to build applications that have visually compelling user experiences, seamless communication across technology boundaries, the ability to support a wide range of business processes, and an easier way to manage your personal information online. Now the same great WinFX technology you know and love has a new name that identifies it for exactly what it is – the next version of Microsoft’s development framework. This change does not affect the release schedule of the .NET Framework 3.0 or the technologies included as a part of the package.
Why is the .NET Framework 3.0 a major version number of the .NET Framework if it uses the .NET Framework 2.0 runtime and compiler?
The new technologies delivered in the .NET Framework 3.0, including WCF, WF, WPF, and CardSpace, offer tremendous functionality and innovation, and we wanted to signal that with a major release number.
Which version of the Common Language Runtime (CLR) does the .NET Framework 3.0 use?
The .NET Framework 3.0 uses the 2.0 version of the CLR. With this release, the overall developer platform version has been decoupled from the core CLR engine version. We expect the lower level components of the .NET Framework such as the engine to change less than higher level APIs, and this decoupling helps retain customers' investments in the technology.
Will the name change be reflected in any of the existing .NET Framework 2.0 APIs, assemblies, or namespaces?
There will be no changes to any of the existing .NET Framework 2.0 APIs, assemblies, or namespaces. The applications that you've built on .NET Framework 2.0 will continue to run on the .NET Framework 3.0 just as they have before.
How does the .NET Framework 3.0 relate to the .NET Framework 2.0?
The .NET Framework 3.0 is an additive release to the .NET Framework 2.0. The .NET Framework 3.0 adds four new technologies to the .NET Framework 2.0: Windows Presentation Foundation (WPF), Windows Workflow Foundation (WF), Windows Communication Foundation (WCF), and Windows CardSpace. There are no changes to the version of the .NET Framework 2.0 components included in the .NET Framework 3.0. This means that the millions of developers who use .NET today can use the skills they already have to start building .NET Framework 3.0 applications. It also means that applications that run on the .NET Framework 2.0 today will continue to run on the .NET Framework 3.0.
What happens to the WinFX technologies?
The WinFX technologies will now be released under the name .NET Framework 3.0. There are no changes to the WinFX technologies or ship schedule — the same technologies you're familiar with now simply have a new name.
What is the .NET Framework 3.0 (formerly WinFX)?
The .NET Framework 3.0 is Microsoft's managed code programming model. It is a superset of the .NET Framework 2.0, combining .NET Framework 2.0 components with new technologies for building applications that have visually stunning user experiences, seamless and secure communication, and the ability to model a range of business processes. In addition to the .NET Framework 2.0, it includes Windows Presentation Foundation (WPF), Windows Workflow Foundation (WF), Windows Communication Foundation (WCF), and Windows CardSpace.
System Requirements for Installing .NET Framework 3.0
Processor
Minimum: 400 megahertz (MHz) Pentium processor
Recommended: 1 gigahertz (GHz) Pentium processor
Operating System
.NET Framework 3.0 can be installed on any of the following systems:
Microsoft Windows 2003 Server Service Pack 1 (SP1)
Windows XP SP2
Windows Vista *
*Windows Vista comes with .NET Framework 3.0. There is no separate installation package required. The standalone .NET Framework 3.0 packages are not supported on Vista.
RAM
Minimum: 96 megabytes (MB)
Recommended:256 MB
Hard Disk
Up to 500 MB of available space may be required.
CD or DVD Drive Not required.
Display Minimum: 800 x 600, 256 colors
Recommended:1024 x 768 high color, 32-bit
Mouse Not required
What Improvements does WCF offers over its earlier counterparts?
A lot of communication approaches exist in the .NET Framework 2.0 such as ASP.NET Web Services, .NET Remoting, System.Messaging supporting queued messaging through MSMQ, Web Services Enhancements (WSE) - an extension to ASP.NET Web Services that supports WS-Security etc. However, instead of requiring developers to use a different technology with a different application programming interface for each kind of communication, WCF provides a common approach and API.
What are WCF features and what communication problems it solves?
WCF provides strong support for interoperable communication through SOAP. This includes support for several specifications, including WS-Security, WS-ReliableMessaging, and WS-AtomicTransaction. WCF doesn't itself require SOAP, so other approaches can also be used, including optimized binary protocol and queued messaging using MSMQ. WCF also takes an explicit service-oriented approach to communication, and loosens some of the tight couplings that can exist in distributed object systems, making interaction less error-prone and easier to change. Thus, WCF addresses a range of communication problems for applications. Three of its most important aspects that clearly stand out are:
Unification of Microsoft's communication technologies.
Support for cross-vendor interoperability, including reliability, security, and transactions.
Rich support for service orientation development.
What contemporary computing problems WCS solves?
WCS provides an entirely new approach to managing digital identities. It helps people keep track of their digital identities as distinct information cards. If a Web site accepts WCS logins, users attempting to log in to that site will see a WCS selection. By choosing a card, users also choose a digital identity that will be used to access this site. Rather than remembering a plethora of usernames and passwords, users need only recognize the card they wish to use. The identities represented by these cards are created by one or more identity providers. These identities will typically use stronger cryptographic mechanisms to allow users to prove their identity. With this provider, users can create their own identities that don't rely on passwords for authentication.
What contemporary computing problems WPF solves?
User interfaces needs to display video, run animations, use 2/3D graphics, and work with different document formats. So far, all of these aspects of the user interface have been provided in different ways on Windows. For example, a developer needs to use Windows Forms to build a Windows GUI, or HTML/ASPX/Applets/JavaScript etc. to build a web interface, Windows Media Player or software such as Adobe's Flash Player for displaying video etc. The challenge for developers is to build a coherent user interface for different kinds of clients using diverse technologies isn't a simple job.
A primary goal of WPF is to address this challenge! By offering a consistent platform for these entire user interface aspects, WPF makes life simpler for developers. By providing a common foundation for desktop clients and browser clients, WPF makes it easier to build applications.
What is XAML ?
WPF relies on the eXtensible Application Markup Language (XAML). An XML-based language, XAML allows specifying a user interface declaratively rather than in code. This makes it much easier for user interface design tools like MS Expression Blend to generate and work with an interface specification based on the visual representation created by a designer. Designers will be able to use such tools to create the look of an interface and then have a XAML definition of that interface generated for them. The developer imports this definition into Visual Studio, then creates the logic the interface requires.
What is XBAP?
XAML browser application (XBAP) can be used to create a remote client that runs inside a Web browser. Built on the same foundation as a stand-alone WPF application, an XBAP allows presenting the same style of user interface within a downloadable browser application. The best part is that the same code can potentially be used for both kinds of applications, which means that developers no longer need different skill sets for desktop and browser clients. The downloaded XBAP from the Internet runs in a secure sandbox (like Java applets), and thus it limits what the downloaded application can do.
What is a service contract ( In WCF) ?
In every service oriented architecture, services share schemas and contracts, not classes and types. What this means is that you don't share class definitions neither any implementation details about your service to consumers.
Everything your consumer has to know is your service interface, and how to talk to it. In order to know this, both parts (service and consumer) have to share something that is called a Contract.
In WCF, there are 3 kinds of contracts: Service Contract, Data Contract and Message Contract.
A Service Contract describes what the service can do. It defines some properties about the service, and a set of actions called Operation Contracts. Operation Contracts are equivalent to web methods in ASMX technology
In terms of WCF, What is a message?
A message is a self-contained unit of data that may consist of several parts, including a body and headers.
In terms of WCF, What is a service?
A service is a construct that exposes one or more endpoints, with each endpoint exposing one or more service operations.
In terms of WCF, What is an endpoint?
An endpoint is a construct at which messages are sent or received (or both). It comprises a location (an address) that defines where messages can be sent, a specification of the communication mechanism (a binding) that described how messages should be sent, and a definition for a set of messages that can be sent or received (or both) at that location (a service contract) that describes what message can be sent.
An WCF service is exposed to the world as a collection of endpoints.
In terms of WCF, What is an application endpoint?
An endpoint exposed by the application and that corresponds to a service contract implemented by the application.
In terms of WCF, What is an infrastructure endpoint?
An endpoint that is exposed by the infrastructure to facilitate functionality that is needed or provided by the service that does not relate to a service contract. For example, a service might have an infrastructure endpoint that provides metadata information.
In terms of WCF, What is an address?
An address specifies the location where messages are received. It is specified as a Uniform Resource Identifier (URI). The schema part of the URI names the transport mechanism to be used to reach the address, such as "HTTP" and "TCP", and the hierarchical part of the URI contains a unique location whose format is dependent on the transport mechanism.
In terms of WCF, What is binding?
A binding defines how an endpoint communicates to the world. It is constructed of a set of components called binding elements that "stack" one on top of the other to create the communication infrastructure. At the very least, a binding defines the transport (such as HTTP or TCP) and the encoding being used (such as text or binary). A binding can contain binding elements that specify details like the security mechanisms used to secure messages, or the message pattern used by an endpoint.
What is an operation contract?
An operation contract defines the parameters and return type of an operation. When creating an interface that defines the service contract, you signify an operation contract by applying the OperationContractAttribute attribute to each method definition that is part of the contract. The operations can be modeled as taking a single message and returning a single message, or as taking a set of types and returning a type. In the latter case, the system will determine the format for the messages that need to be exchanged for that operation.
What is a message contract?
A message contact describes the format of a message. For example, it declares whether message elements should go in headers versus the body, what level of security should be applied to what elements of the message, and so on.
What is a fault contract?
A fault contract can be associated with a service operation to denote errors that can be returned to the caller. An operation can have zero or more faults associated with it. These errors are SOAP faults that are modeled as exceptions in the programming model.
In Terms of WCF, what do you understand by metadata of a service
The metadata of a service describes the characteristics of the service that an external entity needs to understand to communicate with the service. Metadata can be consumed by the Service Model Metadata Utility Tool ( Svcutil.exe) to generate a WCF client and accompanying configuration that a client application can use to interact with the service.
The metadata exposed by the service includes XML schema documents, which define the data contract of the service, and WSDL documents, which describe the methods of the service.
What is password fatigue?
As the use of internet increases, as increases the danger of online identity theft, fraud, and privacy. Users must track a growing number of accounts and passwords. This burden results in "password fatigue," and that results in less secure practices, such as reusing the same account names and passwords at many sites.
What are activities in WWF?
Activities are the elemental unit of a workflow. They are added to a workflow programmatically in a manner similar to adding XML DOM child nodes to a root node. When all the activities in a given flow path are finished running, the workflow instance is completed.
An activity can perform a single action, such as writing a value to a database, or it can be a composite activity and consist of a set of activities. Activities have two types of behavior: runtime and design time. The runtime behavior specifies the actions upon execution. The design time behavior controls the appearance of the activity and its interaction while being displayed within the designer.
Related Links
Interview FAQ on Share Point, You can find a huge collection of Share Point Interview FAQ here
http://www.spsfaq.com/general.asp
Dot Net FAQs
1) http://www.dailyfreecode.com/
http://dng-ado.blogspot.com/
http://dng-dotnetframework.blogspot.com/
http://dng-oops.blogspot.com/
http://dng-config.blogspot.com/
http://dng-collections.blogspot.com/
ASP.net FAQs
1) http://www.syncfusion.com/faq/aspnet/default.aspx
2) http://www.aspnetfaq.com
3) http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=4081&lngWId=10
4) http://blogs.crsw.com/mark/articles/254.aspx
5) http://www.techinterviews.com/?p=176 & http://www.techinterviews.com/?p=193
6) http://www.eggheadcafe.com/articles/20021016.asp
7) http://www.cmap-online.org/Default.aspx?tabindex=4&tabid=-17
C# FAQs
1) http://www.andymcm.com => for c# and dot net frame work faqs
2) http://www.syncfusion.com/faq/windowsforms/default.aspx
3) http://www.c-sharpcorner.com/faq.asp
4) http://msdn.microsoft.com/vcsharp/productinfo/faq/default.aspx
5) http://www.yoda.arachsys.com/csharp/faq/
6) http://www.gotdotnet.com/team/csharp/learn/faq/
7) http://www.syncfusion.com/faq/windowsforms/default.aspx
Advice Forums are most useful forum for .Net Query Posting.
There are lots of forum available, but i was truly helped by advice forum. Most of the members are experience and are MVP, and to best of all they participate actively.
I had been trapped with "how to use dynamic control optimally" so that it doesn't affect my web performance, i got a very good response.
You can try out
http://aspadvice.com/
beside that there are other interesting forum
http://www.dotnetspider.com
http://www.sqladvice.com
http://www.xmladvice.com