|
AndrusM wrote: XmlDocument xmlDocument = new XmlDocument();
xmlDocument.InnerXml = s;
What's this s? If it is a string representation of a XML file that you want to assign to the document, use the XmlDocument.LoadXml method instead.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Thank you.
I changed the line to
xmlDocument.LoadXml(s);
but node value is still null.
Andrus
|
|
|
|
|
Ok, since the code should work as it is, I would first check whether the XmlDocument instance really contains what you expect it to. Easiest way, would be writing the document to some test file by using the XmlDocument.Save method.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
I added a line
xmlDocument.Save(@"c:\test.xml");
text.xml seems to be OK.
So is this .NET bug ?
text.xml contains:
’╗┐<?xml version="1.0" encoding="utf-8"?>
<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2005/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
<DataElementStyle>ElementNormal</DataElementStyle>
<RightMargin>0.25in</RightMargin>
<Body>
<ReportItems>
<List Name="list1">
<DataInstanceName>Row</DataInstanceName>
<NoRows>Selliseid andmeid pole</NoRows>
<Style />
<DataSetName>Data</DataSetName>
<ReportItems>
<Textbox Name="Phone">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>1</ZIndex>
<CanGrow>false</CanGrow>
<Value>=Fields!Kood.Value</Value>
<Left>1.5in</Left>
<Width>1in</Width>
<Height>14pt</Height>
</Textbox>
<Textbox Name="ContactName">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<Width>1.5in</Width>
<Height>14pt</Height>
<CanGrow>false</CanGrow>
<Value>=Fields!Nimetus.Value</Value>
</Textbox>
</ReportItems>
</List>
</ReportItems>
<Style />
<Height>0.25in</Height>
<ColumnSpacing>0.25in</ColumnSpacing>
<Columns>1</Columns>
</Body>
<TopMargin>0.5in</TopMargin>
<DataSources>
<DataSource Name="DS1">
<ConnectionProperties>
<DataProvider>PostgreSQL</DataProvider>
<ConnectString>
</ConnectString>
</ConnectionProperties>
</DataSource>
</DataSources>
<DataSets>
<DataSet Name="Data">
<Query>
<DataSourceName>DS1</DataSourceName>
<CommandText>SELECT * FROM nomenkla</CommandText>
</Query>
<Fields>
<Field Name="Nimetus">
<DataField>nimetus</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="Kood">
<DataField>kood</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
</Fields>
</DataSet>
</DataSets>
<LeftMargin>0.25in</LeftMargin>
<BottomMargin>0.5in</BottomMargin>
<Width>2.5in</Width>
<PageHeader>
<Height>0pt</Height>
</PageHeader>
<PageFooter>
<Height>0pt</Height>
</PageFooter>
</Report>
Andrus
|
|
|
|
|
No, there is no bug. Seems the XPath expression is still not right. Try "/def:Report/def:DataSources/def:DataSource/def:ConnectionProperties/def:ConnectString" or "//def:DataSources/def:DataSource/def:ConnectionProperties/def:ConnectString"..
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Thank you very much. It works. Excellent.
Assigning string to InnerXML property works also.
I have no idea why you ordered to use LoadXML()
Andrus
|
|
|
|
|
I need to convert datareader to stongly typed entity list.
The following procedure returns error.
How to fix this ?
List<xEntity> CreateEntityList<xEntity>(IDataReader dataReader) {
List<xEntity> list = new List<xEntity>();
while (dataReader.Read()) {
object[] o;
dataReader.GetValues(o);
list.Add(o);
}
dataReader.Close();
return list;
}
Andrus
|
|
|
|
|
I had some reports that were local and pointed at a DataSet using an xsd file as the basis for creating the report, then using a stored procedure to fill the ds, assignig it to the report as the report source
oRpt.Load(_templatePath + _templateName);
oRpt.SetDataSource(ds);
now I have set up a webservice to provide the reports and I can assign an actual table to the report but can't seem to use one of the existing reports - as report keeps asking me to log into the MS SQL database - and since I am using the system authentication has me stumped.
Is there a way I can change the datasource of a webservice report before sending it across - or after?
Thanks
David Bambrick
|
|
|
|
|
What is best method to do this on Order Details data grid, when user select ProductID ProductPrice is automatically filled with value from Product table... and is on save written to Order details (so if price changed in Product table it will not be automatically updated in order details table (only when user select new product)?
I already have idea, tried to do new table adapter that have parameter query that do just that, and have event celled edit call fill on new table adapter... only remaining problem is how to copy new value to existing tableadapter.
I tried some work around things... but none is very professional so I'm looking for some elegant solution.
So how to copy value from that table adapter to data grid cell if possible (I only managed to drag and drop new table adapter and create text box on form, so I copy value of text box to grid, not something I would like to do)?
|
|
|
|
|
OK this can give you some idea...
private void order_DetailsDataGridView_CellEndEdit(object sender, DataGridViewCellEventArgs e)<br />
{<br />
if (order_DetailsDataGridView.Columns[e.ColumnIndex].DataPropertyName == "ProductID")<br />
{this.getProductCurrentPriceTableAdapter.Fill<br />
(this.northWndDataSet.GetProductCurrentPrice, (int)order_DetailsDataGridView[e.ColumnIndex, e.RowIndex].Value);<br />
order_DetailsDataGridView[e.ColumnIndex + 1, e.RowIndex].Value = decimal.Parse(unitPriceTextBox.Text); <br />
}<br />
}
so instead last line I want something better, any idea?
|
|
|
|
|
|
Hello everyone,
I have a media player application which I am currently using the main WinForm to display the image. The main WinForm is actually where all my stuff are on inclusing the control panel.
I was wondering if it is possible to send the image to a panel which is embeded inside my main WinForm? If such a thing is possible could someone give me some hint on "How to do it?".
Thanx for your help.
Khoramdin
|
|
|
|
|
How have you got the media player displayed? Is it using the windows api, if so you should be able to just switch the hwnd of the form for the hwnd of the panel and there you go. Unless you're doing it some other way.
|
|
|
|
|
Hello,
I ran into the following situation. First, i'll list a small excerpt of the process list output from Process Explorer [^];
Process PID
System Idle Process 0
Interrupts n/a
DPCs n/a
cdas56e.exe 504
StartupMonitor.exe 3388
eclipse.exe 3396
javaw.exe 3052
emulator.exe 2752
jdbgagt.exe 3872
procexp.exe 1592
iexplore.exe 2168
taskmgr.exe 1536
procexp.exe 3688
explorer.exe 2172
multiDesk.exe 2164 The process that is bolded, namely eclipse.exe and it's children, is orphaned because the explorer.exe died for some reason. I started a new explorer from the taskmgr.exe application. The problem that I am trying to solve is that I can no longer access the eclipse.exe application after it's parent, explorer.exe, dies. (I tried to use the "Bring to Front" command from taskmgr.exe but that did not work because that option was turned off.)
How would I go about writing a program to reattach an orphan process(es) to a new explorer.exe process?
Sources, URL s, etc..., would be greatly appreciated.
Thanks,
|
|
|
|
|
Hello everyone,
I am trying to get some hotkey "Short-cut" for my application. I am currently using the following codes for a single key event and everything works fine.
switch(e.KeyCode)
{
case Keys.Right:
{
_Pacman.MovementDirection = MovementDirections.Right;
break;
}
case Keys.Left:
{
_Pacman.MovementDirection = MovementDirections.Left;
break;
}
case Keys.Down:
{
_Pacman.MovementDirection = MovementDirections.Down;
break;
}
case Keys.Up:
{
_Pacman.MovementDirection = MovementDirections.Up;
break;
}
}
I wish to have the case that "Ctrl" key to be added to these key events. Can someone tell me what I need to do to have this, please.
Thank you for your help.
Khoramdin
|
|
|
|
|
if (e.Control == true) {
switch(e.KeyCode)
{
case Keys.Right:
{
_Pacman.MovementDirection = MovementDirections.Right;
break;
}
...
}
}
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
hey, I'm havening trouble trying to get the letter under the mouse
my purpose is to make each letter in a label select able or a button.
can any one help, i would be great if you do
Thanks
|
|
|
|
|
There's a Win32 API called WindowFromPoint, this will give you the window handle of the control you are over. From there, you can use GetWindowText, but working out what letter is under the mouse, will be a little more complex, you need to get the font details from the control, and work out how that font renders. A multi line control makes it even harder. I imagine getting it to work 100% of the time would be a very big job, indeed.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
yea it would be, i'll look into that and see how i go, my font is 'Lucida Console, 9pt'
which makes each letter the same width part.
thanks for that
|
|
|
|
|
I added both the convert and revert in title for completness. I am using the ArrayList.ToArray(typeof(byte)) now to return the byte array.
now I need to convert it back to an Arraylist. Cannot seem to figure that one out for some reason.
Any help would be appreciated.
Steve Welborn
Software Engineer
BitWise Solutions
|
|
|
|
|
Try this:
public ArrayList ToArrayList(byte[] buffer)
{
if (buffer == null || buffer.Length == 0)
return null;
ArrayList list = new ArrayList();
list.AddRange(buffer);
return list;
}
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Easy enough. thank you Pete
Steve Welborn
Software Engineer
BitWise Solutions
|
|
|
|
|
Not a problem.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
How can I retrieve information about the devices attached to the IDE.
|
|
|
|
|
Where do you want to retrieve this ? How do devices attach to the IDE, do you mean database servers ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|