473,811 Members | 3,014 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

database not updating

I cant seem to get the databse to update the tables.
i get the following error
"System.Invalid OperationExcept ion: Missing the DataColumn 'description' in
the DataTable 'Transactions' for the SourceColumn 'description'."

here is the code im using. please will someone explain what i am doing wrong

regards

Nir

Dim strConn as string ="PROVIDER=Micr osoft.Jet.OLEDB .4.0;DATA SOURCE=" &
server.mappath( "/itinium2/Database/db.mdb") & ";"
dim conn as new OLEDBConnection (strconn)
dim cmd as new OLEDBCommand
dim mydataset as new dataset()
dim mydataAdapter as new oledbdataadapte r()
dim dbrelation as dataRelation
sub page_load(sourc e as object, e as eventargs)
dim strsql as string
dim drow as datarow
dim cbd as new oledbcommandbui lder(mydataadap ter)
dim dtable as new datatable
cmd.connection = conn
cmd.commandtype = commandtype.tex t
conn.open()

'fill dataAdapter with 1st Table (transactions)
strsql = "select * from transactions"
cmd.commandtext = strsql
mydataAdapter.s electcommand = cmd
'mydataAdapter. fillschema(myda taset, schematype.mapp ed)
mydataAdapter.f ill(mydataset, "Transactio ns")

'fill dataAdapter with 2nd Table (link_transacti ons2details)
strsql = "select * from link_transactio ns2details"
cmd.commandtext = strsql
mydataAdapter.s electcommand = cmd
'mydataAdapter. fillschema(myda taset, schematype.mapp ed)
mydataAdapter.f ill(mydataset, "LinkTable" )

'fill dataAdapter with 3rd Table (transaction_de tails)
strsql = "select * from transaction_det ails"
cmd.commandtext = strsql
mydataAdapter.s electcommand = cmd
'mydataAdapter. fillschema(myda taset, schematype.mapp ed)
mydataAdapter.f ill(mydataset, "Details")
conn.close()

'******** create table relationships *************** **********

'link linktable to transactions
dbrelation = new dataRelation("T ransLink",mydat aset.tables("li nkTable")
..columns("t_id "),mydataset.ta bles("Transacti ons").columns(" id"))
mydataset.relat ions.add(dbrela tion)

'link linktable to details
dbrelation = new dataRelation("d etailLink",myda taset.tables("l inkTable")
..columns("d_id "),mydataset.ta bles("Details") .columns("id"))
mydataset.relat ions.add(dbrela tion)

'******** end create table relationships *************** *****

'Insert data into tranasaction table
dtable = mydataset.table s("Transactions ")
drow = dtable.NewRow()
drow("t_type_id ") = 1
dtable.Rows.Add (drow)
mydataadapter.i nsertcommand = cbd.getinsertco mmand()
mydataadapter.u pdate(mydataset ,"Transactions" )
myDataSet.Table s("Transactions ").AcceptChange s()
end sub

--
Message posted via http://www.dotnetmonster.com
Nov 19 '05 #1
0 1108

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1327
by: Test Person | last post by:
Hi I'm having trouble with updating my database which is SqlServer. I'm using the update command and only the dataset is being changed not the actual row in the database. Best Regards
4
2627
by: Frnak McKenney | last post by:
I'm using an in-core DataSet as an image of my application's 'database' (a multi-table Access97 mdb file). Updates are made to the DataTables within the DataSet via forms with bound TextBoxes, then written to the database... or at least that's what's supposed to be happening. Unfortunately, I've discovered that while it appears that when I create a new record/row I'm successfully updating the Access database, once the Update is...
9
4779
by: Pam Ammond | last post by:
I need the code to update the database when Save is clicked and a text field has changed. This should be very easy since I used Microsoft's wizards for the OleDBAdapter and OleDBConnection, and DataSet; and all I'm doing is showing one record in text fields, allowing the user to modify the text fields, and then updating the database again when the user clicks the Save button. The fields already show the correct data record since I have...
1
2469
by: Luis Esteban Valencia | last post by:
Hello Everyone, Iam an intermediate ASP.Net programmer and iam facing a challenging task. I have a table in MS-SQL server database called 'Members'. The table has following fields... mem_id integer primary key lastname nvarchar(30) firstname nvarchar(30)
0
1642
by: cwbp17 | last post by:
I'm having trouble updating individual datagrid cells. Have two tables car_master (columns include Car_ID, YEAR,VEHICLE) and car_detail (columns include Car_ID,PRICE,MILEAGE,and BODY);both tables have a FK relationship on CAR_ID so the oracledataadapter1 select statement(CommandText) is: select car_master.car_id, car_master.year,car_master.vehicle,car_detail.car_id AS EXPR1,
2
1676
by: Greg | last post by:
I'm using the Framework 1.1, so I don't have access to the new DataGridView object. What I'm wondering is, is there a really simple way to bind a plain datagrid to a database in such a way that changes made to cells in the datagrid call an update on the corresoonding data within a database? I've looked in vain for a really simple way to do this with minimal coding, but I'm coming to the conclusion that I will have to trap the events of...
3
897
by: Zelalem | last post by:
Hi In the VB.6 application program I know that there are functionalities used for updating,editing the main database designed with Ms access or any other DBMS What I need is to keep the orginal database some where whenever updating,editing or deleting has been done. Example: Suppose ,dbA is the orginal database before updating,editing or deleting and dbA" is the database after updating,editing or deleting has been done. ...
1
2375
by: jonbartlam | last post by:
Hi There I'm not sure what exactly is going wrong here. I'm writing an application that retreives a table from a database (tbl_internalfaults) and updates it. (Actually, just the status column will need updating with 'CLOSED' where necessary.) I have been trying to use the OLEDB command builder to build the statement to update the database however it is returning an error whenever I try to do this. I already have a dataset full of data, 1...
25
14857
by: zmickle | last post by:
Excuse my noobness. I am managing an access database that is shared by 4 users. Management does not want to use any technologies outside of access for this application (no SQL Server, etc). I have split the database into front end and back end databases and put the front end on each of the users' computers. All users can open the front end simultaneously, but once somebody updates data in the form, the back end locks up. What I...
0
4761
MrMancunian
by: MrMancunian | last post by:
How to create a database connection without using wizards Introduction I've seen a lot of questions on the net about getting data from, and saving data to databases. Here's a little insight how to do that using .NET code. I prefer using code instead of wizards, because you are completely in charge of connections. This article is written for both Visual Basic.NET 2005 and C# 2005 and will discuss how to use an MS Sql database. OleDB works...
0
9607
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10398
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9215
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7676
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6897
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5567
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5702
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3881
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3028
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.