RSS

SQL SERVER – Concurrency Basics – Guest Post by Vinod Kumar


SQL SERVER – Concurrency Basics – Guest Post by Vinod Kumar.

 
Leave a comment

Posted by on November 5, 2014 in MS SQL Server

 

What is Entity Framework?


Microsoft has given following definition:

The Microsoft ADO.NET Entity Framework is an Object/Relational Mapping (ORM) framework that enables developers to work with relational data as domain-specific objects, eliminating the need for most of the data access plumbing code that developers usually need to write. Using the Entity Framework, developers issue queries using LINQ, then retrieve and manipulate data as strongly typed objects. The Entity Framework’s ORM implementation provides services like change tracking, identity resolution, lazy loading, and query translation so that developers can focus on their application-specific business logic rather than the data access fundamentals.

Or simply: Entity framework is an Object/Relational Mapping (O/RM) framework. It is an enhancement to ADO.NET that gives developers an automated mechanism for accessing & storing the data in the database, and for working with the results, in addition to DataReader and DataSet.

Now the question is what is O/RM framework and why do we need it?

ORM is a tool for storing data from domain objects to relational database like MS SQL Server, in an automated way, without much programming. O/RM includes three main parts: Domain class objects, Relational database objects and Mapping information on how domain objects map to relational database objects (tables, views & storedprocedures). ORM allows us to keep our database design separate from our domain class design. This makes the application maintainable and extendable. It also automates standard CRUD operation (Create, Read, Update & Delete) so that the developer doesn’t need to write it manually.

Visit wikipedia for more information on Object-relational Mapping

There are many ORM frameworks for .net in the market like DataObjects.Net, NHibernate, OpenAccess, SubSonic etc. Entity Framework is an open source ORM framework from Microsoft.

 
Leave a comment

Posted by on November 1, 2014 in Data Access

 

Tags: , , , , , , ,

Microsoft Exam .. 100% Free!! (EXPIRED!)


mcp-certified-logo

I’m Microsoft Certified Trainer (MCT), I can help you to get a free exam voucher for any of Microsoft exams.

Just send me your:

  • First Name
  • Last Name
  • Microsoft Mail

Kindly, don’t do that unless you need to leave others to get the chance, reply on the same thread with the requested details and after registration you will get an email contains all of details which you want.

Notes:

  • You’ve the chance to get one voucher only.
  • You should use it before November 30, 2014.
  • You cannot sell it, because it is assigned to you.
  • Don’t use different mail to get more than one voucher, because of your records will be distributed on more than one transcript, it’s illegal issue.
  • There’re limited seats, hurry up!
  • Feel free to contact me (a.negm@outlook.com) if you want to get further info about the issue.
 
14 Comments

Posted by on October 31, 2014 in Common

 

Tags: , , ,

SQL SERVER – GUID vs INT – Your Opinion


torage space is required than INT

via SQL SERVER – GUID vs INT – Your Opinion.

 
Leave a comment

Posted by on October 28, 2014 in MS SQL Server

 

SQL SERVER – How to select minimum value from group in a table


SQL SERVER – How to select minimum value from group in a table.

 
Leave a comment

Posted by on October 16, 2014 in MS SQL Server

 

Tags: , , ,

Inline Server Tags | ASP .NET


I have to tell you: Sometimes I get confused on which server-side tag I should use to make my codes. Normal since I never use all of them so often. If you suffer from the same issue this text might be useful as a quick reference. Copied.

<% .. %>, <%= .. %><%: .. %>, <%– .. –%>, <%# .. %>, <%$ .. %>, <%@ .. %>

Read the rest of this entry »

 
Leave a comment

Posted by on July 30, 2014 in ASP .NET

 

Tags:

Returning JSON object from an ASP.NET page


images

I think that the web service is a good solution to do that, but what If do you be enforced to deal with JSON through ASP .NET.

You have a class “Product” as following, and you have an object “o” represents the class:

public class Product
{
public int ID { get; set; }
public string Name { get; set; }
public int Price { get; set; }
}

If you want to write Response.Write(x), you will get “namespace.Product”, and this is totally wrong. In brief, to do that you have to execute the following script in your code-behind page:

var o = new System.Web.Script.Serialization.JavaScriptSerializer();
System.Text.StringBuilder x = new System.Text.StringBuilder();
o.Serialize(new Product { ID = 1, Name = “Product abc”, Price = 1000 }, x);
Response.ContentType = “application/json”;
Response.Write(x);

You will get the following result: {“ID”:1,”Name”:”Note 2″,”Price”:1000}

 
Leave a comment

Posted by on July 1, 2014 in ASP .NET

 

Tags: , , ,

Send mail from SQL database (Configure Database Mail)


SQL Server Mail

Database mail is newly introduced concept in SQL Server 2005 and it is replacement of SQLMail of SQL Server earlier version. Database Mail has many enhancement over SQLMail. Database Mail is based on SMTP (Simple Mail Transfer Protocol) and also very fast and reliable where as SQLMail is based on MAPI (Messaging Application Programming Interface). Database mail depends on Service Broker so this service must be enabled for Database Mail. Database Mail can be encrypted for additional security. SQLMail is lesser secure as it can encrypt the message as well anybody can use SMTP to send email. Additionally, for MAPI to be enabled for SQLMail it will require Outlook to be installed. All this leads to potential security threat to database server.

In order to send mail using Database Mail in SQL Server, there are 3 basic steps that need to be carried out:

  1. Create Profile and Account
  2. Configure Email
  3. Send Email

Read the rest of this entry »

 
Leave a comment

Posted by on May 12, 2014 in MS SQL Server

 

Tags: , , , , , , , , , , , , ,

How to convert Value Pair list to Table in SQL Server?


key-value-pair-mongoDB

DECLARE @NameValuePairs VARCHAR(MAX) = 'FirstName=Ahmed;LastName=Negm;Age=26;Address=Egypt;Job=Senior Software Developer'
DECLARE @NameValuePair VARCHAR(100)
DECLARE @Name VARCHAR(50)
DECLARE @Value VARCHAR(50)
DECLARE @Property TABLE (
 [Name] VARCHAR(50),
 [Value] VARCHAR(50)
)
WHILE LEN(@NameValuePairs) > 0
BEGIN
 SET @NameValuePair = LEFT(@NameValuePairs, 
 ISNULL(NULLIF(CHARINDEX(';', @NameValuePairs) - 1, -1),
 LEN(@NameValuePairs)))
 SET @NameValuePairs = SUBSTRING(@NameValuePairs,
 ISNULL(NULLIF(CHARINDEX(';', @NameValuePairs), 0),
 LEN(@NameValuePairs)) + 1, LEN(@NameValuePairs))
SET @Name = SUBSTRING(@NameValuePair, 1, CHARINDEX('=', @NameValuePair) - 1)
SET @Value = SUBSTRING(@NameValuePair, CHARINDEX('=', @NameValuePair) + 1, LEN(@NameValuePair))
INSERT INTO @Property ( [Name], [Value] ) VALUES ( @Name, @Value )
END

SELECT * FROM @Property

2014-05-05_12-01-00

 
Leave a comment

Posted by on May 5, 2014 in Common

 

Tags: , , , , , , , , ,

10 Reasons why your employees hate you!!


 

pathsofhate_stills_01

Firstly, this topic is copied from here, and I know that it isn’t related to our blog major trend, but it is so important for you in your work environment.

In the world of employees, a good boss is differentiated from a bad boss by the way the boss makes the employees feel. They also assess the boss based on his or her contribution – or lack thereof – to their ability to get their jobs done successfully.

Employees tolerate a lot of bad boss behavior. Many bosses are untrained, uncaring, and not held accountable for their actions and interaction with employees. Some were promoted to jobs above their competence to perform. Bad management practices weigh heavily in whether your employees hate you.

Read the rest of this entry »

 
Leave a comment

Posted by on April 2, 2014 in Common

 

Tags: , , , , , , , , ,