|
Hopefully somebody can tell me what I’m doing wrong … I’ve never used an XML file before, so I’m obviously misunderstanding something ...
This XML file :
="1.0"="utf-8"
<Folders>
<TemplatesFolder>E:\Newsletter Templates (Email)\</TemplatesFolder>
<NewsLetterFolder>E:\Newsletters\</NewsLetterFolder>
</Folders>
Read by this code :
Do While (myXml.Read())
If myXml.IsStartElement() Then
If myXml.Name = "TemplatesFolder" Then
myXml.Read()
myTempFolder = myXml.Value
End If
If myXml.Name = "NewsLetterFolder" Then
myXml.Read()
myNlFolder = myXml.Value
End If
End If
Loop
Gives this error:
There are multiple root elements. Line 3, position 2.
|
|
|
|
|
Just a guess: The backslash/left-angle-bracket combination may be confusing the parser. The backslash character is sometimes used to "escape" the following character. If this is happening, it may not be recognizing the left-angle bracket or the end tag.
Maybe put the folder names in double quotes.
|
|
|
|
|
There is nothing wrong with the XML (presuming that your ascii looking text really is ascii text.)
You posted code that shows how you are attempting to parse the xml tree.
But how are you creating the tree in the first place?
|
|
|
|
|
Google XPath and SelectSingleNode... the code you have is about the worst possible way to deal with XML.
|
|
|
|
|
Hi
Use this script to initialize a dos program:
Dim myprocess As New Process
Dim StartInfo As New System.Diagnostics.ProcessStartInfo
Public Sub Audio128(ByVal MyPathandFilename As String, ByVal MyFileName As String)
StartInfo.FileName = MyProgram.exe
StartInfo.RedirectStandardInput = True
StartInfo.RedirectStandardOutput = True
StartInfo.UseShellExecute = False
myprocess.StartInfo = StartInfo
myprocess.Start()
The script works fine but the prompt is displayed while the program EXE works.
Is possible to hide it?
Thanks in advance
|
|
|
|
|
Hi,
Try
StartInfo.WindowStyle = ProcessWindowStyle.Hidden
Hope this helps.
In some cases, my signature will be longer than my message...
<em style="color:red"> <b>ProgramFOX</b></em> ProgramFOX
|
|
|
|
|
Thank ProgramFox
I tested and does not work
It seems to have no effect
|
|
|
|
|
It won't work unless UseShellExecute is set to True, but then you lose the redirect abilities because those have to be set to False in order for the process to even launch.
You can't hide the window if you're going to redirect the streams.
|
|
|
|
|
Try setting the ProcessStartInfo.CreateNoWindow property. I'm suprised you didn't see this when you were browsing the documentation!
|
|
|
|
|
In my asp.net dynamic data project I want to read an excel file using suitable Microsoft technology (Not Excel). Someone said their was a server side tool for this? I want to read the first few columns of data from a table?
Any suggestions or directions on where to go?
|
|
|
|
|
Yes, Excel files are encoded in XML.
So to get started you can include following namespaces in the codebehind of your page:
System.Xml (work with XML objects)
System.IO (read/write to files)
The Internet is full of code example that show you how to use them.
http://support.microsoft.com/kb/301228[^]
.
|
|
|
|
|
It depends on the version of Excel format the file is saved in. If it's in 2003 and below, it's a multiple stream binary file that will be just about impossible to decipher. If it's 2007 and above, it'll be a .ZIP format file with multiple XML files inside of it. Again, a royal pain to decipher without the SDK. Seriously, save yourself MONTHS of work and use the Visual Studio Tools for Office to do this.
|
|
|
|
|
string stmp = "\n<rs:data ItemCount=\"6\" xmlns:rs=\"urn:schemas-microsoft-com:rowset\">\n <z:row _x041a__x043b__x0438__x0435__x043d__x0442___x043a__x043e__x0434_=\"16440042770нÑ\" _x0424__x0438__x043b__x0438__x0430__x043b___x041a__x043e__x0434_=\"20706\" _x041a__x043e__x0434_=\"3049\" _x041d__x0430__x0437__x0432__x0430__x043d__x0438__x0435_=\"Татнефть УÐ*С\" BdcIdentity=\"__bg01003300030043009300\" xmlns:z=\"#RowsetSchema\" />\n <z:row _x041a__x043b__x0438__x0435__x043d__x0442___x043a__x043e__x0434_=\"16440042770нÑ\" _x0424__x0438__x043b__x0438__x0430__x043b___x041a__x043e__x0434_=\"20706\" _x041a__x043e__x0434_=\"5328\" _x041d__x0430__x0437__x0432__x0430__x043d__x0438__x0435_=\"Ð*озница\" BdcIdentity=\"__bg01005300330023008300\" xmlns:z=\"#RowsetSchema\" />\n <z:row _x041a__x043b__x0438__x0435__x043d__x0442___x043a__x043e__x0434_=\"16440042770нÑ\" _x0424__x0438__x043b__x0438__x0430__x043b___x041a__x043e__x0434_=\"20706\" _x041a__x043e__x0434_=\"5353\" _x041d__x0430__x0437__x0432__x0430__x043d__x0438__x0435_=\"Медуница\" BdcIdentity=\"__bg01005300330053003300\" xmlns:z=\"#RowsetSchema\" />\n <z:row _x041a__x043b__x0438__x0435__x043d__x0442___x043a__x043e__x0434_=\"16440042770нÑ\" _x0424__x0438__x043b__x0438__x0430__x043b___x041a__x043e__x0434_=\"20706\" _x041a__x043e__x0434_=\"5357\" _x041d__x0430__x0437__x0432__x0430__x043d__x0438__x0435_=\"Оптовик\" BdcIdentity=\"__bg01005300330053007300\" xmlns:z=\"#RowsetSchema\" />\n <z:row _x041a__x043b__x0438__x0435__x043d__x0442___x043a__x043e__x0434_=\"16440042770нÑ\" _x0424__x0438__x043b__x0438__x0430__x043b___x041a__x043e__x0434_=\"20706\" _x041a__x043e__x0434_=\"8372\" _x041d__x0430__x0437__x0432__x0430__x043d__x0438__x0435_=\"Ðртемьев ИП\" BdcIdentity=\"__bg01008300330073002300\" xmlns:z=\"#RowsetSchema\" />\n <z:row _x041a__x043b__x0438__x0435__x043d__x0442___x043a__x043e__x0434_=\"16440042770нÑ\" _x0424__x0438__x043b__x0438__x0430__x043b___x041a__x043e__x0434_=\"20706\" _x041a__x043e__x0434_=\"8620\" _x041d__x0430__x0437__x0432__x0430__x043d__x0438__x0435_=\"Шифа\" BdcIdentity=\"__bg01008300630023000300\" xmlns:z=\"#RowsetSchema\" />\n</rs:data>\n";
XmlDocument xd = new XmlDocument();
xd.LoadXml(stmp);
DataSet dsQuery = new DataSet();
var node = xd.DocumentElement as XmlNode;
XmlReader reader1 = new XmlNodeReader(node);
dsQuery.ReadXml(reader1);
var v1 = dsQuery.Tables["row"].Rows[4]["_x041a__x043e__x0434_"];
var v2 = dsQuery.Tables["row"].Rows[4][dsQuery.Tables["row"].Columns[2].ColumnName];
The line with v1 throws an exception:
Column '_x041a__x043e__x0434_' does not belong to table row.
The line with v2 throws no exception, however it returns an empty value instead of expected integer value. I wonder why it happens and how to force dataset to work with my XML correctly?
|
|
|
|
|
I neglected to include my DB creation script in my Git repo to bring it home for some weekend get-ahead work. Now I thought the lauded 'Generate Database from Model' feature would be my saviour here, but it's useless. It uses the entity set names to generate table names, so where all my original table names were singular, the generated ones are plural.
Some wag at StackOverflow suggested making all the entity set names singular but all I can think of is somehow extracting all original table names, generating the script, then doing a marathon search and replace. Any suggestions on how I could do this? Any other suggestions?
Disclaimer: This is a duplicate of my StackOverflow question here.
|
|
|
|
|
When I run the .net Reflector,I got a Error,it says the "\UIAutomaionProvider damaged and can't read".
I just can run it well the days before.
|
|
|
|
|
|
Actually i have more than 10 columns....in designing form i have 2 dropdownlist and 2 textboxes..
1-Dropdownlist-for select the state
2-Dropdownlist -for choose the column name like temperature, sea level,etc..
3-textbox-for select start date
4-textbox-for select end date
Now i wanna generate chart for this functions...whenever i choose the state and temperature and start date and end date i need to generate chart for this process.
I wanna shows details in chart in between date from start date to end date...
Pls give ur idea for this process....
Deenuji
|
|
|
|
|
Hey..I'm new to VB.net programming and i'm having a problem with my project.
here's a sample code
Private Sub MinsToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MinsToolStripMenuItem.Click
Dim b As Boolean
MsgBox(" pop up will return on " & Now.AddMinutes(5))
Dim a = Now.AddMinutes(5)
Try
b = System.Convert.ToBoolean(a)
Catch exception As System.InvalidCastException
If a = True Then
PopupNotifier1.Popup()
End If
End Try
End Sub
What i want is that after I click the MinsToolStripMenuItem, it will wait for five mins and after that, popupnotifier will popup..
Any help is greatly appreciated..
|
|
|
|
|
Following should do it:
System.Threading.Thread.Sleep(30000)
|
|
|
|
|
+5
Jibesh V P
|
|
|
|
|
Hi All,
I am using Entity Framework 1.0, I have Claims Table as master table and Requests Table as details table. First I am deleting data from Requests (details) table and then I am trying to delete data from master table.
Even though there is no record exists in Requests table I am unable to delete rows from Claims table, it is throwing FK relationship exception. What could be the reason? I am not understaing because when there is no recod exists in Details table for the Master table record. Then that record in Master table should be easily deleted.
I am trying my best to resolve is, any body if they have any idea please help me.
I am trying to google too, but if anybody have any idea, it would be great if they help me.
Thanks in advance.
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
|
|
|
|
|
Why on earth are you using EF 1.0?? It was a nice idea, but lacked SOOO much usable stuff it wasn't really worth anything.
EF 5 is out now and is FAR better than 1.0.
|
|
|
|
|
indian143 wrote: any body if they have any idea please help me.
Some general possibilities
- There is still something in details.
- The way you coded the details delete in the framework is wrong.
- The framework is handling the delete for you as a batch but when it does the real commit it is doing the master delete first.
|
|
|
|
|
Hi all,
I need to pu an image in a button but my application runs in Windows CE so I'm using the Compact Framework and in this context the object Button has no property like Image , BackgroundImage , Bitmap or something similar.
Anybody knows how I can do?
Thanks to all.
|
|
|
|
|
steve_9496613 wrote: Anybody knows how I can do?
Try MSDN[^]
|
|
|
|