473,785 Members | 2,851 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

to update using datatable,datas et,data adapter

21 New Member
Hi
i have a question regarding a update in msaccess DB using string builder,DATA SET AND DATA RELATIONS
can we do that in access DB
i have a table in access i need to pass more than 1 record and get o/p value and update in table again
so for this i used :
i have 2 datatables which i loaded with select command n records in
dlog1 ,dlog2
so im passing log 1 values into oracle stored procedure ,i got the values and im loading it in log3 data table
so now i want to update dlog3 into DB by comparing the Datarow and datacolumn with dlog2
and update in access
i wrote code here but its goin into deadlock condition and not update the values
Expand|Select|Wrap|Line Numbers
  1.    Private Sub updlog()
  2.         Dim dsRel As New DataSet
  3.         dsRel.Tables.Add(dlog2)
  4.         dsRel.Tables.Add(dlog3)
  5.         dsRel.Relations.Add("upd1", dsRel.Tables("dlog2").Columns("id"), dsRel.Tables("dlog3").Columns("id"))
  6.         Dim drRel As DataRow
  7.         Try
  8.             Dim sb As New StringBuilder
  9.             For Each dr As DataRow In dsRel.Tables("updlog3").Rows
  10.                 For Each dc As DataColumn In dsRel.Tables("updlog3").Columns
  11.                     If dc.Equals("id") Then
  12.                         drRel = dr.GetParentRow("upd1")
  13.                         sb.Append(drRel.Item("status").ToString() & ",")
  14.                         sb.Append(drRel.Item("message").ToString() & ",")
  15.                     Else
  16.                         sb.Append(dr(dc).ToString() & ",")
  17.                     End If
  18.                 Next
  19.                 sb.Remove(sb.Length - 1, 1)
  20.                 sb.Append(vbCrLf)
  21.             Next
  22.  
  23.         Catch ex As Exception
  24.             MessageBox.Show(ex.ToString)
  25.             Throw New Exception(ex.ToString)
  26.         Finally
  27.  
  28.         End Try
  29.     End Sub
  30. End Class
  31.  
sb.append means is it updateing the record
Dec 3 '07 #1
0 901

Sign in to post your reply or Sign up for a free account.

Similar topics

9
12989
by: jaYPee | last post by:
I have search a lot of thread in google newsgroup and read a lot of articles but still i don't know how to update the dataset that has 3 tables. my 3 tables looks like the 3 tables from northwind database that has an employees, orders, and order details. the following are the 3 tables in my sql database students schyrsem
9
3563
by: Michael | last post by:
Hi, I have a large table. Normally, the user will need to see only the data from the past two years, but sometimes, they will need to go back further. I have a form with a datagrid, a DateTimePicker and a command button. What I'd like is when the user selects a new date and clicks the button, the grid would display data from the value in the datapicker through today. I have it working, but only if I select everything in the data...
8
2698
by: Zorpiedoman | last post by:
I keep getting a concurrency exception the second time I make a change and attempt to update a dataadapter. It appears this is by design, so there must be something I can do to avoid it. Example: I have a dataadapter that contains one table with one row. I change the value of the 'FisrtName' column in that row from Jack to John. I call ..update on the dataadapter it goes through fine. Now I change that same column in that same row...
3
8935
by: RSH | last post by:
Hi, I have a situation in where i have two instances of SQL server, the first is our Production Environment, the second is our Development environment. Both servers contain the same databases but I need to write a utility that can transfer a row of data from the Production to the Development servers. I wrote the code below, which doesn't error...but it doesn't work...no data is updated. This is very odd because I can see that both of...
1
2537
by: cindy | last post by:
this is the call private void Page_Load(object sender, System.EventArgs e) { OdbcConnection connection = new OdbcConnection ("DSN=PFW52"); CreateDataAdapter(connection); } this is the code, no errors, but NO UPDATE I have to use ODBC I just need to update a field based on a key, EMBARASSED to say days going
1
2089
by: andrewcw | last post by:
I have just 1 table that I am updating, the SQL I use to generate the DataTable is complex using multiple tables, however when I view the fieldnames of the DataTable from the DataSet - everything matches: What dont I understand here: ( The error I get is : Dynamic SQL generation is not supported against multiple base tables ). But My DataSet is 1 Table, and my target is 1 table, Why the error ?? Thanks : try {
0
1111
by: brads745678 | last post by:
Hi, I am having a problem with my VB .NET application. I am trying to do the most simplest of things, and I've even achieved this task before. All I am trying to do is update an access DB from VB .NET 2003 using OleDb. I have dragged a data adapter onto my form and configured it correctly setting the connection to the DB and setting a query for the adapter to just read in all columns from a single table. I have then generated a data set from...
3
2353
by: Fred Chateau | last post by:
Any obvious reason here why data is not being loaded into the database? SqlDataAdapter dataAdapter = new SqlDataAdapter(sqlCommand); SqlCommandBuilder commandBuilder = new SqlCommandBuilder(dataAdapter); dataAdapter.Fill(dataSet, "POI_Entity"); DataRow dataRow = dataSet.Tables.NewRow(); dataRow = 1; dataRow = dataSet.Identity.POI_Entity_ID; dataRow = dataSet.Identity.Chain_ID;
6
3801
by: Suresh | last post by:
Hi All, I am fetching a dataset from the database under some condition. After this I create a data table. Traverse in the original dataset & add each row to created data table as it is through LoadDataRow method. After adding the row I just update 4-5 columns out of 20 columns in the row. After entire looping I fire the AcceptChanges method on data table. After this I am trying to update this data back to database in two ways - 1) Merge...
1
1218
by: Q. John Chen | last post by:
All, I am using VS2005. I have a dataset MyDataSet with several DataTableAdapters defined (say CompanyDataTable, DepartmentDataTable) After I modified the data in the data tables of the dataset, I want to put the change back to the database. So, I am doing the following: MyDataSetTableAdapters.CompanyTableAdapter adapter = new .. adapter.Update(myDataSet.CompanyDataTable);
0
9645
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
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
10152
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
8974
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
7500
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
5381
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
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3650
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2880
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.