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

ADO.NET: Updating data


I've only got a typical crappy Microsoft book about ADO.NET (MSPRESS
!"(#&/()&# you for mixing manual written code and suddenly adding
designtime controls and wizards for updating data)

I've got a function that is just for learning purposes the naming convention
is bad and such since it's a mix of my conventions and MS Press conventions.
I work with XML files in a database guy's approach. I've managed to create a
schema for my table and i think i know how to add the data correctly but i
can't manage to update my data back to my DataSet and write the DataSet as
an XMLFile.

Would anyone be so kind to help me out with a updatetable thingie ?

My Code fails on the AcceptChanges which i suppose is because my DataRow
isn't written back to the DataSet but how do i do that ?

Public Function doCreateNewXmlfile()
Dim ds As New DataSet
Dim col As DataColumn
Dim oDataRow As DataRow

'Create the table structure.
With ds.Tables.Add("Routers")
col = .Columns.Add("IPAddr", GetType(String))
col.MaxLength = 15
col = .Columns.Add("HostName", GetType(String))
col.MaxLength = 90
col = .Columns.Add("LogFileName", GetType(String))
col.MaxLength = 30
End With
' Save our schema representing our table structure
Dim oFileStream As New
System.IO.FileStream(Me.setXmlIpTableFileSchemaNam e, FileMode.Create)
oFileStream = Nothing

' Create some data in our xmldatabase
Dim row As DataRow = ds.Tables("Routers").NewRow
row("IPAddr") = ""
row("HostName") = "tower"
row("LogFileName") = "tower_Log"

oFileStream = New System.IO.FileStream(Me.setXmlIpTableFileName,
oFileStream = Nothing
End Function

Thanks a lot
Nov 20 '05 #1
1 1120
* "Kai Thorsrud" <ka******@thispartgoesaways.start.no> scripsit:
I've only got a typical crappy Microsoft book about ADO.NET (MSPRESS
!"(#&/()&# you for mixing manual written code and suddenly adding
designtime controls and wizards for updating data)

ADO.NET group:


Web interface:

<http://msdn.microsoft.com/newsgroups/default.asp?url=/newsgroups/loadframes.asp?icp=msdn&slcid=us&newsgroup=microso ft.public.dotnet.framework.adonet>

Herfried K. Wagner [MVP]
Nov 20 '05 #2

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

Similar topics

by: Leon Shaw | last post by:
After configuring a relation data schema (MyDataSet.xsd) in vs.net, what code do you use to display that data within two dropdownlist controls ( parent/child) in an web application?
by: Mark | last post by:
I'm having a problem updating recordsin an Access DB table. I can update other tables in this db with no problem, and I can dreate new record in all of the tables (including this one.)> But I can't...
by: | last post by:
Hello, I have created an ASP.NET 2.0 application that utilized a Gridview Control to display and update/delete data. The problem I am having is that the gridview control is displaying the data...
by: Deano | last post by:
Hi, I have a finished Microsoft Access app that we are distributing using an Access runtime. This works fine (mostly) but I'm sold on the advantages of dot.NET and upgrading to vb.NET seems...
by: el_sid | last post by:
Our developers have experienced a problem with updating Web References in Visual Studio.NET 2003. Normally, when a web service class (.asmx) is created, updating the Web Reference will...
by: Brad Baker | last post by:
I'm trying to write a simple asp.net page which updates some data in a SQL database. At the top of the page I have the following code: <%@ Page Language="C#" Debug="true" %> <%@ import...
by: teammcs | last post by:
Hey all, I'm new around here but do Admin over @ PHPHelp.com... I've been developing a project for my degree which is basically based around an ATM machine. Basically my problem is related to...
by: =?Utf-8?B?Z2Fk?= | last post by:
I am using OleDbDataAdapter in order to fill a data table and update it. The fill method is working fine but the update does not work, and I dont know why. Here is my code: Dim data_table As...
by: jonbartlam | last post by:
Hi There I'm not sure what exactly is going wrong here. I'm writing an application that retreives a table from a database (tbl_internalfaults) and updates it. (Actually, just the status column will...
by: sirdavethebrave | last post by:
Hi guys - I have written a form, and a stored procedure to update the said form. It really is as simple as that. A user can go into the form, update some fields and hit the update button to...
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...
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...
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,...
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...
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...
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...

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.