|
XPathDocument doc = new XPathDocument("filename.xml");<br />
XPathNavigator nav = doc.CreateNavigator();<br />
XPathNodeIterator it = nav.Select("/field");<br />
while(it.MoveNext())<br />
{}
Mazy
No sig. available now.
|
|
|
|
|
Is there a particular reason you are not just loading the xml into a DataSet? DataSet.ReadXml then you can directly objects to the fields etc..
|
|
|
|
|
The only reason is simply that I didnt know it was possible
But now you have mentioned it, that sounds like an excellent idea, as I know my way round a dataset much better than I do XML
But also thanks to Mazdak as I also like the suggestion he made, as it forces me to learn something new about C# rather than use what i already know as a crutch.
post.mode = signature;
SELECT everything FROM everywhere WHERE something = something_else;
> 1 Row Returned
> 42
|
|
|
|
|
Hallo, I have a strange problem:
I can add an Excel reference, but I can't add an Access reference, I get the following error:
" A reference to 'MS Access 10.0 Object Library' could not be added. Converting the type library to a .NET assembly failed. A dependent type library 'OWC10' could not be convertedt to a .NET assembly. A dependent type library 'ADODB' could not be converted to a .NET assembly. Item has already been added. Key in dictionary: "C:\windows\assembly\gac\adodb\7.0.3300.0_.... etc\adodb.dll" Key being added: "C:\windows\assembly\gac\adodb\7.0.3300.0_.... etc\adodb.dll".
I'm using winxp and officexp. I'm also using vsnet, not the 2003 version.
Thank you
|
|
|
|
|
A better way is to download the Office Primary Interop Assemblies (PIAs) created by Microsoft themselves. These contain everything you'll need and are already converted to assemblies and signed by Microsoft.
In the future, always try to find existing PIAs from the unmanaged code publisher themselves before making your own. MSHTML (what the WebBrowser control / IE uses to parse and render) already has one, for instance, that is installed with VS.NET: Microsoft.MSHTML.dll.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
I have a RichTextBox control with many lines of word-wrapped text. I'm having difficulty finding out which line of text the selection caret is on.
For example
|--------|
|blah asd
|dsadea
|blah
|--------|
That RichTextBox drawing has 3 lines of word-wrapped text. Sadly, RichTextBox.Lines tells me there is only 1 line because it defines "lines" as being seperated by a new line character, not seperated by word-wrapping.
Anyone know how to determine if the caret is on the last line?
The graveyards are filled with indispensible men.
|
|
|
|
|
I use the HACK to denote "the following code is a hack to work around some unexpected behavior." Especially where using components, it often turns out that the HACK was neccessitated by a bug that the component vendor may correct or Microsoft might change in future versions of the Framework.
What do you use the HACK task for?
|
|
|
|
|
Hi,
I usually use the HACK task in the event that I need to employ a quick solution to a problem that may (or if not maintained) require a more well-thought out solution to a problem that had to be immediately addressed.
The interesting thing about those types of additions are that they usually evoke thought as to what caused the problem and make one wonder if other parts of the code suffer from the same.
Regards,
Joe
|
|
|
|
|
I use HACK as a variant on TODO. I use TODO if I know that the solution can be quickly developed and just needs my time to do it. I use HACK if I know I need a solution but the code may be complex and may need to prototyped.
_____________________________________________
The world is a dangerous place. Not because of those that do evil, but because of those who look on and do nothing.
|
|
|
|
|
hi,
I am added property to my class which is inherit form Control.I set to that property attribute
System.ComponentModel.Browsable ,but I can not see my property at Design time. Is somebody tell me how should I fix it.
Hare is my property:
[System.ComponentModel.Browsable(true)]
public string Alabala
{
get
{
return alabala;
}
set
{
alabala = value;
}
}
|
|
|
|
|
Stop double posting
// Steve McLenithan
Cluelessnes: There are no stupid questions, but there are a lot of inquisitive idots.
|
|
|
|
|
hi,
I am added property to my class which is inherit form Control.I set to that property attribute
System.ComponentModel.Browsable ,but I can not see my property at Design time. Is somebody tell me how should I fix it.
|
|
|
|
|
From the API docs:
"Control does not have any user interface (UI) specific features. If you are authoring a control that does not have a UI, or combines other controls that render their own UI, derive from Control."
This means that there is no inherent UI aspect to a generic Control. Therefore, there is nothing to see at design time. What you need to do is derive your class from a control that already has a UI element to it. Something like System.Web.UI.WebControls.Panel or System.Windows.Forms.Panel (for a web app and windows forms app respectively) would work well in this case.
Hope that helps.
-Matt
------------------------------------------
The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris.
--Larry Wall
|
|
|
|
|
Hi
i am using an OdbcDataReader. But i can't read the fields, except the 0. field. I get "system.nullreferenceexception".
my code is like below:
this is working:
MessageBox.Show( objOdbcDR.GetInt32(0).ToString() );
this is throwing the exception:
MessageBox.Show( objOdbcDR.GetString(1) );
does anyone know why?
thanks.
Ozgur Nevres
|
|
|
|
|
Does your SQL query select more than one column?
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
|
You did call OdbcDataReader.Read before making any calls, didn't you?
BTW, it's hard to know what to ask to diagnose the problem because you gave very little information. Perhaps some surrounding code (from getting the OdbcDataReader to closing it) would be more helpful. The problem is most likely not with the immediate statement that throws an exception.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hi guys,
I'd like to know how to paste OLE document in RichTextBox giving the ability to the user to choose if to paste it as icon, as formatted contents (i.e. word, excel,...) or link.
thanx
tommaso
|
|
|
|
|
There's a good article on this site about taking control over COM objects, images, etc inside RichTextBoxes. I suggest a search of the articles.
The graveyards are filled with indispensible men.
|
|
|
|
|
Hi there,
how can i display an existing (local) html file in a WebBrowser window (without any buttons)?
The html file should just be displayed in this window - that´s it. But i don´t know how to do it...
Greetings,
Stefano
|
|
|
|
|
- Create a new Form
- Set the FormBorderStyle of the form to FormBorderStyle.None
- Set WindowState to WindowState.Maximized
- Place a WebBrowser control on a form
- Set Dock to Fill
- Show the form, call WebBrowser.Navigate
You should see the html file and nothing else. No buttons, no form borders, no File->Exit menu.
|
|
|
|
|
Whicht parameters do i need to fill this method? I just have the html filename, e.g. test.html.
Kind regards,
Stefano
|
|
|
|
|
StefaNeo wrote:
Whicht parameters do i need to fill this method? I just have the html filename, e.g. test.html.
<code>Object o = null;
string url = "[FullPathToYourFile]";
this.webBrowser.Navigate(url, ref o, ref o, ref o, ref o);</code>
-Nick Parker
DeveloperNotes.com
|
|
|
|
|
It works, but you can make it cleaner with Missing.Value:
object empty = System.Reflection.Missing.Value;
string url = "....html";
webBrowser.Navigate(url, ref empty, ref empty, ref empty, ref empty);
|
|
|
|
|
Hi,
I'm working on automated software tests with c#. As long as I stick to windows controls, everything is fine. But I now need to use the Active Accessibility functions as well (for webtests, Flash based software and so on)
The (rare) documentation I found on the topic is only for c++, and I just can't figure out how to use it correctly in c#. How do I correctly implement functions like AccessibleObjectFromWindow which uses severa pointers ?
has anyone already gathered some experience with it, or do you know where I could find relevant c# information on the topic ?
thx a lot
Ulf
|
|
|
|