asp.net - how to update a column( in SQL) by adding a specific amount to the old one? -


उस कोड को ...

  SQL = string.Format ("ऑर्डर में सम्मिलित करें (एआईडी, ओडीट) मान ({0}, '{1}') ", एआईडी, ओडेट); Dbase.ChangeTable (एसक्यूएल, "डाटाबेस 1। एमडीबी"); एसक्यूएल = "ऑर्डर से अधिकतम ऑडियंस के रूप में अधिकतम (ओआईडी) चुनें"; Dt = Dbase.SelectFromTable (SQL, "Database1.mdb"); ओआईडी = डीटी। आरओ [0] [0] .ओस्ट्रिंग (); स्ट्रिंग पीआईडी ​​= सत्र ["पीआईडी"]। टूस्ट्रिंग (); एसक्यूएल = स्ट्रिंग। फॉर्मेट ("लिस्टेड प्रोडक्ट्स (ओआईडी, पीआईडी, पीसीट, सीएनटी) मान ({0}, {1}, '{2}', {3})", ओआईडी, पीआईडी, "बी", सीएनटी में डालें ); Dbase.ChangeTable (एसक्यूएल, "डाटाबेस 1। एमडीबी"); Label6.Text = "आपके उत्पाद को आपके टोकरी में जोड़ दिया गया है, & lt; a href = \" MyBasket.aspx \ "& gt; आपके टोकरी & lt; / a & gt; आपके आदेश को प्रतिबद्ध करने के लिए जाएं।"; // HEREEEEEEE /// SQL = String.Format ("अद्यतन [आदेश] SET [मूल्य] = [मूल्य] + {0} कहां [OID] = {1}", int.Parse (cnt) * PR, OID) ; // SQL = "अद्यतन [आदेश] SET [मूल्य] =" + Int.Parse (cnt) * PR + "WHERE OID =" + OID; //////////////// Dbase.ChangeTable (SQL, "Database1.mdb");   

तो यह काम करना चाहिए और यह मुझे एक त्रुटि दिखाती नहीं है लेकिन यह डेटाबेस को कुछ भी जोड़ नहीं देता है, लेकिन अगर मैं इसे जोड़ना चाहूँगा तो यह अपडेट हो जाएगा।

मेरे डेटाबेस में ओडीट, मूल्य, एआईडी ..

एसक्यूएल आदेश मैन्युअल रूप से चलाएं और सुनिश्चित करें कि आपका तर्क सही है ... यह संभव है कि आपका अपडेट चालू हो रहा है, लेकिन आपके WHERE के बाद से कुछ भी नहीं कर रहा है, जहां आप OID नहीं पा रहे हैं।

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -