Hi I am currently new in C#, I have finished exercising and studying how to code for console application. Then I plan to do a simple application. I started with a user log in. Where in the form will validate the username and password inputted by the user in an access database and if successful it will show MAIN screen.
Below is my simple code, please help me. I am really stuck with this one once I new how to manipulate the records it will be easier for me. I don't know what to code in my cmdLogin. I cannot access there the datareader. Please help me I really want to learn.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;
namespace Perfume_Biz
{
public partial class Login : Form
{
public Login()
{
InitializeComponent();
string strconn = "Provider=Microsoft.Jet.OLEDB.4.0; Data source=C:\\Perfume.mdb";
string strcmd = "select User_Name,Password from Users";
OleDbConnection OleConn = new OleDbConnection(strconn);
OleDbCommand OleCmd = new OleDbCommand(strcmd, OleConn);
OleConn.Open();
OleDbDataReader OleRead = OleCmd.ExecuteReader();
}
private void cmdcancel_Click(object sender, EventArgs e)
{
Application.Exit();
}
private void cmdclear_Click(object sender, EventArgs e)
{
txtpassword.Text = "";
txtusername.Text = "";
}
private void Login_Load(object sender, EventArgs e)
{
}
private void cmdlogin_Click(object sender, EventArgs e)
{
}
}
}