TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Israel
693
1.3k
219.4k
Doesnt obey to update?
Sep 15 2015 7:25 AM
Hi!
I have a little bit confusion. I need to update at the same time at diferente database. The condition is when the code is egal on what that "combobox" then update. Curiosly its doenst obey... Means that even I choose any another code its still update. That is wrong!
Its should update ONLY when the code is the same as I choose (or write) into the combobox:
private void button4_Click(object sender, EventArgs e)
{
conn.Open();
OleDbParameter jan = new OleDbParameter("@january", SqlDbType.VarChar);
OleDbParameter cod = new OleDbParameter("@cod", SqlDbType.VarChar);
comm.Parameters.Add(jan);
comm.Parameters.Add(cod);
jan.Value = "PAYED";
cod.Value = cbxCod.Text;
comm.Connection = conn;
comm.CommandText = "UPDATE bill SET january = ? WHERE codcliente = @cod";
comm.ExecuteNonQuery();
//{
// conn.Close();
//}
/////////////////////////////////////////
OleDbParameter janregist = new OleDbParameter("@jan", SqlDbType.VarChar);
OleDbParameter codclienteregist = new OleDbParameter("@codcliente", SqlDbType.VarChar);
comm.Parameters.Add(janregist);
comm.Parameters.Add(codclienteregist);
janregist.Value = "PAYED";
codclienteregist.Value = cbxCod.Text;
comm.Connection = conn;
comm.CommandText = "UPDATE registration SET jan = ? WHERE codcliente = @codcliente";
comm.ExecuteNonQuery();
{
conn.Close();
}
Reply
Answers (
2
)
Class & Object
Object