|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
||||
|
||||
|
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 |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft Access Help > Update a database |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|