473,231 Members | 1,713 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,231 software developers and data experts.

A desperate help in Update

Hello! Experts,

I have the following piece of code in VB.NET that I want to use to
update any records in the database. I would like to use a code as well
as DataGrid to update the records. Please guide me how can I achieve
it. I know there is an Update command to to do this that but since I
am a newbie I don't know how? I'll be really grateful to those who may
help me buy modifying the following code. I am really desperately
looking for your help. I know this will only take a fraction of your
time but it will be a very big help for me. Thanks to all...

------------------------------------------------------------------------
Private odbcAd As New Microsoft.Data.Odbc.OdbcDataAdapter
Private Conn As New Microsoft.Data.Odbc.OdbcConnection
Private ds As New DataSet("AnyTable")

Conn.ConnectionString = "DSN=TestDSN"

Conn.Open()

Dim SQL As String
SQL = "SELECT * FROM AnyTable"

odbcAd = New Microsoft.Data.Odbc.OdbcDataAdapter(SQL, Conn)

ds.Clear()

odbcAd.Fill(ds, "AnyTable")

DataGrid1.SetDataBinding(ds, "AnyTable")

ds.Tables("AnyTable").Rows(1).Item(3) = "Test"
------------------------------------------------------------
Nov 20 '05 #1
1 1687
Hello -

You need to call the Update method of your DataAdapter. Check out this help
topic:

Updating a Data Source with a Dataset (Visual Basic and Visual C# Concepts)
http://msdn.microsoft.com/library/en...mingUpdates.as
p
hope that helps
Steve Stein
VB Team

This posting is provided "AS IS" with no warranties and confers no rights.

--------------------
From: sa*********@yahoo.com (Sajid)
Newsgroups: microsoft.public.dotnet.languages.vb.data,microsof t.public.dotnet.languages.
vbSubject: A desperate help in Update
Date: 27 Jan 2004 11:18:46 -0800
Organization: http://groups.google.com
Lines: 33
Message-ID: <e0**************************@posting.google.com >
NNTP-Posting-Host: 195.13.97.12
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1075231126 22381 127.0.0.1 (27 Jan 2004 19:18:46 GMT)X-Complaints-To: gr**********@google.com
NNTP-Posting-Date: Tue, 27 Jan 2004 19:18:46 +0000 (UTC)
Path: cpmsftngxa07.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTN GP08.phx.gbl!news-out.cwix
..com!newsfeed.cwix.com!news.maxwell.syr.edu!postn ews1.google.com!not-for-mai
lXref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.languages.vb:176578 microsoft.public.dotnet.languages.vb.data:2998X-Tomcat-NG: microsoft.public.dotnet.languages.vb

Hello! Experts,

I have the following piece of code in VB.NET that I want to use to
update any records in the database. I would like to use a code as well
as DataGrid to update the records. Please guide me how can I achieve
it. I know there is an Update command to to do this that but since I
am a newbie I don't know how? I'll be really grateful to those who may
help me buy modifying the following code. I am really desperately
looking for your help. I know this will only take a fraction of your
time but it will be a very big help for me. Thanks to all...

------------------------------------------------------------------------
Private odbcAd As New Microsoft.Data.Odbc.OdbcDataAdapter
Private Conn As New Microsoft.Data.Odbc.OdbcConnection
Private ds As New DataSet("AnyTable")

Conn.ConnectionString = "DSN=TestDSN"

Conn.Open()

Dim SQL As String
SQL = "SELECT * FROM AnyTable"

odbcAd = New Microsoft.Data.Odbc.OdbcDataAdapter(SQL, Conn)

ds.Clear()

odbcAd.Fill(ds, "AnyTable")

DataGrid1.SetDataBinding(ds, "AnyTable")

ds.Tables("AnyTable").Rows(1).Item(3) = "Test"
------------------------------------------------------------


Nov 20 '05 #2

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

Similar topics

3
by: James | last post by:
Please help - getting very desperate! Sun, 12 October 2003 05:39 I have PHPDEV 4.2.3 from Firepages.com.au as the upgrade to 4.3.0 did not work. I also had an abortive download from PHP.NET as...
0
by: Somerset Bob | last post by:
I've posted my query at the phpbb forum, where I got half an answer and then no more. I posted it again at another phpbb forum, where I got half an answer and no more. I posted it in alt.php, where...
0
by: Somerset Bob | last post by:
I've posted my query at the phpbb forum, where I got half an answer and then no more. I posted it again at another phpbb forum, where I got half an answer and no more. I posted it in alt.php, where...
9
by: DD | last post by:
Hello, Could anyone please help me?? Is there somebody who could explain me how to make a connection to a access database with a python cgi script. I would like to use common sql commands in my...
5
by: Tank | last post by:
I have had this post up here when i was trying to figure out how to make leading zeros and have been able to fudge that to work. I am now have trouble getting the loop that makes the folders to...
24
by: Ministry Of Jute | last post by:
I returned home from work today to find an Airborne Express Letter Express mailer leaning up against my apartment door. The return addressee was Microsoft Suite 300 1165 Eastlake Avenue E...
1
by: wolfiecat | last post by:
Hello - I am new to this forum. Let me start off by saying that I have never used ASP before. I am working on a project where the site was already created using frames and .aspx pages. I was...
2
by: quortex | last post by:
Hi all, I have written a web service using the .net framework 2 and Visual Studio 2005. I consume the managed service by native C++ using the "add web reference" feature. This obviously shells...
6
by: Timmy! | last post by:
Access 2003. Will someone please explain how to do this? My applications have all become so absolutely despairingly *&^%ing corrupted - I have no idea why - I honestly suspect some asinine XP...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

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.