Microsoft Access Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft Access Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old February 11th, 2004, 05:07 AM
ebar2 ebar2 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 1 ebar2 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Update a database

hello,

i'm a new user of Asp.net, and i've got a problem when i try to update a MS access database with a dataset

The code is:

Public Shared Function Update_Base(ByVal mydataset As DataSet, ByVal TECH_ID As String) As Integer
Dim ds As New DataSet()
Dim cnx As New OleDb.OleDbConnection(CNXSTR)
Dim adp As OleDb.OleDbDataAdapter = New OleDb.OleDbDataAdapter()
Dim cmb As OleDb.OleDbCommandBuilder

adp.SelectCommand = New OleDb.OleDbCommand("Select * from Technologies where Tech_id = " & TECH_ID & "", cnx)
cmb = New OleDb.OleDbCommandBuilder(adp)

adp.Fill(ds, "Technologies")
Dim Row As DataRow

Row = ds.Tables("Technologies").Rows(0)

With Row
.Item("ITEM1") = mydataset.Tables(0).Rows(0).Item("ITEM1")
.Item("ITEM2") = mydataset.Tables(0).Rows(0).Item("ITEM2")
.Item("ITEM3") = mydataset.Tables(0).Rows(0).Item("ITEM3")

'.....
.Item("ITEM40") = mydataset.Tables(0).Rows(0).Item("ITEM40")

End With

'update the source table of the database with the dataset ds
adp.Update(ds, "Technologies")

And the error is:

System.Data.OleDb.OleDbException: Expression too complex at System.Data.Common.DbDataAdapter.Update(DataRow[] dataRows, DataTableMapping tableMapping) at System.Data.Common.DbDataAdapter.Update(DataSet dataSet, String srcTable) at DotNet.DataAccess.Update_Base(DataSet mydataset, String TECH_ID) in c:\inetpub\wwwroot\DotNet\Base\DataAcces.vb:line 526

perhaps threre is a different method to update the table "TECHNOLOGIES" of this database

if someboby could help me, thanks

Ebar2

Reply With Quote
  #2  
Old February 12th, 2004, 06:17 AM
Bullschmidt's Avatar
Bullschmidt Bullschmidt is offline
Guru
ASP Free Novice (500 - 999 posts)
 
Join Date: May 2003
Location: USA
Posts: 877 Bullschmidt User rank is Corporal (100 - 500 Reputation Level)Bullschmidt User rank is Corporal (100 - 500 Reputation Level)Bullschmidt User rank is Corporal (100 - 500 Reputation Level)Bullschmidt User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 1 Day 8 h 40 m 43 sec
Reputation Power: 9
microsoft.public.dotnet.framework.aspnet

SitePoint .NET Forum
http://www.sitepointforums.com/foru...000&forumid=141

ASP Messageboard - ASP.NET Forum
http://www.aspmessageboard.com/forum/aspplus.asp

Extreme .NET Forums - .NET - ASP.NET
http://www.dotnetforums.net/f62
__________________
J. Paul Schmidt
www.Bullschmidt.com - Freelance Web and Database Developer
www.Bullschmidt.com/DevTip.asp - Classic ASP Design Tips

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > Update a database


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway