*** This is the first form i called it Form1?******
************************************************** ******** - Imports System.Xml
-
Imports System.IO
-
Public Class Form1
-
Inherits System.Windows.Forms.Form
-
-
Private Sub btnFile_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lodbtn.Click
-
-
Dim ofd As OpenFileDialog = New OpenFileDialog
-
Dim result As DialogResult = ofd.ShowDialog()
-
If result = DialogResult.Cancel Then
-
Return
-
End If
-
-
Dim document As XmlDocument = New XmlDocument
-
document.Load(ofd.FileName)
-
-
Dim reader As XmlNodeReader = New XmlNodeReader(document)
-
MsgBox("The File is loaded successfully!")
-
-
lblLoad.Text = (System.IO.Path.GetFullPath(ofd.FileName))
-
-
Disbtn.Enabled = True
-
-
-
-
End Sub
-
-
Private Sub Displaybtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Disbtn.Click
-
Dim f As CourseDisplay
-
f = New CourseDisplay
-
f.Show()
-
End Sub
-
-
-
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
-
-
End Sub
********* This is the second form i called it CourseDisplay.vb***********
************************************************** ******************************* -
Imports System.Xml
-
Imports System.IO
-
Public Class CourseDisplay
-
Inherits System.Windows.Forms.Form
-
-
Private Sub Display_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
-
-
-
Dim document As XmlDocument = New XmlDocument
-
document.Load("CP2830.xml")
-
-
Dim reader As XmlNodeReader = New XmlNodeReader(document)
-
-
While reader.Read()
-
-
If reader.Name = "courseID" Then
-
Label1.Text = reader.ReadElementString()
-
End If
-
-
If reader.Name = "courseName" Then
-
Label2.Text = reader.ReadElementString()
-
End If
-
End While
-
-
-
For i = 0 To Student.GetUpperBound(0)
-
sum += Convert.ToInt32(Student(i))
-
Next
-
-
Label4.Text = studnetcount
-
-
End Sub
-
-
Private Sub clobtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles clobtn.Click
-
-
Me.Close()
-
-
End Sub
-
End Class
-
that what i did
*********** the problem is how can i leave it to read the studnent
or how i can do this ( that i have to do it )
tempStr is a stirng variable
studentCount is an integer variable
studentCount =0
WHILE there are more tags
if tag is "courseID"
read contents and display on form
END IF
if tag is " courseName"
read contents and display on form
END IF
if tag is "studnet"
tempStr = " "
Skip to next tag
we are now on studnetID
read contents of tag , add to tempStr, advance
we are now on studnetName
read contents of tag , add to tempStr, advance
we are now on porgram
read contents of tag , add to tempStr, advance
Display tempStr on form
Add 1 to studnentCount
14 1294
Question moved to .NET Forum.
Please give more information about your problem or error you are receiving. What are you trying to do? Thanks.
Please give more information about your problem or error you are receiving. What are you trying to do? Thanks.
I don't have error but i don't know how to do some steps .. the last one
please help me
*********** the problem is how can i leave it to read the studnent
or how i can do this ( that i have to do it )
tempStr is a stirng variable
studentCount is an integer variable
studentCount =0
WHILE there are more tags
if tag is "courseID"
read contents and display on form
END IF
if tag is " courseName"
read contents and display on form
END IF
if tag is "studnet"
tempStr = " "
Skip to next tag
we are now on studnetID
read contents of tag , add to tempStr, advance
we are now on studnetName
read contents of tag , add to tempStr, advance
we are now on porgram
read contents of tag , add to tempStr, advance
Display tempStr on form
Add 1 to studnentCount
--------------------------------------------------------------------------------
What are you trying to do?
What are you trying to do?
what i try to do
Dim document As XmlDocument = New XmlDocument
document.Load("CP2830.xml")
Dim reader As XmlNodeReader = New XmlNodeReader(document)
While reader.Read()
If reader.Name = "courseID" Then
Label1.Text = reader.ReadElementString()
End If
If reader.Name = "courseName" Then
Label2.Text = reader.ReadElementString()
End If before i end the while i have to do this steps
tempStr is a stirng variable
studentCount is an integer variable
studentCount =0
WHILE there are more tags
if tag is "courseID"
read contents and display on form
END IF
if tag is " courseName"
read contents and display on form
END IF
if tag is "studnet"
tempStr = " "
Skip to next tag
we are now on studnetID
read contents of tag , add to tempStr, advance
we are now on studnetName
read contents of tag , add to tempStr, advance
we are now on porgram
read contents of tag , add to tempStr, advance
Display tempStr on form
Add 1 to studnentCount after that i end while
i want to read every studnet id , name and program
now i clear or not what i try to do
Dim document As XmlDocument = New XmlDocument
document.Load("CP2830.xml")
Dim reader As XmlNodeReader = New XmlNodeReader(document)
While reader.Read()
If reader.Name = "courseID" Then
Label1.Text = reader.ReadElementString()
End If
If reader.Name = "courseName" Then
Label2.Text = reader.ReadElementString()
End If before i end the while i have to do this steps
tempStr is a stirng variable
studentCount is an integer variable
studentCount =0
WHILE there are more tags
if tag is "courseID"
read contents and display on form
END IF
if tag is " courseName"
read contents and display on form
END IF
if tag is "studnet"
tempStr = " "
Skip to next tag
we are now on studnetID
read contents of tag , add to tempStr, advance
we are now on studnetName
read contents of tag , add to tempStr, advance
we are now on porgram
read contents of tag , add to tempStr, advance
Display tempStr on form
Add 1 to studnentCount after that i end while
i want to read every studnet id , name and program
now i clear or not
Have you tried to just......write the code for this?
It appears that you know what you want to do.
Have you tried to Do It?
Have you tried to just......write the code for this?
It appears that you know what you want to do.
Have you tried to Do It?
yes i tried to do it but i don't now how to do it can you help me
My questions is hard or what nobady can help me or what
For starters,
Its difficult to follow your code.
I would rather get back to work..than take some time off it and go through your code (There is no valid commenting, nor have you used the code tags)
Secondly, You do seem to have coded all what you want, but are failing to explain what you want to do.
So think about what you want (dont expect someone over here to write code for you)
We will be happy with fixing up your code.
My questions is hard or what nobady can help me or what
First of all, It is difficult for the experts to answer questions when there is not enough details provided to understand the problem.
Secondly, to me it feels as if you are asking the us to do a homework assignment for you. It seems as if you have had some code given to you and you are to add onto the assignment or programming. It is also a rule here that members of this fourm not provide full solutions to homework problems.
The experts on this forum are more than happy to help you with a specific problem that you are facing.
Please attempt to solve the problem first and then post your question about specific problems that you are encountering.
-
Dim tempStr as string' (tempStr is a stirng variable it)
-
Dim studentCount as integer = 0'(studentCount is an integer variable)
-
-
While reader.Read() '((WHILE there are more tags))
-
-
'((if tag is "courseID"
-
'read contents and display on form
-
'END IF) )
-
-
If reader.Name = "courseID" Then
-
Label1.Text = reader.ReadElementString()
-
End IF
-
-
'((if tag is " courseName"
-
'read contents and display on form
-
'END IF))
-
-
If reader.Name = "courseName" Then
-
Label2.Text = reader.ReadElementString()
-
End If
-
-
'((((if tag is "studnet"
-
'tempStr = " "
-
'Skip to next tag
-
'we are now on studnetID
-
'read contents of tag , add to tempStr, advance
-
-
'we are now on studnetName
-
'read contents of tag , add to tempStr, advance
-
-
'we are now on porgram
-
'read contents of tag , add to tempStr, advance))))
-
-
-
If reader.Name = "student" And reader.NodeType = XmlNodeType.Element Then
-
tempStr = ""
-
-
If reader.Name = "studentID" Then
-
ListBox1.Text = tempStr + reader.ReadElementString()
-
End If
-
If reader.Name = "studentName" Then
-
ListBox1.Text = tempStr + reader.ReadElementString()
-
End If
-
If reader.Name = "program" Then
-
ListBox1.Text = tempStr + reader.ReadElementString()
-
End If
-
End If
-
ReDim Preserve Student(index)
-
Student(index) = reader.ReadElementString()
-
index += 1
-
studnetcount += 1
-
End If
-
-
-
For i = 0 To Student.GetUpperBound(0)
-
sum += Convert.ToInt32(Student(i))
-
Next
-
-
Label4.Text = studnetcount
-
-
End Sub
-
End While
when i did that nothing in the screen i don't know what problem it cant read the student id ,name and porgram
this is my work now do understand or no
Display tempStr on form
Add 1 to studnentCount
I'm not sure what type of object your reader variable is.
It's the only one that doesn't appear to be defined in this code.
In the future, when posting code, please use [code] tags.
An example of posting VB.NET code would be:
[code=vbnet]
'My VB.NET Code pasted here
[/code]
I'm not sure what type of object your reader variable is.
It's the only one that doesn't appear to be defined in this code.
In the future, when posting code, please use [code] tags.
An example of posting VB.NET code would be: -
'My VB.NET Code pasted here
-
reader to read
i want to know if anybody can understand what i want and help me or no
Sign in to post your reply or Sign up for a free account.
Similar topics
by: James Fortune |
last post by:
I have a lot of respect for David Fenton and Allen Browne, but I don't
understand why people who know how to write code to completely replace
a front end do not write something that will automate...
|
by: Joshua Russell |
last post by:
Hi,
Both the methods below open up a windows form called MasterForm. However, one works better than the other. Method 1 opens the form correctly but I don't have any reference to the instance of...
|
by: Mike Bulava |
last post by:
I have created a base form that I plan to use throughout my application let
call the form form1. I have Built the project then add another form that
inherits from form1, I add a few panel controls...
|
by: MD |
last post by:
I have been converting a program from VB6 to VB.Net and enhancing it as
well. All has been progressing OK although its been hard work. Now, all of
a sudden, when I try to execute a ShowDialog()...
|
by: Joshua Kendall |
last post by:
I have a script in which it keeps opening the same form
instead of only one instance. I also need help with a
form that has a password. Where do I put the actual
password? can I use a database for...
|
by: Lloyd Sheen |
last post by:
I have the following situation:
Need a user resizable user control. After much trying with user control I
came across the idea of hosting the controls in a form marked as not
TopLevel = false. ...
|
by: Stephen Rice |
last post by:
Hi,
I have a periodic problem which I am having a real time trying to sort.
Background:
An MDI VB app with a DB on SQL 2000.
I have wrapped all the DB access into an object which spawns a...
|
by: Geraldine Hobley |
last post by:
Hello,
In my project I am inheriting several forms. However when I
inherit from a form and add additional subroutines and methods to my
inherited form I get all sorts of problems. e.g. I sometimes...
|
by: dbuchanan |
last post by:
I have a Windows Forms application that accesses SQL Server 2k from a
small local network. The application has been used for weeks on other
systmes but a new install on a new machine retruns...
|
by: Dan Tallent |
last post by:
In my application I have a form (Customer) that I want to be able to open
multiple copies at once. Within this form I have other forms that can be
opened. Example: ZipCode. When the user enters...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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: 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: 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...
| |