|
-
Jul 20th, 2011, 08:25 PM
#1
Thread Starter
Junior Member
datagrid for loop
Pls help me on how to make loop in datagrid to save values that is in datagrid,
because I only know how in listview.
Pls help me.
Here's my code using for loop in LISTVIEW
Code:
For lngI = 1 To Listview1.ListItems.Count
sql7 = "UPDATE [CREW02JOINERIMPORT] SET [CREW02JOINERIMPORT].OTHR = " & Listview1.ListItems(lngI).ListSubItems(71) & ", [CREW02JOINERIMPORT].DSA = " & Listview1.ListItems(lngI).ListSubItems(72) & ", [CREW02JOINERIMPORT].DLP = " & Listview1.ListItems(lngI).ListSubItems(73) & ", [CREW02JOINERIMPORT].LSBPRESENT = " & Listview1.ListItems(lngI).ListSubItems(74) & ", [CREW02JOINERIMPORT].LSBNEXT = " & Listview1.ListItems(lngI).ListSubItems(75) & ", [CREW02JOINERIMPORT].LSBNEXTDATE = '" & Listview1.ListItems(lngI).ListSubItems(76) & "', [CREW02JOINERIMPORT].HOMEALLOT1 = " & Listview1.ListItems(lngI).ListSubItems(77) & ", [CREW02JOINERIMPORT].HOMEALLOT2 = " & Listview1.ListItems(lngI).ListSubItems(78) & ", [CREW02JOINERIMPORT].HOMEALLOT1BANK = '" & Listview1.ListItems(lngI).ListSubItems(79) & "',[CREW02JOINERIMPORT].HOMEALLOT2BANK = '" & Listview1.ListItems(lngI).ListSubItems(80) & "',[CREW02JOINERIMPORT].UNIONDUE = " & Listview1.ListItems(lngI).ListSubItems(81) & " " & _
"WHERE ([CREW02JOINERIMPORT].NO = " & Listview1.ListItems(lngI).ListSubItems(2) & ")"
CONL.Execute sql7
Next lngI
Thank you in advance
Last edited by kenichicka; Jul 20th, 2011 at 09:44 PM.
-
Jul 20th, 2011, 09:40 PM
#2
Thread Starter
Junior Member
-
Jul 20th, 2011, 11:39 PM
#3
Re: datagrid for loop
datagrid is bounded with database, when u edit in datagrid, the database wil be updated automaticaly.
-
Jul 21st, 2011, 02:06 AM
#4
Thread Starter
Junior Member
Re: datagrid for loop
The data in datagrid is connected to SQL database.
But here's the condition,
I have to update the data in ACCESS database also whenever some changes made in datagrid.
SOMETHING LIKE THIS:
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
|
Click Here to Expand Forum to Full Width
|