Click here to Skip to main content
15,887,585 members
Home / Discussions / C#
   

C#

 
GeneralRe: BindingContext question Pin
HarrisonBrock18-Oct-09 12:42
HarrisonBrock18-Oct-09 12:42 
QuestionListboxes etc. on top of video Pin
lvq68418-Oct-09 7:29
lvq68418-Oct-09 7:29 
AnswerRe: Listboxes etc. on top of video Pin
Not Active18-Oct-09 9:26
mentorNot Active18-Oct-09 9:26 
GeneralRe: Listboxes etc. on top of video Pin
lvq68418-Oct-09 22:04
lvq68418-Oct-09 22:04 
QuestionTrying to send email... Pin
JollyMansArt18-Oct-09 6:50
JollyMansArt18-Oct-09 6:50 
AnswerRe: Trying to send email... Pin
Manas Bhardwaj18-Oct-09 9:19
professionalManas Bhardwaj18-Oct-09 9:19 
AnswerRe: Trying to send email... Pin
Not Active18-Oct-09 9:25
mentorNot Active18-Oct-09 9:25 
Questioncheck the text box string dynamically with database field Pin
Mangesh Tomar18-Oct-09 6:22
Mangesh Tomar18-Oct-09 6:22 
in my program i am developing login for user for standalone system
here i check the condition whether the user is valid or not ?
In my data base i store some name and passward and check whethre it present in database or not but my prog check only one user eg. Admin and passward
ie. problem in condition checking i want prog. who check other user also ie. if i type diffrent user name such as xyz and pssw. too so how i check this value in data base .
Here is my code:-


namespace loginscreen
{
public partial class Form1 : Form
{
OleDbCommand cmd = new OleDbCommand();
OleDbConnection con = new OleDbConnection();

String Path = "Provider= Microsoft.Jet.OLEDB.4.0; Data Source= C:\\sms.mdb; Persist Security Info=False";
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{

con = new OleDbConnection(Path);
cmd = new OleDbCommand(" select * from login ", con);
con.Open();
OleDbDataReader reader = cmd.ExecuteReader();

string usernamedb, passwarddb;
string passwardtxtbx, usernametxtbx;

usernametxtbx = tbName.Text.ToString();
passwardtxtbx = tbPassward.Text.ToString();


while (reader.Read())
{
usernamedb = (reader.GetString(0));
passwarddb = (reader.GetString(1));


if (tbName.Text == "Admin")
{
if (tbName.Text == reader.GetString(0))
{
if (tbPassward.Text == reader.GetString(1))
{
MessageBox.Show("login successfully");
return;

}
else
{
MessageBox.Show("Try Again");
return;
}
}
}
}
con.Close();
}

}

}
AnswerRe: check the text box string dynamically with database field Pin
Luc Pattyn18-Oct-09 11:11
sitebuilderLuc Pattyn18-Oct-09 11:11 
QuestionPass Excel.Application from Excel 2007 Custom Task Pane to Hosted PowerShell Pin
Uros Calakovic18-Oct-09 4:07
Uros Calakovic18-Oct-09 4:07 
QuestionSubReport in Win Form (RDLC) Pin
Abdul Rahman Hamidy18-Oct-09 3:20
Abdul Rahman Hamidy18-Oct-09 3:20 
AnswerRe: SubReport in Win Form (RDLC) Pin
Christopher Stratmann17-Apr-10 18:22
Christopher Stratmann17-Apr-10 18:22 
QuestionOpen RTF file in MS Word & WordPad Pin
Jassim Rahma18-Oct-09 3:18
Jassim Rahma18-Oct-09 3:18 
AnswerRe: Open RTF file in MS Word & WordPad Pin
0x3c018-Oct-09 3:34
0x3c018-Oct-09 3:34 
AnswerRe: Open RTF file in MS Word & WordPad Pin
DaveyM6918-Oct-09 3:35
professionalDaveyM6918-Oct-09 3:35 
AnswerRe: Open RTF file in MS Word & WordPad Pin
Luc Pattyn18-Oct-09 11:14
sitebuilderLuc Pattyn18-Oct-09 11:14 
QuestionGenerate sql select statement from another select statement Pin
AhmedMasum18-Oct-09 3:02
AhmedMasum18-Oct-09 3:02 
AnswerRe: Generate sql select statement from another select statement Pin
Not Active18-Oct-09 3:38
mentorNot Active18-Oct-09 3:38 
GeneralRe: Generate sql select statement from another select statement Pin
AhmedMasum18-Oct-09 15:33
AhmedMasum18-Oct-09 15:33 
GeneralRe: Generate sql select statement from another select statement Pin
Luc Pattyn18-Oct-09 16:14
sitebuilderLuc Pattyn18-Oct-09 16:14 
GeneralRe: Generate sql select statement from another select statement Pin
AhmedMasum18-Oct-09 17:09
AhmedMasum18-Oct-09 17:09 
GeneralRe: Generate sql select statement from another select statement Pin
Luc Pattyn18-Oct-09 18:04
sitebuilderLuc Pattyn18-Oct-09 18:04 
GeneralRe: Generate sql select statement from another select statement Pin
AhmedMasum18-Oct-09 18:41
AhmedMasum18-Oct-09 18:41 
GeneralRe: Generate sql select statement from another select statement Pin
Luc Pattyn19-Oct-09 2:08
sitebuilderLuc Pattyn19-Oct-09 2:08 
GeneralRe: Generate sql select statement from another select statement Pin
AhmedMasum19-Oct-09 4:28
AhmedMasum19-Oct-09 4:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.