Document.Elements("GradeProfile") Doest Not Return Elements With The Name Specified?
Jan 2, 2010Dim Document = XDocument.Load(FileName)
Dim findElement = Document.Elements("GradeProfile")
[code]....
Dim Document = XDocument.Load(FileName)
Dim findElement = Document.Elements("GradeProfile")
[code]....
I created a method and pass the element type, id, and any inner text that instantiates a new html element. The last statement: Me.Controls.Add(element) adds it to the end of the page, but I would like it to be inserted in a specific position (between 2 divs within a form). What I am describing is very similar to this post on SO here, although it was for javascript.
View 1 RepliesI managed encrypting an xml document by encrypting an element and then replacing the element with the encrypted data. A shown in the sample code below. Public Shared Sub Encrypt(ByVal textReader As TextReader, ByVal textWriter As TextWriter, ByVal certificateName As String)
[Code]...
I have the following in a .Net 2.0 app:
Private chequeColl() As Cheque
For i = 0 To m.Length - 2
chequeColl(i) = New Cheque()
[Code]....
I now want to make chequeColl only contain those items where Status is not equal to 41. In LINQ this would be easy but I can't think how to do it.
I cannot use the .Net 2.0 LINQ bridge products, I have to do this the old school way. At the end of it chequeColl must only contain those items that are not status of 41. I cannot have empty elements.
I want to make an application that takes values & innerhtml from some elements on a webpage i made. For that i added a webbrowser to the project, and pointed it to navigate to my localhost server where i have some pages. However when i use the document.getelementbyid i don't get nothing on my richtextbox, and i don't know why, i use this function lot in javascript & i think its quite similar, so i don't know why it doesn't work , here is the code i use.
[Code]...
I have a situation where I have an xml document that has a bunch of elements that I basically use as data variables. I populate the variables from various sources and then transform the xml file to an html file for user viewing.having to remember the names of all the data elements in the file is somewhat tedious. Is there a way to generate a strongly typed xml document object so that one can simply dot into the various data elements?
View 5 RepliesI am automating Word from VB.Net.I open a document by:
Dim msWord as Word.Application = CreateObject("Word.Application")
Dim doc As Word.Document = msWord.Documents.Add(Template:=Path)
where path points to a template file I created with a header and a watermark. The template has some bookmarks which I want to dynamically set to some appropriate text values:
doc.Bookmarks("DocumentTitle").Range.Text = "The Joy of Office Automation"
If I comment out that line, the document opens in Word with the watermark, etc, in place. If I let that line execute, it inserts the text as appropriate, but the watermark and other things disappear from the document. You can actually see it flash briefly, and then disappear.FWIW, this is Office Word 2007, and I am opening a .Dot (Word 97-2003) template. The Bookmark.Range.Text I am setting is in the document header.
I'm using Visual Studio 2008.I've recently begun toying with XML, because I have been using XLS up to this point. I want my apps to be more flexible.
OBJECTS:
Label1
Button1
Profile.xml (ok, not really an object, but you know ...)
GOAL: To display the Sum of <Calories> in Label1.Text when Button1 is clicked.
Here is the XML file (Profile.xml):
<?xml version="1.0" encoding="utf-8"?>
<Days>
<Date>[code].....
I am trying to add the values in my array.. and this is my code
dim totals(6) as decimal
public function AddIBNRTotal(byval Amt as decimal,srvcdesc as string) as decimal
if srvcdesc = "ZZ_TOTAL" then
[Code]....
I know the addIBNRfunction works fine cause it is displaying the correct amounts in my textbox
but when i call the Sumnumber() i am getting 70000 dollars short...
So is this the right way to add values or elements to a array...
<data>
<food>
<id>1</id>
<name>asparagus</name>
[Code]....
i would like to get the unique catlogs, so from this list i want to extract only 7190, 7192, and 7193. i have a script that puts it into a dropdownlist by using:
DropDownList1.DataSource = dv
DropDownList1.DataBind()
but i need it to get only the unique values.
I have the following piece of XML:
<xml>
<ObsCont xCampo="field1">
<xTexto>example1</xTexto>
[Code]....
How do I (using linq) get for example what is inside the xTexto tag that has as parent the ObsCont with the xCampo attribute "field2" ?
I'm attempting to grab data from a webpage, but I've been unsuccessful in my attempts.
View 1 RepliesI have a collection (a Dictionary, actually) of strings as the key and strings as the value. The value strings are filenames. I wish to find which elements contain a certain filename as the value, returning the Key so that I can modify the Value (change the filename).[code]....
View 4 RepliesHere's a portion of my XML string.
<OpenSearchDescription>
<opensearch:Query searchTerms="Star Wars"/>
<opensearch:totalResults>18</opensearch:totalResults>
[Code]....
Here's a portion of my xml file
<sources><comicbooks><source>
<profile>0</profile>
<name>Main</name>
<path>*mypath not showing*</path>
</source></comicbooks></sources>
I am also using a schema file for the sources.xml file.
Here's my
Dim fileSources As IO.File
If fileSources.Exists(filePath & "sources.xml") Then
Try
Dim Sources As XDocument = XDocument.Load(filePath & "sources.xml")
[Code] .....
lbSources doesn't get populated with anything and Label2 doesn't change either.
I have been learning VB.NET and am currently having troubles retrieving data from an XML file. I'm trying to keep the code as simple as possible as I only need to select single items from an XML file, not rows of data.
The XML file contains:
<CurrentPeakUsage xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://au.com.amnet.memberutils/">
<Period>
[code]....
While the msgbox will contain the entire XML document, so it is loading correctly, I can't pull the single element value.
How would you code this so that it adds up the first column, and then the second column?
Dim intSales(,) As Integer = {{100000, 150000}, _
{90000, 120000}, _
{75000, 210000}, _
[Code].....
There are 6 buttons have the same name in page i wantto click 3th button this code works:
WebBrowser1.Document.All.GetElementsByName("bid").Item(2).InvokeMember("click")
but this doesnt work :
WebBrowser1.Document.All.GetElementsByName("bid").Item(TextBox1.text).InvokeMember("click")
it gives error while debugging
I can create an ArrayList, but, is it possible to create it WITH some elements already?Normally, your arrays are empty, but what if I want to create an array with a few elements already?
View 2 RepliesI've managed to get my CSV file opened and the individual elements of each line read into an array. I've also managed to count and list the number of elements in the first row (i.e. the column headers).
[code]...
listOfNewFileRecords.Add(currentRow)' ADD EACH RECORD TO THE LIST AS THE FILE IS BEING READ Now the next stage is to access various cells within the whole opened file, so that I can condition/modify the text.So does 'ListOfNewFileRecords' have a way/method of accessing a particular element, in each record of the 'List'? I've tried using the intellisense, but can't make enough sense out of it to get anything to work.
how to search XML trees with LINQ using VB.net. I've found some very helpful posts for C#, but none for VB.net?How would I use LINQ to XML to get the value from example XML Getting a set of elements using linq How to get elements value with Linq To XML I want to get the inputlocation for the process where name = "MyProcess1" Based on the example links above, I have been trying code like this:
Dim inputLocation As String = xdocument.Descendants("Configurations").Descendants("process").First(Function(c) c.Element("name").Value = "MyProcess1").Element("inputLocation").Value
But the code is not returning any values. here is the xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Configurations>
<process>
[code]....
I am trying to create a array and then add elements to it based on some conditions and then add the elements in the array and display it...
but i am getting a larger number that expected..
this is my code
Dim IBNRTotal as decimal
dim element as integer
dim totals(6) as decimal -- create a array3
[Code]....
i know the amt value correct cause in return amt.. i am seeing the right value but somehow when it goes to the array and when i add the whole thing it doesnt seems right...
I am just starting VB at 60 years old and with no programming experience and nobody to ask for help...except here, of course. So needless to say I am hitting brickwalls. I am using "Murach's Visual Basic 2008" and it seems to be a good book. This is what I am up to I have to declare an array with 5 elements with an index. I think that part is OK. Then add code that adds each element to the next one every time a user clicks a button. I have had many tries but the best I can get is just the grand total of the elements. Here is the code I came up with:-
[Code]...
Is anyone able to show me how the button click would reveal a progressive total of the elements each time a user clicked on it? It would be good if the book came with answers or had a forum for their readers.
I want to copy the elements from one list to another.
View 4 Repliesway to assign value to elements of an Array. For an example,
Assign each Cheque1 to Cheque50 to the array (named as "Cheques()" ) elements.>>
Cheques(1) = Cheque1
Cheques(2) = Cheque2
Cheques(3) = Cheque3
[Code]....
tell me an efficient method of retrieving the CSS between tags on a page of markup in .NET?I've come up with a method which uses recursion, Split() and CompareTo() but is really long-winded, and I feel sure that there must be a far shorter (and more clever) method of doing the same.it is possible to have more than one element on a page, and that the element can be either or .
View 3 RepliesHow is it possible to take an XML document and in .Net scramble all text elements to make them un-readable to a human?
[Code]....
We only need scrambling not encryption, i.e. not human readable at a glance. It doesnt matter if the user could de-code it with 30 seconds effort. We dont know the schema of the XML, so all text elements must be located in code. We need to de-scramble the XML later how one would do that too. It needs to be simple, e.g. no pre-sharing keys, certificates, etc. Only the text elements should be scrambled - not the nodes, attributes, etc.
is there a formula for this? for example how many elements would be in this?dim m3array(5,4,1) as integer
View 4 RepliesI don't get it. If I want to change the text on a button from a thread other than the UI thread in Visual Basic .NET, I need to use a delegate, and do something along the lines of
Private Delegate Sub SetTextDelegate(ByVal TheText As String)
Private Sub delSetText(ByVal TheText As String)
Button1.Text = TheText
End Sub
[code]....
Of course I can make more generic functions that aren't so hard-wired. But still, it seems like a lot of typing. Am I doing this in a roundabout way? How is this not included in the control properties?
how do i clear all elements in an arraylist?
View 2 Replies