and the issue I appear to be having is in the function "Unable to cast object of type'WhereSelectEnumerableIterator`2[System.Xml.Linq.XElement,System.String]' to type 'System.IConvertible'."What I am trying to do is populate a strongly typed list of the records, where the list should contain the record id, the field value, and the fields name
I've just got to know XDocument in VB .NET and really like the way I can write XML documents in my code but have just one little problem I can't find a good solution for. The problem is with IIF that I use to check some conditions for example if a node should be printed or not.The problem is when I want to print multiple nodes (from a list of strings) if my conditions are true first. Here is the problem code where I'm checking few conditions and in true part I'll try to loop nodes:
I am up to the point where my application requests and receives a response from digg.com, but I cannot figure out how to properly dimension the XDocument class (as the tutorial shows) to read the xmlcontent that is retrieved.the tutorial is in C# (which I know very little about), but I do not see why I cannot access this class. Intellisense suggested replacing XDocument with Document.Run, but that got me nowhere. I also read that this class was part of the System.Xml.Linq namespace, but even trying to dimension my variable as
I cannot get anything back from the following code... it always pops 0, and the _Qry is never populated, even though _MBXml is populated properly (hovering during debug shows it)
_MetaBasePath += "IIS6-MetaBase.xml" '"metabase.xml" _MBXml = XDocument.Load(_MetaBasePath, LoadOptions.PreserveWhitespace) _Qry = (From n In _MBXml.<IIsWebServer>
I have modified the MSDN example to reflect my problem. When using a namespace I can't get the document to validate as I would expect and when validating a document that doesnt have a namespace it validates regardless of whether or not it has an error in it or not.
Dim errors As Boolean = False
Private Sub XSDErrors(ByVal o As Object, ByVal e As ValidationEventArgs) Console.WriteLine("{0}", e.Message) errors = True End Sub
I am using XDocument to parse an XML file. The first thing I'm trying to do is count the number of <entry> elements under the root. I have this code:
dim xmldoc as Xdocument = Xdocument.parse(string variable) Messagebox.show(xmldoc.root.<entry>.Count)
I will paste the string containig the XML below (it's kinda long, but not too much). Everytime I run this script, it says there are 0 <entry> child elements, but that's clearly not the case. I'm not sure what I'm doing wrong here.. not sure if it has something to do with namespaces or what.
I am then able to read the contents. However I need to get the namespace of the xml document. I can easily copy and paste it from the xml file and then import the namespace, but I'm building an importer class and I need to get the namespace so I can make my class as dynamic as possible.
I am stuck on a project which needs to exchange data between two programs who have different coontrol files. Program A just creates a a XML File whereas Program B needs the input as an array with two "columns" - but how do can I do the conversion?
Example: The xml looks like: ` <Presentation> <Options Name="1"> <Output>MyOutPut</Output>
[Code]....
But how can I achieve this? I am using vb.net and LINQ and have no idea how to solve this problem. I tried some LINQ queries but I get only indivudal nodes or attributes so I think it would be better to try a different idea.
The XML String I am getting from other application is converting & to & and 0F to ?F etc. I am loading the XML string into XDocument and inserting into db using linq. Is there any easy way to replace those characters with actual ones.
I am receiving this XML file and I need to receive these values from there using an XDocument or XMLFileReader, I just can't figure out how to go through all the nodes to receive my values:
(Values I need: both results, address1, address2, city, state abb., and zip) <?xml version="1.0" encoding="utf-8" ?> - <ResponseArray xmlns="urn:mdWebServiceAddress"
I am trying to learn about XML literals in VB. In a "learning" project which based on a console application template the following compiles and runs without error (and without any special Imports statements nor references added):
Module Module1 Sub Main() Dim db As New AdventureWorksDataContext
I wrote a function ReadXML().This function reads XML file and returns a string.The string contains all the XML file nodes values to duild SQL query dynamically. Any way My code is working. Is this right way? Can you please suggest me the unnecessary code(loops...)in this function, So that I can do the code in a better way.[code]
The Datagrid is inside a TabItem. The error occurs when, after cleaning and filling the Datagrid with new items, I select the Tabitem with the Datagrid inside. Until I don't try to "see" the Datagrid, there's no problem.Error (translated fm italian): "Source code not available for the current path"In the details I find:Message: "The Visual specified is not an ancestor of this Visual"TargetSite.Name: "TrySimpleTransformToAncestor"StackTrace is very long, if you wont I'll post it.The error occurs always with some specific data, but I can't find anything different in these data from all the other data.These data cause the error (example row):
I need to know what file attributes cant be added with another I know that Normal ontradicts all but Directory and NotIndexed. I also found out about Temporary cant be with encrypted or compressed and visa versa
I also got as far as creating an XPath Query: (/main/SourceType/@ID) but for the life of me do not know what to do with it. Im trying to pull all source type ID's into an array of strings if it is possible!
I'm writing a class-library in VB.Net and one of the subs that are being called from the application which is using my library has more or less the following syntax:
Public Sub LoadDict(ByVal PhoneticType As String, ByVal strDict As String) where PhoneticType can be phonSoundex, phonDoubleMetaphone or noPhonetic
I want to give the application-developer a possibility to select the PhoneticType from a list when writing the call of above sub (I think it's called attribute-arguments). This would make it easier for the developer since spelling-errors can be avoided and which will avoid errors when using the library. I think it's all about attributes but I haven't managed to get it to work despite trying.
i'm trying to read the details information from various audio formatted files, most of which are mp3s. specifically i'd like to be able to read the title, artist, and # for a few hundred files that need renaming and resorting, so i'm trying to start with a single file.basically, if you view the properties of any mp3, and go to the details tab, all of this information is listed. i need to grab it programatically using visual studio 2010