Click here to Skip to main content
15,921,884 members
Home / Discussions / C#
   

C#

 
GeneralRe: code complies blows sky high on button OK click Pin
Anonymous15-Sep-05 16:34
Anonymous15-Sep-05 16:34 
GeneralRe: code complies blows sky high on button OK click Pin
Christian Graus15-Sep-05 16:55
protectorChristian Graus15-Sep-05 16:55 
GeneralRe: code complies blows sky high on button OK click Pin
Anonymous15-Sep-05 18:18
Anonymous15-Sep-05 18:18 
GeneralRe: code complies blows sky high on button OK click Pin
Christian Graus18-Sep-05 10:57
protectorChristian Graus18-Sep-05 10:57 
AnswerRe: code complies blows sky high on button OK click Pin
Guffa15-Sep-05 19:18
Guffa15-Sep-05 19:18 
Questioncan't get variable into Watch Window? Pin
Anonymous15-Sep-05 14:18
Anonymous15-Sep-05 14:18 
AnswerRe: can't get variable into Watch Window? Pin
Christian Graus15-Sep-05 14:20
protectorChristian Graus15-Sep-05 14:20 
QuestionProblem with database Pin
kavicky15-Sep-05 13:49
kavicky15-Sep-05 13:49 
I have written code with a single database table with front end in c#.
I am able to make changes in table by using the update statment. But after i exit out of the application I am not able to login with the same user name and pwd that I could before.
Pasting my login page code and the update query code...can anyone help me plz

private void button1_Click(object sender, System.EventArgs e)

{
try
{

oleDbConnection1.Open();

oleDbDataAdapter1.SelectCommand.CommandText = "Select User, PIN
from BankAccount where User = '" + UsertextBox.Text + "'"+
" And PIN= '" +
PINtextBox.Text + "'";

oleDbDataAdapter1.Fill(dataSet1);

DataTable datatable=dataSet1.Tables[0];

if(UsertextBox.Text == (string)datatable.Rows[0][0] && PINtextBox.Text== (string)datatable.Rows[0][1])

{
string user= UsertextBox.Text;
AccountForm Af = new AccountForm(user);
Af.Show();
}
else
{
label1.Text="Invalid User Name or Password";
}

}
catch(System.Data.OleDb.OleDbException ole)
{
MessageBox.Show( ole.ToString());
}
finally
{
oleDbConnection1.Close();
}
}

And in the second form I have this Update query method


private void button3_Click(object sender, System.EventArgs e)
{

try
{
oleDbConnection1.Open();

if( Acc_textbox.Text != " ")

{

int creditbalance = Int32.Parse(textBox3.Text);
//label7.Text=creditbalance.ToString();

oleDbDataAdapter1.UpdateCommand.CommandText=
" Update BankAccount SET " +
"FirstName = '" + textBox2.Text+
" ', LastName ='"+ textBox1.Text+
"', IntialBalance = " + creditbalance+
" , PIN ='"+ textBox4.Text+
" ', PhoneNumber= " + Int32.Parse(textBox5.Text)+
" , Address ='"+ textBox6.Text+
" ', City ='"+ textBox7.Text+
" ', State ='"+ textBox8.Text+
" ', SSN ='"+ textBox9.Text+
" ' where User = '" + Acc_textbox.Text + "'";

statustextbox.Text += "\r\n Sending Query "+
oleDbDataAdapter1.UpdateCommand.CommandText + "\r\n";

oleDbDataAdapter1.UpdateCommand.ExecuteNonQuery();
statustextbox.Text +="\r\n Query Successful";
}
else

statustextbox.Text +="\r\n Query not Successful";


}
catch(System.Data.OleDb.OleDbException ole)
{
statustextbox.Text += ole.ToString();
}
finally
{
oleDbConnection1.Close();
}

}

AnswerRe: Problem with database Pin
Christian Graus15-Sep-05 14:23
protectorChristian Graus15-Sep-05 14:23 
QuestionEvent handlers in multi-threaded apps Pin
brucemo15-Sep-05 13:32
brucemo15-Sep-05 13:32 
AnswerRe: Event handlers in multi-threaded apps Pin
brucemo15-Sep-05 13:57
brucemo15-Sep-05 13:57 
GeneralRe: Event handlers in multi-threaded apps Pin
brucemo15-Sep-05 14:35
brucemo15-Sep-05 14:35 
AnswerRe: Event handlers in multi-threaded apps Pin
Judah Gabriel Himango15-Sep-05 15:27
sponsorJudah Gabriel Himango15-Sep-05 15:27 
AnswerRe: Event handlers in multi-threaded apps Pin
leppie15-Sep-05 16:12
leppie15-Sep-05 16:12 
GeneralRe: Event handlers in multi-threaded apps Pin
brucemo15-Sep-05 17:07
brucemo15-Sep-05 17:07 
GeneralRe: Event handlers in multi-threaded apps Pin
Andy Brummer15-Sep-05 17:38
sitebuilderAndy Brummer15-Sep-05 17:38 
GeneralRe: Event handlers in multi-threaded apps Pin
brucemo15-Sep-05 21:29
brucemo15-Sep-05 21:29 
QuestionA Specific Control Query Pin
udaan15-Sep-05 12:41
udaan15-Sep-05 12:41 
AnswerRe: A Specific Control Query Pin
Guffa15-Sep-05 13:46
Guffa15-Sep-05 13:46 
QuestionRichTextbox to send and receive data Pin
Ralf Hägenläuer15-Sep-05 10:09
Ralf Hägenläuer15-Sep-05 10:09 
QuestionDataSet Select statment Pin
zaboboa15-Sep-05 8:51
zaboboa15-Sep-05 8:51 
AnswerRe: DataSet Select statment Pin
Turtle Hand15-Sep-05 9:21
Turtle Hand15-Sep-05 9:21 
AnswerRe: DataSet Select statment Pin
Carl Mercier15-Sep-05 9:48
Carl Mercier15-Sep-05 9:48 
QuestionActiveReports +C# Pin
Agyeman15-Sep-05 8:33
Agyeman15-Sep-05 8:33 
Questionshort/easy question Pin
Lapje15-Sep-05 8:27
Lapje15-Sep-05 8:27 

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.