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 -
Private Sub updlog()
-
Dim dsRel As New DataSet
-
dsRel.Tables.Add(log2)
-
dsRel.Tables.Add(log3)
-
dsRel.Relations.Add("upd", dsRel.Tables("log2t2").Columns("userid"), dsRel.Tables("log3t3").Columns("userid"))
-
Dim drRel As DataRow
-
Try
-
Dim sb As New StringBuilder
-
For Each dr As DataRow In dsRel.Tables("log3t3").Rows
-
For Each dc As DataColumn In dsRel.Tables("log3t3").Columns
-
If dc.ToString.Equals("userid") And dc.ToString.Equals("custno") Then
-
drRel = dr.GetParentRow("upd")
-
sb.Append(drRel.Item("iid").ToString() & ",")
-
sb.Append(drRel.Item("status").ToString() & ",")
-
sb.Append(drRel.Item("message").ToString() & ",")
-
Else
-
sb.Append(dr(dc).ToString() & ",")
-
End If
-
Next
-
sb.Remove(sb.Length - 1, 1)
-
sb.Append(vbCrLf)
-
Next
-
'File.WriteAllText(fileggName, sb.ToString())
-
Catch ex As Exception
-
MessageBox.Show(ex.ToString)
-
Throw New Exception(ex.ToString)
-
Finally
-
'delete the file after retrieval
-
'File.Delete(Path.GetDirectoryName(filename) & "\schema.ini")
-
End Try
-
End Sub
-
Thanks in advance
0 1156 Sign in to post your reply or Sign up for a free account.
Similar topics |
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
|
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:
|
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?
|
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"
|
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
| |
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)
|
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...
|
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....
|
by: Arjen |
last post by:
Hi,
Form a performance perspective, is it wise to use the ref statement as much
as possible?
Thanks!
Arjen
|
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,...
|
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...
| |
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...
|
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...
|
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();...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
| |
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...
| | |