0% found this document useful (0 votes)
19 views3 pages

Dijkstras - HTML: Using Using Using Using Using Using Using Using Using Using

This document contains C# code for a Windows Forms application that connects to a SQL database table called "sajid_table" and checks the username and password entered in text boxes against columns in the table. If a matching row is found, a message box displays "Correct", otherwise it displays "End". The code opens a SQL connection, defines a command to select from the table with parameterized values for the username and password columns, executes the reader and checks if any rows were returned.

Uploaded by

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

Dijkstras - HTML: Using Using Using Using Using Using Using Using Using Using

This document contains C# code for a Windows Forms application that connects to a SQL database table called "sajid_table" and checks the username and password entered in text boxes against columns in the table. If a matching row is found, a message box displays "Correct", otherwise it displays "End". The code opens a SQL connection, defines a command to select from the table with parameterized values for the username and password columns, executes the reader and checks if any rows were returned.

Uploaded by

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

https://www.facebook.

com/help/36519476354657

see-programming.blogspot.com/2013/05/c-program-to-implementdijkstras.html

http://scanftree.com/Data_Structure/prim's-algorithm

http://see-programming.blogspot.com/2013/05/closed-hashing-doublehashing.html

http://electrofriends.com/source-codes/software-programs/c/data-structuresc/c-program-for-infix-to-postfix-conversion/

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;

namespace WindowsFormsApplication3
{
public partial class Form1 : Form

{
public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)


{

SqlConnection con = new SqlConnection("Server=AAA;database=Log;Integrated


Security=true");
SqlCommand com = new SqlCommand("SELECT * FROM sajid_table WHERE
username=@sajid and password=@1 ", con);
con.Open();
com.Parameters.AddWithValue("@sajid", TextBoxUser.Text);
com.Parameters.AddWithValue("@1", TextBoxUser.Text);
SqlDataReader Dr = com.ExecuteReader();
if (Dr.HasRows == true)
{
MessageBox.Show("Correct");
}
else
{
MessageBox.Show("End");
}

}
}

You might also like