-
how to update access database without sql
I have a courseework, that prohibits usage of sql within the code.
I have objects in array list. I have a connection to the Access table. How can i store the data from my arraylist into the table in Access.
I tried the following but it didn't work:
dataset.Tenant.Clear() ' tenant is the name of the table in access
For i = 0 To tenantList.Count - 1
dataset.Tenant.Item(i).tenantId = tenantList.Item(i).tenantno
dataset.Tenant.Item(i).firstName = tenantList.Item(i).tenantfname
dataset.Tenant.Item(i).lastName = tenantList.Item(i).tenantlname
dataset.Tenant.Item(i).tenantType = tenantList.Item(i).tenanttype
Next
adapterTen.Update(dataset.Tenant)
the following does not work either:
for i = 0 to tenantList.Count - 1
dataset.Tenant.AddTenantRow(tenantList.Item(i).tenantfname, tenantList.Item(i).tenantlname, tenantList.Item(i).tenantno, tenantList.Item(i).tenanttype)
next
can anybody help me?
-
What do you mean by "doesn't work"? Do you get an error?
BTW, the DataAdapter InsertCommand property will require a SQL INSERT statement if you want to add data to the table in your database.
Paul
~~~~
Microsoft MVP (Visual Basic)
-
By "does not work" I mean that the data in the Access table remain unchanged. I know that insert statement is required here. The point of our coursework is not to use SQL to bind textboxes to dataset's tables. For this purpose we need first to load the data from the table into arraylist and then after manipulation, upload it back. For uploading we can use SQL, but it still does not work (does not upload the data). Maybe I have some errors in my code or smth is missing. Maybe you know any tutorials on this topic, where i can learn the steps, how to load/upload data in a right way, cause I am using only one book professional VB.Net. and ther is no sufficient information on this topic.
-
Paul
~~~~
Microsoft MVP (Visual Basic)
Similar Threads
-
By rperez in forum Database
Replies: 5
Last Post: 01-02-2009, 04:14 PM
-
By ksuwanto8ksd in forum VB Classic
Replies: 1
Last Post: 06-14-2005, 02:42 PM
-
By Makl. Lemmertz in forum VB Classic
Replies: 2
Last Post: 10-29-2001, 11:12 AM
-
By Nate in forum Database
Replies: 29
Last Post: 05-09-2001, 10:04 AM
-
By deane in forum authorevents.mitchell
Replies: 0
Last Post: 10-16-2000, 10:41 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