473,756 Members | 8,034 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.OdbcDataAd apter
Private Conn As New Microsoft.Data. Odbc.OdbcConnec tion
Private ds As New DataSet("AnyTab le")

Conn.Connection String = "DSN=TestDS N"

Conn.Open()

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

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

ds.Clear()

odbcAd.Fill(ds, "AnyTable")

DataGrid1.SetDa taBinding(ds, "AnyTable")

ds.Tables("AnyT able").Rows(1). Item(3) = "Test"
------------------------------------------------------------
Nov 20 '05 #1
1 1714
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*********@yah oo.com (Sajid)
Newsgroups: microsoft.publi c.dotnet.langua ges.vb.data,mic rosoft.public.d otnet.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**********@go ogle.com
NNTP-Posting-Date: Tue, 27 Jan 2004 19:18:46 +0000 (UTC)
Path: cpmsftngxa07.ph x.gbl!cpmsftngx a06.phx.gbl!TK2 MSFTNGP08.phx.g bl!news-out.cwix
..com!newsfeed. cwix.com!news.m axwell.syr.edu! postnews1.googl e.com!not-for-mai
lXref: cpmsftngxa07.ph x.gbl microsoft.publi c.dotnet.langua ges.vb:176578 microsoft.publi c.dotnet.langua ges.vb.data:299 8X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.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.OdbcDataAd apter
Private Conn As New Microsoft.Data. Odbc.OdbcConnec tion
Private ds As New DataSet("AnyTab le")

Conn.Connectio nString = "DSN=TestDS N"

Conn.Open()

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

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

ds.Clear()

odbcAd.Fill(ds , "AnyTable")

DataGrid1.SetD ataBinding(ds, "AnyTable")

ds.Tables("Any Table").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
2586
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 I could not configure Apache myself. The REAL problem is that PHPmyAdmin works and sees my test database Wines.... But my PHP program does not!
0
2069
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 I got half an answer, then no more. In desperation, I'm now posting again in alt.php, alt.comp.lang.php and comp.lang.php in the hope that someone will find the time to help. This was my original query:
0
1891
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 I got half an answer, then no more. In desperation, I'm now posting again in alt.php, alt.comp.lang.php and comp.lang.php in the hope that someone will find the time to help. This was my original query:
9
3543
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 python scripts as I can with MySQLdb. But I cannot even connect to the access database (see below). Could anyone explain it to me as simple as possible please. I'm using Windows XP, ActivePython 2.3.2 build 230 and Microsoft access(XP?)
5
1793
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 start fresh after the .jpg section of the move images code. this will be essential to make the whole thing work. Please help. Even if you just write out the solution. I am beggin. I am desperate. Please help. <!DOCTYPE HTML PUBLIC...
24
2148
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 Seattle, WA 98109
1
1600
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 asked to update pages as well as add new functions. This project is an online training course for internal use only. So, my question is.... I need to put a Print Button on the left frame called "buttons.aspx". I need it to print whatever...
2
2046
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 out sproxy.exe to generate the proxy code. All well and good despite the fact sproxy seems seriously in need of an update and from what i can gather on other threads possible not going to. I am in a situation where I cannot use C++/CLI and the...
6
5977
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 update as being the culprit as one day this summer all of a sudden, compact and repair started crashing my applications all of which had never experienced any problems until then. AND PLEASE DON'T SAY "GOOGLE IT"! Google won't produce any...
0
9456
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
10040
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
8713
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
7248
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
5142
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
5304
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3806
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
3359
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2666
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.