Showing posts with label SQL Server. Show all posts
Showing posts with label SQL Server. Show all posts

How to create a login page in Aspnet with sqlserver

First we have to create a database for storing the login information

Open the Sqlserver Management studio

Create a new database and change the database name as db_Logininformation

Create a New table in that database(db_Logininformation) and change the table name as tab_userinformation
Now, create the following fields

  1. UserID   int         PrimaryKey  
  2. username varchar(50)  
  3. Password varchar(50)  
Next, Enter the some usernames and paasword directlu in the database for checking purpose

and save the table

Next ,open the Microsoft visual studio 2008

Next,select the Aspnet web application and change the name as LoginPage

Next,come to the design page of LoginPage and drag and drop two labels,two textboxes and button

next,come to the code page of the Login.aspx.cs

Write the following codein the page event
 
  1. protected void Button1_Click(object sender, EventArgs e)  
  2.     {        
  3.         con = new SqlConnection(ConfigurationManager.ConnectionStrings["connectionstring"].ToString());  
  4.         con.Open();  
  5.         com = new SqlCommand("select Password from userinformation where Username='" + txt_uname.Text + "'", con);  
  6.         dr = com.ExecuteReader();  
  7.         if (!dr.Read())  
  8.         {  
  9.             Response.write("Invalid User");  
  10.         }  
  11.         else  
  12.         {  
  13.             if (dr[0].ToString() == txt_pwd.Text)  
  14.             {  
  15.                 Response.Redirect("~/mainPage.aspx");  
  16.             }  
  17.             else  
  18.             {  
  19.                Response.write("Wrong Password");  
  20.                txt_pwd.Focus();  
  21.             }  
  22.         }  
  23.   
  24.     } 

Basic differences between Oracle and SQL Server

ORACLE
  • Oracle provides password complexity enforcement rule.
  • Connect with one Schema and can work with other schema.
  • Oracle implemented the row versioning on the DB block level.
  • Oracle metadata is managed in the same manner as table data.So during data querying most of online DDL statements on the table can be performed simultaneously.
  • Starting from Oracle 9i the configuration of ROLLBACK SEGMENTS is automatic.
  • Oracle is well rich with Index Options.
  • Oracle provides Automatic Storage Management (ASM), which assists with RAC/Grid based cluster deployment.
  • Oracle provides proprietary cluster file system on Linux and Windows platforms that helps in avoiding the use of raw devices.
  • Oracle provides Materialized Views for performance improvements of Stored Data with multiple Tables.
  • Oracle has more recovery options for corrupted database, redo log or datafile than MSSQL.
MS SQL
Microsoft implemented row level lock based on each single row.
SQL Server
  • all DDL operations that are currently running on tables belong to database "Snapshot Isolation". "Snapshot Isolation" queries are prohibited.
  • SQL requires a complex setup of ROLLBACK Segments and Transaction Level use on it.
  • SQL has just BTREE Index while compare to Oracle.
  • SQL has limitations using Materialized Views.

What is the difference between oracle,sql and sql server?

Difference between oracle,sql and sql server
===================================

Oracle is based on RDBMS.
SQL is Structured Query Language.
SQL Server is another tool for RDBMS provided by MicroSoft.

What is difference between oracle and sqlserver ?

Oracle:
1. Oracle runs on many platforms
2. Oracle includes IFS (Internet File System), Java integration
3. Oracle requires client install and setup (Not difficult, but very UNIX-like for Windows users)
4. Oracle is well rich with Index Options.
5. Oracle provides Materialized Views for performance improvements of Stored Data with multiple Tables.
6. Failover support in SQL is much, much easier
7.Oracle provides password complexity enforcement rule..
8.Connect with one Schema and can work with other schema.

SQl Server:
1.All DDL operations that are currently running on tables belong to database "Snapshot Isolation". "Snapshot Isolation" queries are prohibited.
2.SQL requires a complex setup of ROLLBACK Segments and Transaction Level use on it.
3.SQL has just BTREE Index while compare to Oracle.
4.SQL has limitations using Materialized Views.
5.SQL Analysis Services is included (A very powerful OLAP server)
6.SQL is ANSI-SQL '92 compliant, making it easier to convert to another ANSI compliant database, theoretically anyway (truth is every database has proprietary extensions). Oracle is generally more proprietary and their main goal is to keep their customers locked-in.