Click here to Skip to main content
15,911,711 members
Home / Discussions / C#
   

C#

 
AnswerRe: name of Language Pin
sharpiesharpie14-Feb-07 18:27
sharpiesharpie14-Feb-07 18:27 
GeneralRe: name of Language Pin
M Riaz Bashir14-Feb-07 18:36
M Riaz Bashir14-Feb-07 18:36 
GeneralRe: name of Language [modified] Pin
blackjack215014-Feb-07 22:34
blackjack215014-Feb-07 22:34 
QuestionString to Byte Conversion Pin
DavidMcP14-Feb-07 17:29
DavidMcP14-Feb-07 17:29 
AnswerRe: String to Byte Conversion Pin
stancrm14-Feb-07 20:09
stancrm14-Feb-07 20:09 
QuestionI am confiused and need your help with Windows Installer Pin
Khoramdin14-Feb-07 15:41
Khoramdin14-Feb-07 15:41 
AnswerRe: I am confiused and need your help with Windows Installer Pin
Syed Shahid Hussain14-Feb-07 18:27
Syed Shahid Hussain14-Feb-07 18:27 
QuestionLogin Class for C# Pin
allan.gagnon14-Feb-07 15:27
allan.gagnon14-Feb-07 15:27 
Hello I am an newbie in C# and I am making a program for our office and need to develop a class in c# that I can use for a login form. The table I have is very simple for username and password. It has a UserID which is a primary key and a password I dont care about the username just as long as they type in the right password. I also have a bool column that is IsLoggedIn. I have to set the IsLoggedIn in the table to true once the password has been typed in right. There will only be 4 possible logins or passwords.

I have a connection to the database like this:

public static void Login(String LoginBox)
//{
// string strConn, strSQL;
// strConn = @"Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Documents and Settings\admin\My Documents\Visual Studio 2005\Projects\GasCabinetSimulator\GasCabinetSimulator\GasCabinet.mdf;Integrated Security=True;User Instance=True";
// strSQL = "SELECT UserID, PassWord, IsLoggedIn FROM tblLogin";
// using (SqlConnection cn = new SqlConnection(strConn))
// {
// try
// {
// cn.Open();
// }
// catch (SqlException ex)
// {
// MessageBox.Show("Connect Attempt Failed");
// MessageBox.Show(ex.Message);
// return;
// }
// using (SqlCommand cmd = new SqlCommand(strSQL, cn))
// {
// try
// {
// using (SqlDataReader rdr = cmd.ExecuteReader())
// {
// while (rdr.Read())
// if (LoginBox == rdr["PassWord"].ToString())
// {
// MessageBox.Show("Login successful","Login Success",MessageBoxButtons.OK,MessageBoxIcon.Information);
// //rdr["IsLoggedIn"] = true;
// }

// rdr.Close();
// }
// }
// catch (SqlException ex)
// {
// MessageBox.Show("Query failed");
// MessageBox.Show(ex.Message);
// return;
// }

// }

// cn.Close();

However it is readonly and I cant change the IsLoggedIn column and I get a box for each username or password until it is either the right one or the wrong one totally.D'Oh! | :doh:

Allan F. Gagnon

AnswerRe: Login Class for C# Pin
Christian Graus14-Feb-07 16:56
protectorChristian Graus14-Feb-07 16:56 
GeneralRe: Login Class for C# Pin
allan.gagnon15-Feb-07 3:17
allan.gagnon15-Feb-07 3:17 
GeneralRe: Login Class for C# Pin
Christian Graus15-Feb-07 8:10
protectorChristian Graus15-Feb-07 8:10 
GeneralRe: Login Class for C# Pin
allan.gagnon15-Feb-07 8:45
allan.gagnon15-Feb-07 8:45 
QuestionGirdview Template field problem Pin
SharonRao14-Feb-07 13:42
SharonRao14-Feb-07 13:42 
QuestionStartup - Triggering events Pin
Glen Harvy14-Feb-07 12:56
Glen Harvy14-Feb-07 12:56 
AnswerRe: Startup - Triggering events Pin
Luc Pattyn14-Feb-07 14:59
sitebuilderLuc Pattyn14-Feb-07 14:59 
QuestionMaking a count of unique elements in an array Pin
TrooperIronMan14-Feb-07 12:34
TrooperIronMan14-Feb-07 12:34 
AnswerRe: Making a count of unique elements in an array Pin
Luc Pattyn14-Feb-07 12:43
sitebuilderLuc Pattyn14-Feb-07 12:43 
GeneralRe: Making a count of unique elements in an array Pin
TrooperIronMan14-Feb-07 14:28
TrooperIronMan14-Feb-07 14:28 
GeneralRe: Making a count of unique elements in an array Pin
Luc Pattyn14-Feb-07 14:54
sitebuilderLuc Pattyn14-Feb-07 14:54 
GeneralRe: Making a count of unique elements in an array Pin
TrooperIronMan15-Feb-07 3:32
TrooperIronMan15-Feb-07 3:32 
GeneralRe: Making a count of unique elements in an array Pin
Guffa14-Feb-07 15:11
Guffa14-Feb-07 15:11 
GeneralRe: Making a count of unique elements in an array Pin
TrooperIronMan15-Feb-07 13:22
TrooperIronMan15-Feb-07 13:22 
QuestionFlash video files Pin
alostdruid14-Feb-07 11:18
alostdruid14-Feb-07 11:18 
QuestionSerial Communication using SerialDataReceivedEventHandler Pin
cocoonwls14-Feb-07 10:42
cocoonwls14-Feb-07 10:42 
QuestionCreate report ... Word / pdf or new form Pin
Rick van Woudenberg14-Feb-07 10:15
Rick van Woudenberg14-Feb-07 10:15 

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.