Saturday, November 26, 2016

Login and Display User Name in C# and Microsoft SQL Server

In this article I revised my previous code with the help of my good friend and fellow software engineer Mr. Alfel Benvic G. Go. Thank you very much Sir Bon for the help you provided to me.  We modify the code that enables the user to login and our program will welcome the user in our application by displaying the message welcome and the name of the user for example the name of the user is John Smith if John Smith successfully login in our system our welcome page will display Welcome John Smith the name John Smith is the record that is being retrieved from our database. I  have seen many questions all over the web asking how to do this functionality in our login page here is the solution very straight forward and easy to understand.  I hope you will find our work useful in learning C# programming. Take note we are using Microsoft Visual Studio 2012 Ultimate Edition and Microsoft SQL Server 2008 R2 as our development tool in this login system.


Add me at Facebook my address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com

My mobile number here in the Philippines is 09173084360.









Sample Program Output

Program Listing

Form1.cs

using System;
using System.Data;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace login
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private String fname;
        private String lname;


        private void btn_close_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Do you want to exit?", "Login System",
         MessageBoxButtons.YesNo, MessageBoxIcon.Question)
         == DialogResult.Yes)
            {
                Application.Exit();
            }
            else
            {
                txt_username.Focus();
            }
        }

        private void getTheName(String username)
        {
            SqlConnection con = new SqlConnection();
            con.ConnectionString = "Data Source=.\\SQLEXPRESS;Initial Catalog=access;Integrated Security=true;";
            String query = "SELECT firstname AS a, lastname AS b FROM tbl_access WHERE username = @username";
            try
            {
                con.Open();
                SqlCommand cmd = new SqlCommand(query, con);
                cmd.Parameters.AddWithValue("@username", username);
                cmd.ExecuteScalar();
                SqlDataReader rdr = cmd.ExecuteReader();
                if (rdr.Read())
                {
                    fname = rdr["a"].ToString();
                    lname = rdr["b"].ToString();
                }
            }
            catch (Exception)
            {
            }
            finally
            {
                con.Close();
            }
        }

        private void btn_ok_Click(object sender, EventArgs e)
        {
             if(txt_username.Text=="" || txt_password.Text=="")
            {
                MessageBox.Show("Please provide UserName and Password");
                return;
            }
            try
            {
                //Create SqlConnection
                SqlConnection con =  new SqlConnection("Data Source=.\\SQLEXPRESS;Initial Catalog=access;Integrated Security=true;");
                SqlCommand cmd = new SqlCommand("Select * from tbl_access where username=@username AND password_1=@password",con);
                cmd.Parameters.AddWithValue("@username",txt_username.Text);
                cmd.Parameters.AddWithValue("@password", txt_password.Text);
                con.Open();
                SqlDataAdapter adapt = new SqlDataAdapter(cmd);
                DataSet ds = new DataSet();
                adapt.Fill(ds);
                con.Close();
                int count = ds.Tables[0].Rows.Count;
                string str;

                 str = "select * from tbl_access";
                SqlCommand com = new SqlCommand(str, con);
                con.Open();
                SqlDataReader reader = com.ExecuteReader();


                if (count == 1)
                {
                    MessageBox.Show("Login Successful!");
                    this.getTheName(txt_username.Text);
                    this.Hide();
                    Form2 fm = new Form2();
                    fm.Uname = fname.Trim();
                    fm.Lname = lname.Trim();
                    fm.Show();
                  
                 }
                else
                {
                    MessageBox.Show("Login Failed!!! Try Again.");
                    txt_username.Text = "";
                    txt_password.Text = "";
                    txt_username.Focus();
                }
                
            }
            catch(Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

        private void txt_username_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                txt_password.Focus();
            }
        }

        private void txt_password_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                if (txt_username.Text == "" || txt_password.Text == "")
                {
                    MessageBox.Show("Please provide UserName and Password");
                    return;
                }
                try
                {
                    //Create SqlConnection
                    SqlConnection con = new SqlConnection("Data Source=.\\SQLEXPRESS;Initial Catalog=access;Integrated Security=true;");
                    SqlCommand cmd = new SqlCommand("Select * from tbl_access where username=@username AND password_1=@password", con);
                    cmd.Parameters.AddWithValue("@username", txt_username.Text);
                    cmd.Parameters.AddWithValue("@password", txt_password.Text);
                    con.Open();
                    SqlDataAdapter adapt = new SqlDataAdapter(cmd);
                    DataSet ds = new DataSet();
                    adapt.Fill(ds);
                    con.Close();
                    int count = ds.Tables[0].Rows.Count;
                    string str;

                    str = "select * from tbl_access";
                    SqlCommand com = new SqlCommand(str, con);
                    con.Open();
                    SqlDataReader reader = com.ExecuteReader();


                    if (count == 1)
                    {
                        MessageBox.Show("Login Successful!");
                        this.getTheName(txt_username.Text);
                        this.Hide();
                        Form2 fm = new Form2();
                        fm.Uname = fname.Trim();
                        fm.Lname = lname.Trim();
                        fm.Show();

                    }
                    else
                    {
                        MessageBox.Show("Login Failed!!! Try Again.");
                        txt_username.Text = "";
                        txt_password.Text = "";
                        txt_username.Focus();
                    }

                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }
        }
    }

Form2.cs

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace login
{
    public partial class Form2 : Form
    {
        private String uname;

        public String Uname
        {
            get { return uname; }
            set { uname = value; }
        }

        private String lname;

        public String Lname
        {
            get { return lname; }
            set { lname = value; }
        }

        public Form2()
        {
            InitializeComponent();
        }

        private void btn_logout_Click(object sender, EventArgs e)
        {
            Application.ExitThread();

        }

        private void Form2_Load(object sender, EventArgs e)
        {
            label1.Text = "Welcome " + Uname + " " + Lname;
        }

        private void Form2_FormClosing(object sender, FormClosingEventArgs e)
        {
            Application.ExitThread();
        }
    }
}

SQL Dumb File

access.sql

USE [master]
GO
/****** Object:  Database [access]    Script Date: 11/25/2016 20:39:55 ******/
CREATE DATABASE [access] ON  PRIMARY 
( NAME = N'access', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\access.mdf' , SIZE = 3072KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
 LOG ON 
( NAME = N'access_log', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\access_log.ldf' , SIZE = 1024KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
GO
ALTER DATABASE [access] SET COMPATIBILITY_LEVEL = 100
GO
IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
begin
EXEC [access].[dbo].[sp_fulltext_database] @action = 'enable'
end
GO
ALTER DATABASE [access] SET ANSI_NULL_DEFAULT OFF
GO
ALTER DATABASE [access] SET ANSI_NULLS OFF
GO
ALTER DATABASE [access] SET ANSI_PADDING OFF
GO
ALTER DATABASE [access] SET ANSI_WARNINGS OFF
GO
ALTER DATABASE [access] SET ARITHABORT OFF
GO
ALTER DATABASE [access] SET AUTO_CLOSE OFF
GO
ALTER DATABASE [access] SET AUTO_CREATE_STATISTICS ON
GO
ALTER DATABASE [access] SET AUTO_SHRINK OFF
GO
ALTER DATABASE [access] SET AUTO_UPDATE_STATISTICS ON
GO
ALTER DATABASE [access] SET CURSOR_CLOSE_ON_COMMIT OFF
GO
ALTER DATABASE [access] SET CURSOR_DEFAULT  GLOBAL
GO
ALTER DATABASE [access] SET CONCAT_NULL_YIELDS_NULL OFF
GO
ALTER DATABASE [access] SET NUMERIC_ROUNDABORT OFF
GO
ALTER DATABASE [access] SET QUOTED_IDENTIFIER OFF
GO
ALTER DATABASE [access] SET RECURSIVE_TRIGGERS OFF
GO
ALTER DATABASE [access] SET  DISABLE_BROKER
GO
ALTER DATABASE [access] SET AUTO_UPDATE_STATISTICS_ASYNC OFF
GO
ALTER DATABASE [access] SET DATE_CORRELATION_OPTIMIZATION OFF
GO
ALTER DATABASE [access] SET TRUSTWORTHY OFF
GO
ALTER DATABASE [access] SET ALLOW_SNAPSHOT_ISOLATION OFF
GO
ALTER DATABASE [access] SET PARAMETERIZATION SIMPLE
GO
ALTER DATABASE [access] SET READ_COMMITTED_SNAPSHOT OFF
GO
ALTER DATABASE [access] SET HONOR_BROKER_PRIORITY OFF
GO
ALTER DATABASE [access] SET  READ_WRITE
GO
ALTER DATABASE [access] SET RECOVERY SIMPLE
GO
ALTER DATABASE [access] SET  MULTI_USER
GO
ALTER DATABASE [access] SET PAGE_VERIFY CHECKSUM
GO
ALTER DATABASE [access] SET DB_CHAINING OFF
GO
USE [access]
GO
/****** Object:  Table [dbo].[tbl_access]    Script Date: 11/25/2016 20:39:55 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tbl_access](
[id] [int] IDENTITY(1,1) NOT NULL,
[username] [nchar](100) NULL,
[password_1] [nchar](100) NULL,
[lastname] [nchar](100) NULL,
[firstname] [nchar](100) NULL
) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[tbl_access] ON
INSERT [dbo].[tbl_access] ([id], [username], [password_1], [lastname], [firstname]) VALUES (2, N'allie                                                                                               ', N'iya                                                                                                 ', N'POMPERADA                                                                                           ', N'MA. JUNALLIE                                                                                        ')
INSERT [dbo].[tbl_access] ([id], [username], [password_1], [lastname], [firstname]) VALUES (3, N'iya                                                                                                 ', N'iya                                                                                                 ', N'POMPERADA                                                                                           ', N'JULIANNA RAE                                                                                        ')
INSERT [dbo].[tbl_access] ([id], [username], [password_1], [lastname], [firstname]) VALUES (4, N'jake                                                                                                ', N'123                                                                                                 ', N'POMPERADA                                                                                           ', N'JAKE                                                                                                ')
SET IDENTITY_INSERT [dbo].[tbl_access] OFF







Saturday, November 19, 2016

Rational Numbers in Java

In this article a good friend of mine and a fellow software engineer Mr. Alfel Benvic G. Go would like to share with us his program written using Java programming language in solving Rational Numbers. The source code is well documented and easy to understand. I would like to say thank you very much Sir Bon for sharing your work to us and the rest of programmers around the world who might visiting and reading this blog.

Add me at Facebook my address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com

My mobile number here in the Philippines is 09173084360.


Program Listing


/*(Rational.java)

1. Define a class for rational numbers. A rational number is a number that can be represented as the
quotient of two integers. For example, 1/2, 3/4, 64/2, and so forth are all rational numbers. (By 1/2 and so
on we mean the everyday fraction, not the integer division this expression would produce in a Java
program.) Represent rational numbers as two values of type int, one for the numerator and one for the
denominator. Call the class Rational.
2. Include a constructor with two arguments that can be used to set the member variables of an object to
any legitimate values. Also include a constructor that has only a single parameter of type int; call this
single parameter wholeNumber and define the constructor so that the object will be initialized to the
rational number wholeNumber/1.
3. Include a default constructor that initializes an object to 0 (that is 0/1).
4. Numbers are to be input and output in the form 1/2, 15/32, 300/401, and so forth. Note that the
numerator, the denominator, or both may contain a minus sign, so -1/2, 15/-32, and -300/-401 are also
possible inputs.
5. Write a test program to test your class. Hints: Two rational numbers a/b and c/d are equal if a*d equals
c*b. If b and d are positive rational numbers, a/b is less than c/d provided a*d is less than c*b.
6. You should include a function to normalize the values stored so that, after normalization, the denominator
is positive and the numerator and denominator are as small as possible. For example, after normalization
4/-8 would be represented the same as -1/2.
*/

import java.util.Scanner;

public class Rational { //begin class
private int Numerator;
private int Denominator;

public Rational (int num, int den){
Numerator = num;
Denominator = den;
}

public Rational (int wholeNumber){
this(wholeNumber,1);
}
public Rational(){
this(0);
}
public void Normalize(){
int num = Numerator;
int den = Denominator;
boolean flag = true;

if(den < 0 && num > 0){
num = num*-1;
den = Math.abs(den);
}
else if(den < 0 && num < 0){
num = Math.abs(num); den = Math.abs(den);
}

while(flag){
for(int i = 9; i > 1; i--){
if(num%i == 0 && den%i == 0){
num = num/i;
den = den/i;
}
}
for(int i = 9; i > 1; i--){
if(num%i == 0 && den%i == 0){
flag = true;
break;
}
else
flag = false;
}
}
Numerator = num;
Denominator = den;
}//end while

public void getNumber(){
System.out.print("\n");
System.out.println("Output: ");
System.out.print(Numerator + "/" + Denominator);
System.out.print("\n");
}


//Test Program
public static void main ( String [] args ){
Scanner test = new Scanner(System.in);
System.out.print("  RATIONAL CLASS   ");
System.out.print("\n======================\n");
System.out.print("Input Numerator: ");
int num = test.nextInt();
System.out.print("Input Denominator: ");
int den = test.nextInt();

Rational r = new Rational(num,den);
   //debug();
r.Normalize();
r.getNumber();
}
} //end class

Adding the Sum of a Column of a Table in Visual Foxpro


It has been a very busy week for me and this month I was not able to write my blog in programming most of the time. But anyways in this article I would like to share with you a most common programming problem in creating business applications using Microsoft Visual Foxpro that is how we add the total sum in a column in a table. 

This problem is very common when we purchase a product for example in a grocery store we observe that it sum all the prices of the product we purchase at the end of our receipt. Another example in enrollment system in the enrollment form we can see the total number of units taken by the student in that particular semester. The solution of this problem is quiet very simple there is a built in function in Visual Foxpro called SUM that we can use to sum up all the values in a given column. What is very good about Visual Foxpro programming using this language is very easy and the code is very short that's why until now there still many Visual Foxpro developers around the world still using it in creating business applications.

The program code is very short and I can say self explanatory if you have a good working knowledge in Foxpro or Dbase programming experience. I hope you will find my work useful and thank you.


Add me at Facebook my address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com

My mobile number here in the Philippines is 09173084360.



Database Structure


Sample data stored in the table

Sample Program Output

Program Listing

demo.prg

*** Author : Mr. Jake R. Pomperada, MAED-IT
*** Tool   : Microsoft Visual Foxpro 8.0
*** Date   : November 19, 2016     Saturday


Clear
SELECT item
SUM price TO nTotal

@ 2,1 Say "Total Price is " get ntotal




Sunday, November 13, 2016

Basic Math Operations in Foxpro

In this program it will ask the user to give two numbers and then our Foxpro program will compute the sum, product, difference and quotient of the two given number by our user. The code is very easy to understand and use.

Add me at Facebook my address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com

My mobile number here in the Philippines is 09173084360.


Sample Program Output

Program Listing


** Basic Math in Visual Foxpro
** Written By: Mr. Jake R. Pomperada
** November 13, 2016   Sunday

SET TALK OFF
SET ECHO OFF
CLEAR
STORE 0 TO a
STORE 0 TO b

@ 1,20 Say "Basic Math Operations in Foxpro"
@ 3,1 Say "Enter First Value     : " Get A Pict "9999999"
@ 4,1 Say "Enter Second Value    : " Get B Pict "9999999"
READ
sum_all=a+b
product_all = a * b
diff_all = a - b
quotient_all = ROUND(a /b,2)


@ 6,20 Say "DISPLAY RESULTS"
@ 8,1 Say "The sum is " Get sum_all
@ 9,1 Say "The product is " Get product_all
@ 10,1 Say "The difference is " Get diff_all
@ 11,1 Say "The quotient is  " Get quotient_all

Addition of Two Numbers in Foxpro

In this article I would like to share with you a simple program to add the sum of two numbers using Foxpro as our programming language. Foxpro is considered as database programming language I love this language because this is one of the first language that I have learned to creating database application that is very easy to use and understand.

What does the program will do is to ask the user to give two numbers and display the sum on the screen.

Add me at Facebook my address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com

My mobile number here in the Philippines is 09173084360.



Sample Program Output


Program Listing

** Addition of Two Numbers in Visual Foxpro
** Written By: Mr. Jake R. Pomperada
** November 13, 2016   Sunday

SET TALK OFF
SET ECHO OFF
CLEAR
STORE 0 TO a
STORE 0 TO b

@ 1,20 Say "Addition of Two Numbers"
@ 3,1 Say "Enter First Value     : " Get A Pict "9999"
@ 4,1 Say "Enter Second Value    : " Get B Pict "9999"
READ
sum_all=a+b

@ 6,1 Say "The sum is " Get sum_all

Monday, November 7, 2016

Login System in C# and Microsoft SQL Server

Here is a simple login system that I wrote using C# and Microsoft SQL Server 2008 that can used to protect from one's application from intruder and unauthorized users. The program will ask the username and password and it will check the username and password in our Microsoft SQL Server database if it is valid or not valid. If the credentials are valid it will display a welcome page it not valid it will ask again to give the right credentials in order to gain access to the system. I hope you will find my work useful. Thank you.

Add me at Facebook my address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com

My mobile number here in the Philippines is 09173084360.













Sample Program Output and Database Structures


Program Listing


using System;
using System.Data;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace login
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void btn_close_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Do you want to exit?", "Login System",
         MessageBoxButtons.YesNo, MessageBoxIcon.Question)
         == DialogResult.Yes)
            {
                Application.Exit();
            }
            else
            {
                txt_username.Focus();
            }
        }

        private void btn_ok_Click(object sender, EventArgs e)
        {
             if(txt_username.Text=="" || txt_password.Text=="")
            {
                MessageBox.Show("Please provide UserName and Password");
                return;
            }
            try
            {
                //Create SqlConnection
                SqlConnection con =  new SqlConnection("Data Source=.\\SQLEXPRESS;Initial Catalog=access;Integrated Security=true;");
                SqlCommand cmd = new SqlCommand("Select * from tbl_access where username=@username AND password_1=@password",con);
                cmd.Parameters.AddWithValue("@username",txt_username.Text);
                cmd.Parameters.AddWithValue("@password", txt_password.Text);
                con.Open();
                SqlDataAdapter adapt = new SqlDataAdapter(cmd);
                DataSet ds = new DataSet();
                adapt.Fill(ds);
                con.Close();
                int count = ds.Tables[0].Rows.Count;
                string str;

                 str = "select * from tbl_access";
                SqlCommand com = new SqlCommand(str, con);
                con.Open();
                SqlDataReader reader = com.ExecuteReader();


                if (count == 1)
                {
                    MessageBox.Show("Login Successful!");
                    this.Hide();
                    Form2 fm = new Form2();
                    fm.Show();
                  
                 }
                else
                {
                    MessageBox.Show("Login Failed!!! Try Again.");
                    txt_username.Text = "";
                    txt_password.Text = "";
                    txt_username.Focus();
                }
            }
            catch(Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
        }
    }


SQL DUMB File

USE [master]
GO
/****** Object:  Database [access]    Script Date: 11/07/2016 08:50:06 ******/
CREATE DATABASE [access] ON  PRIMARY 
( NAME = N'access', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\access.mdf' , SIZE = 3072KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
 LOG ON 
( NAME = N'access_log', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\access_log.ldf' , SIZE = 1024KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
GO
ALTER DATABASE [access] SET COMPATIBILITY_LEVEL = 100
GO
IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
begin
EXEC [access].[dbo].[sp_fulltext_database] @action = 'enable'
end
GO
ALTER DATABASE [access] SET ANSI_NULL_DEFAULT OFF
GO
ALTER DATABASE [access] SET ANSI_NULLS OFF
GO
ALTER DATABASE [access] SET ANSI_PADDING OFF
GO
ALTER DATABASE [access] SET ANSI_WARNINGS OFF
GO
ALTER DATABASE [access] SET ARITHABORT OFF
GO
ALTER DATABASE [access] SET AUTO_CLOSE OFF
GO
ALTER DATABASE [access] SET AUTO_CREATE_STATISTICS ON
GO
ALTER DATABASE [access] SET AUTO_SHRINK OFF
GO
ALTER DATABASE [access] SET AUTO_UPDATE_STATISTICS ON
GO
ALTER DATABASE [access] SET CURSOR_CLOSE_ON_COMMIT OFF
GO
ALTER DATABASE [access] SET CURSOR_DEFAULT  GLOBAL
GO
ALTER DATABASE [access] SET CONCAT_NULL_YIELDS_NULL OFF
GO
ALTER DATABASE [access] SET NUMERIC_ROUNDABORT OFF
GO
ALTER DATABASE [access] SET QUOTED_IDENTIFIER OFF
GO
ALTER DATABASE [access] SET RECURSIVE_TRIGGERS OFF
GO
ALTER DATABASE [access] SET  DISABLE_BROKER
GO
ALTER DATABASE [access] SET AUTO_UPDATE_STATISTICS_ASYNC OFF
GO
ALTER DATABASE [access] SET DATE_CORRELATION_OPTIMIZATION OFF
GO
ALTER DATABASE [access] SET TRUSTWORTHY OFF
GO
ALTER DATABASE [access] SET ALLOW_SNAPSHOT_ISOLATION OFF
GO
ALTER DATABASE [access] SET PARAMETERIZATION SIMPLE
GO
ALTER DATABASE [access] SET READ_COMMITTED_SNAPSHOT OFF
GO
ALTER DATABASE [access] SET HONOR_BROKER_PRIORITY OFF
GO
ALTER DATABASE [access] SET  READ_WRITE
GO
ALTER DATABASE [access] SET RECOVERY SIMPLE
GO
ALTER DATABASE [access] SET  MULTI_USER
GO
ALTER DATABASE [access] SET PAGE_VERIFY CHECKSUM
GO
ALTER DATABASE [access] SET DB_CHAINING OFF
GO
USE [access]
GO
/****** Object:  Table [dbo].[tbl_access]    Script Date: 11/07/2016 08:50:06 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tbl_access](
[id] [int] IDENTITY(1,1) NOT NULL,
[username] [nchar](100) NULL,
[password_1] [nchar](100) NULL,
[lastname] [nchar](100) NULL,
[firstname] [nchar](100) NULL,
 CONSTRAINT [PK_tbl_access] PRIMARY KEY CLUSTERED 
(
[id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[tbl_access] ON
INSERT [dbo].[tbl_access] ([id], [username], [password_1], [lastname], [firstname]) VALUES (1, N'jake                                                                                                ', N'123                                                                                                 ', N'POMPERADA                                                                                           ', N'JAKE                                                                                                ')
INSERT [dbo].[tbl_access] ([id], [username], [password_1], [lastname], [firstname]) VALUES (2, N'allie                                                                                               ', N'iya                                                                                                 ', N'POMPERADA                                                                                           ', N'MA. JUNALLIE                                                                                        ')
INSERT [dbo].[tbl_access] ([id], [username], [password_1], [lastname], [firstname]) VALUES (3, N'iya                                                                                                 ', N'iya                                                                                                 ', N'POMPERADA                                                                                           ', N'JULIANNA RAE                                                                                        ')
SET IDENTITY_INSERT [dbo].[tbl_access] OFF