Click here to Skip to main content
16,015,679 members
Home / Discussions / C#
   

C#

 
GeneralRe: Notify User From Server Pin
Gerry Schmitz23-Mar-20 6:24
mveGerry Schmitz23-Mar-20 6:24 
QuestionCreate Custom File Property/Attribute Pin
Kevin Marois22-Mar-20 9:30
professionalKevin Marois22-Mar-20 9:30 
AnswerRe: Create Custom File Property/Attribute Pin
Tony Hill22-Mar-20 10:02
professionalTony Hill22-Mar-20 10:02 
AnswerRe: Create Custom File Property/Attribute Pin
OriginalGriff22-Mar-20 10:14
mveOriginalGriff22-Mar-20 10:14 
GeneralRe: Create Custom File Property/Attribute Pin
Kevin Marois22-Mar-20 13:02
professionalKevin Marois22-Mar-20 13:02 
AnswerRe: Abuse Standard File Property/Attribute Pin
Luc Pattyn22-Mar-20 10:36
sitebuilderLuc Pattyn22-Mar-20 10:36 
GeneralRe: Abuse Standard File Property/Attribute Pin
Kevin Marois22-Mar-20 13:04
professionalKevin Marois22-Mar-20 13:04 
Questionupdate problem Pin
ago248619-Mar-20 23:31
ago248619-Mar-20 23:31 
Quote:
hello gentlemen and thank you to you who bring me your help. I am almost at the end of my program and I have an update problem. I don't see any change in my stock.
I have no error when I validate but the quantity does not change in the access database


C#
for (int i = 0; i < dataGridView1.Rows.Count; i++) //Car tu fais une infériorité stricte
                               {
                                   ref_prod = Convert.ToString(dataGridView1.Rows[i].Cells[0].Value);
                                   Qte_prod = Convert.ToInt64(dataGridView1.Rows[i].Cells[1].Value);

                                   using (OleDbCommand cmd3 = sql_con.CreateCommand())
                                   {

                                       cmd3.CommandText = "INSERT INTO Detail_commandes (com_det, ref_det, qute_det) VALUES (@com_det,@ref_det,@qute_det)";
                                       cmd3.Parameters.AddWithValue("@com_det", TxtNunCmd.Text);
                                       cmd3.Parameters.AddWithValue("@ref_det", ref_prod);
                                       cmd3.Parameters.AddWithValue("@qute_det", Qte_prod);
                                       sql_con.Open();
                                       cmd3.ExecuteNonQuery();
                                       sql_con.Close();

                                   }

                                   using (OleDbCommand cmd4 = sql_con.CreateCommand())
                                   {
                                       //setConnection();
                                       OleDbCommand QteStock = sql_con.CreateCommand();
                                       QteStock.CommandText = "SELECT Quantite FROM Catalogue";
                                       sql_con.Open();
                                       int LastQteStock = Convert.ToInt32(QteStock.ExecuteScalar());
                                       sql_con.Close();
                                       cmd4.CommandText = "UPDATE Catalogue SET Quantite = @Quantite - @QteStc WHERE code_article = (@code_article)";
                                       cmd4.Parameters.AddWithValue("@Quantite", LastQteStock);
                                       cmd4.Parameters.AddWithValue("@QteStc", Qte_prod);
                                       cmd4.Parameters.AddWithValue("@code_article", TxtRefProduit.Text);
                                       sql_con.Open();
                                       cmd4.ExecuteNonQuery();
                                       sql_con.Close();

                                   }
                           }

AnswerRe: update problem Pin
OriginalGriff20-Mar-20 0:03
mveOriginalGriff20-Mar-20 0:03 
GeneralRe: update problem Pin
ago248620-Mar-20 0:08
ago248620-Mar-20 0:08 
GeneralRe: update problem Pin
ago248620-Mar-20 2:52
ago248620-Mar-20 2:52 
GeneralRe: update problem Pin
OriginalGriff20-Mar-20 3:00
mveOriginalGriff20-Mar-20 3:00 
GeneralRe: update problem Pin
ago248620-Mar-20 3:10
ago248620-Mar-20 3:10 
Questionproblem to make a second recording Pin
ago248618-Mar-20 23:58
ago248618-Mar-20 23:58 
AnswerRe: problem to make a second recording Pin
OriginalGriff19-Mar-20 0:06
mveOriginalGriff19-Mar-20 0:06 
GeneralRe: problem to make a second recording Pin
ago248619-Mar-20 0:29
ago248619-Mar-20 0:29 
GeneralRe: problem to make a second recording Pin
OriginalGriff19-Mar-20 0:35
mveOriginalGriff19-Mar-20 0:35 
GeneralRe: problem to make a second recording Pin
ago248619-Mar-20 0:48
ago248619-Mar-20 0:48 
GeneralRe: problem to make a second recording Pin
OriginalGriff19-Mar-20 0:52
mveOriginalGriff19-Mar-20 0:52 
GeneralRe: problem to make a second recording Pin
ago248619-Mar-20 0:59
ago248619-Mar-20 0:59 
GeneralRe: problem to make a second recording Pin
ago248619-Mar-20 2:06
ago248619-Mar-20 2:06 
GeneralRe: problem to make a second recording Pin
OriginalGriff19-Mar-20 2:26
mveOriginalGriff19-Mar-20 2:26 
GeneralRe: problem to make a second recording Pin
ago248619-Mar-20 3:04
ago248619-Mar-20 3:04 
GeneralRe: problem to make a second recording Pin
OriginalGriff19-Mar-20 3:22
mveOriginalGriff19-Mar-20 3:22 
GeneralRe: problem to make a second recording Pin
ago248619-Mar-20 3:27
ago248619-Mar-20 3: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.