0% found this document useful (0 votes)
25 views1 page

Login Best

The document contains C# code for a login form that connects to a SQL database and validates a username and password against a login table.

Uploaded by

aksumgere
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views1 page

Login Best

The document contains C# code for a login form that connects to a SQL database and validates a username and password against a login table.

Uploaded by

aksumgere
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

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;
using System.Data.SqlClient;
using System.Data;

namespace AKU
{
public partial class Login : Form
{
public Login()
{
InitializeComponent();
}

private void btnExit_Click(object sender, EventArgs e)


{
this.Close();
}

private void button1_Click(object sender, EventArgs e)


{
SqlConnection con = new SqlConnection(@"Data Source=(local);Initial
Catalog=AKU;Integrated Security=True");
SqlDataAdapter Login = new SqlDataAdapter("Select from Login where
username='"+textBox1.Text + "'and password='" +textBox2.Text+"' ", con);
DataTable dt = new System.Data.DataTable();
Login.Fill(dt);
if (dt.Rows.Count == 1)
{
}
}
}
}

You might also like