|
|
Try the code below:
string xmlFilePath = @"C:\Persons.xml";
System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
doc.Load(xmlFilePath);
System.Xml.XmlNode pNode = doc.SelectSingleNode("persons");
for (int i = 0; i < pNode.ChildNodes.Count; i++)
{
System.Xml.XmlNode personNode = pNode.ChildNodes[i];
for (int x = 0; x < personNode.ChildNodes.Count; x++)
{
string value = personNode.ChildNodes[x].InnerText;
}
}
Hope this helps.
|
|
|
|
|
Thank you
modified on Tuesday, October 14, 2008 10:20 AM
|
|
|
|
|
Look at the member methods of XmlDocument, read the documentation.
|
|
|
|
|
|
Hi ,
I am developing an application in C# to control remote systems in local network.I need to capture the screen of a remote machine,is that possible??
Please help...
|
|
|
|
|
Yes, you can , arround 4 years ago i have done a same application on VB.Net. What we have done, just trap the Printscreen button using interupt and save the image on disk and read the image as networkstream and display it you applicaiton picture box by saving the receiving stream as image.
Hope this will helps you to startup
cheers,
Abhijit
|
|
|
|
|
http://www.codeproject.com/KB/IP/ScreenCast_With_Control.aspx
Probably seen it already or even solved it by now.
|
|
|
|
|
I am developing software in C#. I generate reports in datagridview and also generate report directly in printdocument control.
My problem is, when I want to print only some pages, i.e. page from 2 to 3, i am not able to print the same, i give code as under
In print click event
printDialog1.AllowSomePages = true;
printDialog1.ShowDialog();
printDocument1.PrinterSettings.PrintRange = printDialog1.PrinterSettings.PrintRange;
printDocument1.PrinterSettings.FromPage = printDialog1.PrinterSettings.FromPage;
printDocument1.PrinterSettings.ToPage = printDialog1.PrinterSettings.ToPage;
printDocument1.Print();
If there are 6 pages in the report all the 6 pages are printed not page from 2 to 3. Why? Can anyone face this problem. Is there any solutions?
Suleh.
|
|
|
|
|
Hi All,
I'm still new to development, I'm trying to link a text box to an ID in a table. This text box will be an identfier and it will insert the text to the table when it has linked to the id.
Is this possible or should i look into something else.
Regards,
Ndeza
|
|
|
|
|
Hi Ndeza,
sure, this is possible (You could write a whole rocket steering application in C# if you like, am I right?) .
But please be sure to post more information about the issue. What kind of table, what kind of Id? What do you want to achieve exactly.
Regards
Sebastian
|
|
|
|
|
Hi Sebastian,
I've got a Foreign Exchange app that I'm trying to create, and the table is stored in the database. This table has an ID where it links to the different currencies. Now what I want to do is I want to link the text boxes of all the different currencies to the currencies in the table. I haven't done much with this but I've created a stored proc that updates, and inserts.
cmd.Parameters.Add("@PlayerTypeID", SqlDbType.Int, 20);
cmd.Parameters["@PlayerTypeID"].Value = txt0.Text; -- this is what I’ve been trying and it’s not working out.
cmd.Parameters.Add("@DateYear", SqlDbType.Int, 40);
cmd.Parameters["@DateYear"].Value = cbmYear.SelectedItem;
cmd.Parameters.Add("@DateMonth", SqlDbType.Int, 4);
cmd.Parameters["@DateMonth"].Value = cmbMonth.SelectedItem;
cmd.Parameters.Add("@FXR", SqlDbType.Float);
cmd.Parameters["@FXR"].Value = txt0.Text;
cmd.Parameters["@FXR"].Value = txt3.Text;
cmd.Parameters["@FXR"].Value = txt5.Text;
cmd.Parameters["@FXR"].Value = txt6.Text;
cmd.Parameters["@FXR"].Value = txt9.Text;
cmd.Parameters["@FXR"].Value = txt55.Text;
cmd.Parameters["@FXR"].Value = txt61.Text;
cmd.Parameters["@FXR"].Value = txt76.Text;
cmd.Parameters["@FXR"].Value = txt77.Text;
cmd.Parameters["@FXR"].Value = txt81.Text;
But now my problem is that I just cant get the PlayerTypeID being the ID link to the text box. Please can you assist with an example of some kind.
Thank you,
Ndeza
|
|
|
|
|
Hmm...
still not sure if I understand everything. All you do here is to put the text of the txt0-Textbox into the PlayerTypeID (same for the @FXR values). So you write all the values stored in your textboxes into the database... If you change sth. within the database it will not automatically change in your app...
Could you please explain in more detail what you mean by "link the textboxes ... in the table". What means "link"?
Regards,
Sebastian
|
|
|
|
|
Ok,
For each currency there is an ID, what I'm trying to do is make the Text box that I will also enter the new exchange rate into, the text box will correspond with the ID(PlayerTypeID). Basically, I’m trying to make the text box be an Id identifier and also an input text that will update the @FXR.
What I mean by link; I want the text box to identify the id in which it will enter the new exchange rate.
Thank you,
Ndeza
|
|
|
|
|
Alright,
now i'm getting close to the point. I thin k you have two options here:
-------------
First one:
Use a dictionary to store the textbox and the playerid. Looks somethind like this:
Dictionary<textbox,> dictBoxes = new Dictionary<textbox,>();
dictBoxes.Add(txt0, );
In your storing method you can then access the value:
cmd.Parameters["@PlayerTypeID"].Value = dictBoxes[txt0];
---------------
Second option is to inherit the textbox and add another property:
public class MyPlayerIDTextbox:Textbox {
private string m_sPlayerID;
public string PlayerID {
get { return this.m_sPlayerID;}
set { this.m_sPlayerID = value;}
}
}
Than you have to set the playerid of your textbox once:
MyPlayerIDTextbox txt0 = new MyPlayerIDTextbox();
txt0.PlayerID =
And the storing method will look like this:
cmd.Parameters["@PlayerTypeID"].Value = txt0.PlayerID;
Hope this helps you a bit.
Regards
Sebastian
P.S: I would prefer the dictionary method, it is simplier I think. Or any other suggestions?
|
|
|
|
|
Heya Sebastian,
Wow you were right the Dictionary works perfect, but the only thing is that I have allot of exchange rates to update and insert and it only inserts for one where as I'm trying to insert in one go. Please can you assist if you can?
Oh the second option is quite complicated as you will need to convert a string to an INT32.
But I prefer the First Option much easier and more understandable.
Regards,
Ndeza
/// create the dictionary
Dictionary<TextBox, int> dictBoxes = new Dictionary<TextBox, int>();
/// than put the id in it
dictBoxes.Add(txt0, 0);
dictBoxes.Add(txt3, 3);
dictBoxes.Add(txt5, 5);
dictBoxes.Add(txt55, 55);
dictBoxes.Add(txt6, 6);
dictBoxes.Add(txt61, 61);
dictBoxes.Add(txt76, 76);
dictBoxes.Add(txt77, 77);
dictBoxes.Add(txt81, 81);
dictBoxes.Add(txt9, 9);
//All the parameters that will be added to the database
//also all the from the app
cmd.Parameters.Add("@PlayerTypeID", SqlDbType.Int, 20);
cmd.Parameters.Add("@DateYear", SqlDbType.Int, 40);
cmd.Parameters.Add("@DateMonth", SqlDbType.Int, 4);
cmd.Parameters.Add("@FXR", SqlDbType.Float);
//Assigning the Values to the parameters
cmd.Parameters["@PlayerTypeID"].Value = txt0.Text;
cmd.Parameters["@PlayerTypeID"].Value = txt3.Text;
cmd.Parameters["@PlayerTypeID"].Value = txt5.Text;
cmd.Parameters["@DateYear"].Value = cbmYear.SelectedItem;
cmd.Parameters["@DateMonth"].Value = cmbMonth.SelectedItem;
cmd.Parameters["@FXR"].Value = txt0.Text;
cmd.Parameters["@FXR"].Value = txt3.Text;
cmd.Parameters["@FXR"].Value = txt5.Text;
cmd.Parameters["@FXR"].Value = txt6.Text;
cmd.Parameters["@FXR"].Value = txt9.Text;
cmd.Parameters["@FXR"].Value = txt55.Text;
cmd.Parameters["@FXR"].Value = txt61.Text;
cmd.Parameters["@FXR"].Value = txt76.Text;
cmd.Parameters["@FXR"].Value = txt77.Text;
cmd.Parameters["@FXR"].Value = txt81.Text;
|
|
|
|
|
I have a Asp.net C# site(A) in which there is 3 Iframes Header ,body and footer.........
In header there is a droupdown which is filled by database ,which contain links to another sites(B).now when user click and sellect droupdown the site(B) is open in the body Iframe of site(A).
Now when i open this site(B) by typing the address in the browser,then it will work fine and all the ajax control work.But when this site(B) open in the body frame of my site(A) then AJAX control stop working and evertime whole frame get refreshed......WHAT TO DO as i have to open different sites in my one site as per the selection,Ajax is not working.
modified on Wednesday, October 15, 2008 1:44 AM
|
|
|
|
|
Post the question on ASP.NET Fourm
cheers,
Abhijit
|
|
|
|
|
Hi,
I am using datagridview when, I am assigning datasource to Datagridview i am
gettin exception "Child list for field Region cannot be created."
I am Assigning Collection as a datasource to the datagridview.
AnnotationGrid.DataSource = XMLAnnotations;
AnnotationGrid.DataMember = "Region";
and my grid has three coloumns ID, Area, Text and XMLAnnotation consist xml
like that :
<Annotations MicronsPerPixel="0.504000">
- <Annotation Id="1326" Name="" ReadOnly="0" Type="4" LineColor="2293538"
Visible="1" Selected="0" MarkupImagePath="">
<InputAnnotationId>0</InputAnnotationId>
<Attributes />
- <Regions>
- <RegionAttributeHeaders>
<AttributeHeader Id="9999" Name="Region" ColumnWidth="45" />
<AttributeHeader Id="9997" Name="Length" ColumnWidth="70" />
<AttributeHeader Id="9996" Name="Area" ColumnWidth="70" />
<AttributeHeader Id="9998" Name="Text" ColumnWidth="100" />
</RegionAttributeHeaders>
- <Region Id="1326" Type="1" Zoom="0.000000" Selected="0" ImageLocation=""
ImageFocus="0.000000" Length="244.0" Area="3237.0" LengthMicrons="123.0"
AreaMicrons="822.2" Text="" NegativeROA="0">
<Attributes />
- <Vertices>
<Vertex X="23686.000000" Y="20753.000000" />
<Vertex X="23769.000000" Y="20753.000000" />
<Vertex X="23769.000000" Y="20792.000000" />
<Vertex X="23686.000000" Y="20792.000000" />
</Vertices>
</Region>
</Regions>
</Annotation>
- <Annotation Id="1328" Name="" ReadOnly="0" Type="4" LineColor="2293538"
Visible="1" Selected="0" MarkupImagePath="">
<InputAnnotationId>0</InputAnnotationId>
<Attributes />
- <Regions>
- <RegionAttributeHeaders>
<AttributeHeader Id="9999" Name="Region" ColumnWidth="45" />
<AttributeHeader Id="9997" Name="Length" ColumnWidth="70" />
<AttributeHeader Id="9996" Name="Area" ColumnWidth="70" />
<AttributeHeader Id="9998" Name="Text" ColumnWidth="100" />
</RegionAttributeHeaders>
- <Region Id="1328" Type="1" Zoom="0.000000" Selected="0" ImageLocation=""
ImageFocus="0.000000" Length="166.0" Area="1380.0" LengthMicrons="83.7"
AreaMicrons="350.5" Text="" NegativeROA="0">
<Attributes />
- <Vertices>
<Vertex X="23715.000000" Y="20825.000000" />
<Vertex X="23738.000000" Y="20825.000000" />
<Vertex X="23738.000000" Y="20885.000000" />
<Vertex X="23715.000000" Y="20885.000000" />
</Vertices>
</Region>
</Regions>
</Annotation>
</Annotations>
|
|
|
|
|
Hi Friends,
i want to send key-value pair values on HTTP Request using C#. If anybody know how to send key-value pair values then please send me hint.
Regards
Bill
|
|
|
|
|
The HTTP protocol is well documented.
How does this question apply to C#? Are you using a .NET
HTTP class?
If you're using HttpWebRequest you can use its Headers property
to get a WebHeaderCollection. WebHeaderCollection.Set() can be used to
add header key/value pairs (if that's the key/value pairs you're
referring to).
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I have an oracle function.It works fine when it is static.
If i create the same function dynamically though asp .net code the error comes.
I tried this code ALTER FUNCTION Group_concat COMPILE
This code works manually.But in the run time it does not work.
Give me solution if anyone knows.
Thank you
|
|
|
|
|
froxy wrote: If i create the same function dynamically though asp .net code the error comes.
What error? And what code? (Describing the code does not count)
|
|
|
|
|
Few issues:
- why do you want to compile the function from code. You may run into trouble with that
- most likely your connection hasn't got enough privileges
- if you need to create a pl/sql block at runtime, perhaps you could use anonymous blocks
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
hi every body...........i have a problem.i have a web page in which i m uploading an video file by using fileupload control.......before uploading that video file i m checking the size of that video file by the variable FileBytes.then i m checking it with the drive free space .......but this exception named System.OutOfMemoryException occured when i upload the video file of more than 500 MB...the coding i m using is ..........
byte[] FileBytes = FileUpload.FileBytes; // the problem is coming in this line as byte is small datatype for the video file of more than 500 MB
long freespace =drInfo.AvailableFeeSpace;
i want to upload video files of more than 500 MB ...it may be in GB's also
preeti1979
|
|
|
|