Click here to Skip to main content
15,916,188 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Mod Operator Help PLEASE... Pin
stingerj15-Dec-04 6:35
stingerj15-Dec-04 6:35 
GeneralRe: Mod Operator Help PLEASE... Pin
Tom John15-Dec-04 5:44
Tom John15-Dec-04 5:44 
GeneralRe: Mod Operator Help PLEASE... Pin
stingerj15-Dec-04 6:41
stingerj15-Dec-04 6:41 
Generalso nobody can help me.... Pin
stingerj15-Dec-04 11:22
stingerj15-Dec-04 11:22 
GeneralRe: so nobody can help me.... Pin
Dave Kreskowiak15-Dec-04 12:26
mveDave Kreskowiak15-Dec-04 12:26 
GeneralRe: Mod Operator Help PLEASE... Pin
santosh jaiswal 200415-Dec-04 18:22
santosh jaiswal 200415-Dec-04 18:22 
GeneralMS Project integration Pin
Black Jellyfish15-Dec-04 1:11
Black Jellyfish15-Dec-04 1:11 
GeneralDataGrid/Xml File Pin
Makniteasy14-Dec-04 22:06
Makniteasy14-Dec-04 22:06 
I am working on a project called checkbook.I have an xml file called checkbook.xml in a file called checkbook. I also have a datagrid on my form called DataGrid1.
My xmlfile looks like this:



<itemid>0
<checknumber>1533
<payee>Kmart
<amount>55.23
<date>11/12/2004


When I run my program my datagrid already shows what is in the xml file because I am using streamreader. How can I get The information entered in the datagrid by the user to save back to my xml file upon program close so it will be there the next time the program is opened.

This is the code that I have so far:

Imports System.Xml
Imports System.IO
Imports System.Data


Public Class Form1
Inherits System.Windows.Forms.Form
Public myxmlfile As String = "c:\checkbook\checkbook.xml"
Public ods As DataSet
Public nds As DataSet

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try

Dim ods As New DataSet
Dim myStreamReader As New System.IO.StreamReader(myxmlfile)
ods.ReadXml(myStreamReader)
myStreamReader.Close()
Me.DataGrid1.DataSource = ods.Tables(0)
Me.DataGrid1.FlatMode = True
Me.DataGrid1.Expand(-1)
Me.DataGrid1.ColumnHeadersVisible = True

Catch ex As Exception
MsgBox(ex.ToString)

End Try

End Sub

End Class
Thanks For The Help
GeneralRe: DataGrid/Xml File Pin
Gavin Jeffrey15-Dec-04 1:22
Gavin Jeffrey15-Dec-04 1:22 
GeneralRe: DataGrid/Xml File Pin
Makniteasy15-Dec-04 19:33
Makniteasy15-Dec-04 19:33 
GeneralRe: DataGrid/Xml File Pin
Dave Kreskowiak16-Dec-04 4:14
mveDave Kreskowiak16-Dec-04 4:14 
GeneralRe: DataGrid/Xml File Pin
Makniteasy15-Dec-04 19:34
Makniteasy15-Dec-04 19:34 
GeneralRe: DataGrid/Xml File Pin
Gavin Jeffrey19-Dec-04 19:39
Gavin Jeffrey19-Dec-04 19:39 
GeneralRe: DataGrid/Xml File Pin
Gavin Jeffrey19-Dec-04 19:43
Gavin Jeffrey19-Dec-04 19:43 
QuestionHow to get focus in DateTime Picker control Pin
manivannan.p14-Dec-04 20:25
manivannan.p14-Dec-04 20:25 
Generalaccessing ip packets using VB.NET Pin
mats_mathai14-Dec-04 20:13
mats_mathai14-Dec-04 20:13 
GeneralRe: accessing ip packets using VB.NET Pin
Dave Kreskowiak16-Dec-04 4:24
mveDave Kreskowiak16-Dec-04 4:24 
Generalputting an event procedure subroutine into a different event procedure Pin
mpiotro14-Dec-04 10:49
mpiotro14-Dec-04 10:49 
GeneralRe: putting an event procedure subroutine into a different event procedure Pin
Dave Kreskowiak16-Dec-04 4:28
mveDave Kreskowiak16-Dec-04 4:28 
GeneralRe: putting an event procedure subroutine into a different event procedure Pin
mpiotro16-Dec-04 12:51
mpiotro16-Dec-04 12:51 
GeneralRe: putting an event procedure subroutine into a different event procedure Pin
Dave Kreskowiak17-Dec-04 2:06
mveDave Kreskowiak17-Dec-04 2:06 
Questionyes/No column in Datagrid?? Pin
mittalpa14-Dec-04 8:31
mittalpa14-Dec-04 8:31 
AnswerRe: yes/No column in Datagrid?? Pin
mtone21-Dec-04 3:41
mtone21-Dec-04 3:41 
Generalprinting stripchart on a windows form Pin
kbbabb14-Dec-04 6:59
kbbabb14-Dec-04 6:59 
GeneralFree Grid and charting controls for VB.NEt Pin
JHAKAS14-Dec-04 2:22
JHAKAS14-Dec-04 2:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.