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?
[1084 byte] By [
Avelin] at [2007-11-11 8:26:39]

# 1 Re: how to update access database without sql
What do you mean by "doesn't work"? Do you get an error?
BTW, the DataAdapter InsertCommand (http://msdn2.microsoft.com/en-us/library/system.data.oledb.oledbdataadapter.insertcommand(VS.80).aspx) property will require a SQL INSERT statement if you want to add data to the table in your database.
# 2 Re: how to update access database without sql
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.
Avelin at 2007-11-11 21:48:22 >
