Using Using Using Using Using Using Using Using Using Namespace Public Partial Class Public
Using Using Using Using Using Using Using Using Using Namespace Public Partial Class Public
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
//using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.IO;
namespace WindowsApplication3
{
public partial class frmUserAuthenticate : Form
{
SqlConnection con,con1;
public frmUserAuthenticate()
{
InitializeComponent();
}
private void frmUserAuthenticate_Load(object sender, EventArgs e)
{
try
{
con = new SqlConnection(DB.Getcon());
con.Open();
txtUserId.Focus();
}
catch (SqlException ex)
{
MessageBox.Show(ex.Message);
}
}
private void button1_Click(object sender, EventArgs e)
{
try
{
bool Ok = false;
SqlCommand com = new SqlCommand("select * from Emp",con);
SqlDataReader dr = com.ExecuteReader();
if (dr.Read())
{
Form1 frm = new Form1();
string UserId = txtUserId.Text;
frm.lblUserId.Text = UserId;
byte[] b;
b = (byte[])dr["img"];
MemoryStream ms = new MemoryStream();
ms = new MemoryStream(b);
frm.ImgClicked.Image = Image.FromStream(ms);
frm.ImgClicked.SizeMode = PictureBoxSizeMode.StretchImage;
frm.Show();
Ok = true;
}
dr.Close();
if (!Ok)
{
MessageBox.Show("Invalid UserID/Password");
return;
}
}
catch (SqlException ex)
{
MessageBox.Show(ex.Message);
}
}
private void glassButton2_Click(object sender, EventArgs e)
{
con1=new SqlConnection(DB.Getcon());
try
{
int count = 0;
string id = txtUserId.Text;
string pass = txtPass.Text;
}
catch (SqlException ex)
{
MessageBox.Show(ex.Message);
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
//using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Data.SqlClient;
namespace WindowsApplication3
MessageBox.Show(ex.Message);
}
}
private void frmAdmin_Load(object sender, EventArgs e)
{
try
{
con = new SqlConnection(DB.Getcon());
con.Open();
}
catch (SqlException ex)
{
MessageBox.Show(ex.Message);
/*byte[] b2;
b2 = (byte[])dr["imgThumb"];
MemoryStream ms2 = new MemoryStream();