Posted by Pharaoh on November 4, 2010 ·
For More Information about sql server identity please visit this post :
IDentity in Columns Sql Server
Creating a Table With an Identity Columns
Create Table Users
(userID int Identity , UserName nvarchar(255) , Password nvarchar(255))
Inserting a row
Insert Into Users (UserName,Password) Values ('Nicolas','123654789654')
Or
Insert Into Users Values ('Nicolas','123654789654')
Note that sql [...]
Posted by Pharaoh on November 4, 2010 ·
By Craig S. Mullins
The identity property is a very powerful and useful, yet under-utilized feature of Microsoft SQL Server. It satisfies a common requirement of many applications: the need for a sequential, ascending identifier. Whenever there is a need for a database column to contain a serial number, the identity property can be used to simplify the implementation. The primary benefit of the [...]
Posted by Pharaoh on November 3, 2010 ·
In alot of situations we find that we need to display data to the user that’s not actually in the database tables
for eamples let’s think about a table containing employees data
Create Table Employees
(ID int identity primary key , Name nvarchar(255) , isMarried bit )
insert into Employees Values ('John' , 0)
insert into Employees Values ('Debra' , 1)
insert into Employees Values ('Paul' [...]
Posted by Pharaoh on October 21, 2010 ·
Background ::
in SQL Server 2000 and Above we can use System Catalog View to Obtain Meta Data about our database
For Example we can list all of database tables using sys.tables .
select * From sys.tables
and also we can list all indexes in a database using sys.indexes
select * From sys.indexes
we can join those together using a common column (object_id)
Select I.Name 'Index Name' , T.Name 'Table [...]
Posted by Pharaoh on October 19, 2010 ·
be sure to use the following namespace
using System.Net;
we will create a method that sends out machine name and ip address as output parameters
void getMachineInfo(out string MachineName, out string IPAddress)
{
MachineName= Dns.GetHostName();
IPHostEntry iphostentry = Dns.GetHostByName(MachineName);
IPAddress = iphostentry.AddressList[0].ToString();
}
you wanna call the method like :
string [...]
Posted by Pharaoh on October 18, 2010 ·
Bill Gates gave a speech at a high school about 11 things they did not and will not learn at school. He talked about how feel-good, politically correct teachings created a generation of kids with no concept of reality and how this concept set them up for failure in the real world.
Rule 1. Life is not fair – get used to it!
Rule 2. The world won’t care about your self esteem. The world [...]
Posted by Pharaoh on October 18, 2010 ·
Unfortunately datagridview does not support gradient columns header , there’s a work around it : first thing we need to do is to handle the CellPainting Event of the Datagridview .
put this segment of code on the top of code page of the Form
//to use brushes , and graphics
using System.Drawing;
using System.Drawing.Drawing2D;
in the CellPainting Event of the datagridview post the following [...]
Posted by Pharaoh on October 12, 2010 ·
Introduction ..
in order to connect to any data source you will often need some information about that source , such as it’s location and it’s way of connectivity .
also you will be needing a tool to connect and disconnect from that data source
ADO.Net Connection Class ..
ADO.Net encapsulate all of the data source connectivity in one class called ”Connection” , according [...]
Posted by Pharaoh on October 12, 2010 ·
Instead of saving passwords in a plain text format in the database it’s better hashing them one thing to consider is hashing is not encrypting which means once you hashed the password you will never see the original one (theoretically)
for example if you hash the word “Pharaoh” using MD5 you will get “……………..”
now all we need to do is to [...]
Posted by Pharaoh on October 11, 2010 ·
Introduction … !
using SqlDataSource With the GridView Control gives you a lot of advantages , on the other hand if you are an old school ADO/ADO.Net programmer you would encounter scenarios where you wanna bind your gridview with your own datatable . the most obvious problem you will encounter that after binding the datatable with gridview and set AllowPaging = true and try to navigate between [...]