473,670 Members | 2,333 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

update in DB using stringbuilder,d atarelations

21 New Member
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").ToS tring() & ",") 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 1156

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

Similar topics

7
29335
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
1381
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 thing? Thanks for help. Jason Here are some of my codes:
5
8291
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 not working. The Address column is DataType NVarChar 90, no problem. Any idea?
0
1443
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", dsSubs.Tables.Columns dsSubs.Tables.Columns) dsSubs.Tables.TableName = "NewsFeeds"
6
2402
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 = "frmMySearchWebForm.aspx?DOBDate=" + txtDOBDt popUp =window.open(QueryString,null, "height=50,width=80,status=no,left =0,top =0,toolbar=no,menubar=no,location=no,scrollbars =yes"); When the user picks a certain customer in the frmMySearchWebForm I am
1
1563
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: InvalidOperationException: "Dynamic SQL generation is not supported against a SelectCommand that does not return any base table information." I tried to use an update query but when I fill my DataTable using myDataAdapter.Fill(myDataSet, myTable)
0
895
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 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...
0
2952
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 UpdatePanel is located outside the GridView....
65
3896
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
8388
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
8907
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8817
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...
1
6218
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
5687
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
4215
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
4396
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2804
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1799
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.