-
DB Updating
I'm trying to save my changes back to the database but apparently this update command doesn't work. I haven't done too much into programming with DB's but my teacher pretty much just threw the work at us and left. I was wondering what I'm doing wrong here. It won't let me update saying that I need a proper UpdateCommand or something like that. Anyone know what I gotta do? Thanks
Public Sub saveToDB()
Dim i As Integer
Dim f As fruitInfo
For i = 0 To (fruit.Count - 1)
f = fruit(i)
If (dt.Rows.Count - 1) < i Then
MsgBox("I got here dee dee dee")
dt.NewRow()
dt.Rows(i)("sold in winter") = False
dt.Rows(i)("sold in spring") = False
dt.Rows(i)("sold in summer") = False
dt.Rows(i)("sold in autumn") = False
dt.Rows(i)("Stocked by vendor") = False
dt.Rows(i)("stocked by bibby") = False
dt.Rows(i)("forecasting") = False
dt.Rows(i)("sales ytd") = False
dt.Rows(i)("physical inventory") = False
Else
dt.Rows(i)("sold in winter") = f.winter
dt.Rows(i)("sold in spring") = f.spring
dt.Rows(i)("sold in summer") = f.summer
dt.Rows(i)("sold in autumn") = f.autumn
dt.Rows(i)("Stocked by vendor") = f.vendorStock
dt.Rows(i)("stocked by bibby") = f.bibbyStock
dt.Rows(i)("forecasting") = f.forecasting
dt.Rows(i)("sales ytd") = f.salesYTD
dt.Rows(i)("physical inventory") = f.physInventory
End If
dt.Rows(i)("name") = f.name
dt.Rows(i)("keyword") = f.keyword
dt.Rows(i)("price") = f.price
dt.Rows(i)("Qty on hand") = f.onHandQty
dt.Rows(i)("qty on shelf") = f.onShelfQty
dt.Rows(i)("qty in back") = f.inBackQty
dt.Rows(i)("shelving qty") = f.shelvingQty
dt.Rows(i)("safety stock") = f.safetyQty
dt.Rows(i)("economic order qty") = f.economicOrder
dt.Rows(i)("minimum order qty") = f.minOrder
dt.Rows(i)("sales cur period") = f.salesCurP
dt.Rows(i)("sales last period") = f.salesLasP
dt.Rows(i)("sales prior period") = f.salesPriP
dt.Rows(i)("qty pilfered") = f.pilferedQty
dt.Rows(i)("qty wasted") = f.wastedQty
Next
dataAdapter.Update(dt)
End Sub
Similar Threads
-
By newbjohny in forum .NET
Replies: 1
Last Post: 08-01-2006, 12:08 PM
-
By Caroline in forum VB Classic
Replies: 2
Last Post: 03-23-2002, 11:21 PM
-
By Jade29 in forum VB Classic
Replies: 3
Last Post: 01-12-2002, 10:12 PM
-
By Zoo in forum VB Classic
Replies: 3
Last Post: 05-30-2001, 08:44 AM
-
By Nick Jones in forum VB Classic
Replies: 2
Last Post: 03-20-2000, 10:07 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks