web stats analysis

Archive for July 3rd, 2012

How to print the names and owners of all the tables in the sql server database

print the names and owners of all the tables in the sql server database

Solution

EXEC sp_MSforeachtable @command1 = “PRINT ’?’”

How to select all the rows from all the tables in the sql server database

select all the rows from all the tables in the sql server database

Solution

EXEC sp_MSforeachtable @command1 = “SELECT * FROM ?”

How to truncate all data from all the tables in the sql server database

truncate all data from all the tables in the sql server database

Solution

EXEC sp_MSforeachtable @command1 = “TRUNCATE TABLE ?”

How to delete all data from all the tables in the sql server database

delete all data from all the tables in the sql server database

Solution

EXEC sp_MSforeachtable @command1 = “DELETE FROM ?”

How to drop all tables from sql server database

drop all tables from sql server database

Solution

EXEC sp_MSforeachtable @command1 = “DROP TABLE ?”

sql query for sum of a field

sql query for sum of a table column

How to sum a column in a SQL query

Solution

SELECT SUM(column_name) FROM table_name

What is LINQ ?

What is LINQ in .net?

Language Integrated Query (LINQ), is a component released within the .NET 3.5 Framework. It is one of the most powerful features of .NET 3.5. It serves the purpose of querying objects.

LINQ comprises a series of operators, which are used to query, filter and project data in arrays, enumerable classes, relational databases and XML. In order to query data, the data needs to be encapsulated as an object. In case the data source is not an object, it first needs to be converted to an object in order for LINQ to query it.

LINQ has its own Query Processing Engine. The information returned by a LINQ query is a collection of in-memory object which may be enumerated.

The LINQ concept treats the data source as an Object, rather than a Database. So we may say, its an object that is queried. LINQ may query any type of data source, like:

- LINQ querying SQL (MS SQL Server supported).
- LINQ querying Datasets (Querying is possible on Datasets and DataTables)
- LINQ querying ORM Solution
- LINQ querying Objects (In-memory data may be queried)
- LINQ querying XML (Querying is possible on XML data source

LINQ supports querying to those objects that implement the IEnumerable Interface.

What is WPF in .net ?

Introduction to WPF

Windows Presentation Foundation (WPF) is the code-name of the presentation (user-interfaces) sub system in Windows programming model and is used to create user interfaces.

If you have been programming .NET, you must be familiar with Windows Forms and ASP.NET. Windows Forms are used to build Windows client application and ASP.NET is used to build Web applications.

Well, WPF is a new technology that may be used instead of both Windows Forms and ASP.NET.

What is WPF?

WPF is the engine that is responsible for creating, displaying, and manipulating user-interfaces, documents, images, movies, and media in Windows Vista.

Physically, WPF is a set of libraries that have all functionality you need to build, run, execute, and manage Windows Vista applications.

What is XAML?

XAML is a new descriptive programming language developed by Microsoft to write user interfaces for next generation managed applications.

How XAML is related to WPF?

XAML is a new descriptive programming language developed by Microsoft to write user interfaces for next generation managed applications. XAML is used in WPF to represent the controls and code with the help of C#, Visual Basic, and other .NET Framework languages.

XAML can be think as ASP.NET and/or Windows Forms in Windows Vista. For example, to write a Web application in .NET 1.0, 1.1, or 2.0, you use ASP.NET and to write Windows Applications, you use Windows Forms. Now in Windows Vista and .NET 3.0, you will use XAML instead of Windows Forms and ASP.NET.

Does that mean XAML will replace ASP.NET and Windows Forms? YES and NO. Both ASP.NET and Windows Forms will also be supported on .NET 3.0 but you don’t have to use them if you don’t want.

What Operating Systems does WPF support?

Windows Vista, Windows XP, and Windows 2003 Server.

How do I build WPF Applicaitons?

To build WPF application, you must install .NET 3.5 SDK. You can also also Visual Studio 2010 and 2008. These two comes with WPF.

What do I need to run WPF Applications?

To run WPF applications, you must install .NET 3.5 or 4.0 SDK redistributable. It can be found on MSDN downloads sites.

What is WCF in .net?

Introduction to WCF

WCF is short for Windows Communication Foundation and is part of the .NET framework (versions 3.0 and higher). WCF is the unification of various communication techniques and protocols that are used in building distributed applications, namely :

• NET remoting
• Web services
• MSMQ
• COM+

If you were planning on using one of these technologies in a .NET application you should implement it using WCF. Although WCF does not save too much time in implementing a technology it does make the process of switching the communication technology very simple.