473,408 Members | 1,876 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

update in DB using stringbuilder,datarelations

21
Hi,
can anyone guide me how to update a access db with datatables and string builder
im trying to update 3 columns

does sb.Append(drRel.Item("id").ToString() & ",") this means im i updating the feild value into DB.
my program is a big process
so i just need help on update thing
it also have select command to filter records and call the stored proc in oracle nd insert and get the o/p value and update in access

i finished the above 2 steps but facing the problem with the update
Please anyone guide me in correct way

my code
Expand|Select|Wrap|Line Numbers
  1.  Private Sub updlog()
  2.         Dim dsRel As New DataSet
  3.         dsRel.Tables.Add(log2)
  4.         dsRel.Tables.Add(log3)
  5.         dsRel.Relations.Add("upd", dsRel.Tables("log2t2").Columns("userid"), dsRel.Tables("log3t3").Columns("userid"))
  6.         Dim drRel As DataRow
  7.         Try
  8.             Dim sb As New StringBuilder
  9.             For Each dr As DataRow In dsRel.Tables("log3t3").Rows
  10.                 For Each dc As DataColumn In dsRel.Tables("log3t3").Columns
  11.                     If dc.ToString.Equals("userid") And dc.ToString.Equals("custno") Then
  12.                         drRel = dr.GetParentRow("upd")
  13.                         sb.Append(drRel.Item("iid").ToString() & ",")
  14.                         sb.Append(drRel.Item("status").ToString() & ",")
  15.                         sb.Append(drRel.Item("message").ToString() & ",")
  16.                     Else
  17.                         sb.Append(dr(dc).ToString() & ",")
  18.                     End If
  19.                 Next
  20.                 sb.Remove(sb.Length - 1, 1)
  21.                 sb.Append(vbCrLf)
  22.             Next
  23.             'File.WriteAllText(fileggName, sb.ToString())
  24.         Catch ex As Exception
  25.             MessageBox.Show(ex.ToString)
  26.             Throw New Exception(ex.ToString)
  27.         Finally
  28.             'delete the file after retrieval
  29.             'File.Delete(Path.GetDirectoryName(filename) & "\schema.ini")
  30.         End Try
  31.     End Sub
  32.  
Thanks in advance
Nov 30 '07 #1
0 1147

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

Similar topics

7
by: Vincent Nguyen | last post by:
Hi, Does anyone know how call Win32 native API GetTokenInformation() by using C#? Any sample code would be helpful. Thanks! Vincent
9
by: Jason Huang | last post by:
Hi, I need to update my data based on the textboxes input on my windows form. But I feel the following sql requery is to long and cumbersome. Is there some more convient way to do the Update...
5
by: Jason Huang | last post by:
Hi, The SqlParameter myPM =new SqlParameter("@Address", txtAddress.Text) is working for update, but SqlParameter myPM =new SqlParameter ("@Address",SqlDbType.NVarChar,90,txtAddress.Text) is...
0
by: George Durzi | last post by:
I have a DataSet with 3 tables, and two DataRelations dsSubs.Tables.TableName = "Subscriptions" dsSubs.Tables.TableName = "AccountManagers" dsSubs.Relations.Add "AccountManagers_Subscriptions",...
6
by: Shashi | last post by:
I have developed ASP.Net application using .Net 1.1 Framework. When the user clicks image file through Java script I am using my search window as below. QueryString =...
1
by: Foef | last post by:
When I have a stored procedure, with multiple tables in MS Access, in a dataset and I change it in my DataGrid, I get the next message when I want to update my DataSet: ...
0
by: riyap | last post by:
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...
0
by: Jeff | last post by:
hey asp.net 3.5 I have 2 UpdatePanels in my webpage. This webpage has a GridView, which one of its column is a templatefield which again contain a UpdatePanel and a button... The other...
65
by: Arjen | last post by:
Hi, Form a performance perspective, is it wise to use the ref statement as much as possible? Thanks! Arjen
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
0
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...

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.