|
THIS PROBLEM IS FIXED.
I would like to thank everybody that offered solutions and tried to help,
Aman
|
|
|
|
|
Thank you all for helping me solve this simple problem, i did not realise that my settings had been changed,
Aman
|
|
|
|
|
hello everyone out there!
I have one problem and I hope someone can help me. There is one project what I am working on and is mostly data scraping and saving data in xml document. I have an option to create lists and then add data to the lists. For example, the user can create list for restaurants, and I am creating xml document just with one xml element: <restaurants>.
Then once I have all the data scraped I want to add xml nodes with the data what I have to the existing document. I am trying something like this:
string path = Properties.Settings.Default.XMLFolder + list + ".xml";
XmlTextReader rdr = new XmlTextReader(path);
XmlDocument doc = new XmlDocument();
doc.Load(rdr);
XmlNode nodeBusiness = doc.CreateNode(XmlNodeType.Element, "Business", string.Empty);
nodeBusiness.Attributes.Append(attribute);
docData.AppendChild(nodeBusiness);
I am getting an error at the last step: "This document already has a 'DocumentElement' node."
Can someone help me to solve this issue, thanks in advance. Laziale
|
|
|
|
|
change it from :
docData.AppendChild(nodeBusiness);
to:
docData.DocumentElement.AppendChild(nodeBusiness);
|
|
|
|
|
Thanks a lot, that solved my problem. Have a nice day, Laziale
|
|
|
|
|
Hi,
I am developing one windows application in that i am trying to integrate microsoft word programatically. I used web browser control to enter text,saving it as a word document but the saved document is not showing page numbers,line numbers etc like normal word document. I want to display page numbers and line numbers to my word using web browser control.Can you please tell me is it the correct way to implement word in c# and can you please guide me how to assign page numbers and line numbers for web browser control.
Thanks in advance
Pavani
|
|
|
|
|
I want to create text file to my friends computer c drive in the lan.. Any code please
|
|
|
|
|
string s = "Hello World";
File.WriteAllText(@"c:\hello.txt", s);
|
|
|
|
|
Thanks but how can I include the IP Address?
|
|
|
|
|
"\\friendscomputer\c\hello.txt "
change "friendscomputer" with IP address
|
|
|
|
|
you need to change the c:\ to point to computer name \\friendscomputer\c\hello.txt
Weight loss Target
Weight at start [1/Feb/2009] 127kg
Weight now [31/Jul/2009] 107.7kg
Target weight : 80kg
Only 28 TO go hope to be there by March Wish me luck!
|
|
|
|
|
The error I get is that the network path cannot be found . We are using wireless we want to chat through codes. Even if I replace the path with my own IP. any idea
|
|
|
|
|
Easiest way would be to map a network drive and create the file with File.Create method using the specified network path
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
THE QUESTION IS HOW? how can I map it .. I need a simple code/process for that please
|
|
|
|
|
there is a command in xp, use it like this :
net use k: \\friendscomputer\c\public
run it using Process.Start
|
|
|
|
|
Teach me like a kid. e/g/ go to command prompt. Please how
|
|
|
|
|
ProcessStartInfo psi = new ProcessStartInfo();
psi.FileName = "net.exe";
psi.Arguments = "use k: //friendsname/sharename";
Process.Start(psi);
|
|
|
|
|
The way stancrm has suggested should work, but you need to have that path set to share on the target computer. I don't think (or atleast would hope) you can do that with any code from your computer for security reasons
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Disclaimer: This separate yet related to a question I posted in the LINQ forum, but since its regarding a different issue (ListBox) it can't be considered cross posting.
I'm sure this is a simple issue, but I'm completely stumped.
Essentially, what I'm trying to do is have people move items between ListBoxes which are bound to Lists. One ListBox contains the items selected by the from the full list and the other contains the rest of the items from the full list, where originally, the second list box contained the full list (on the assumption that the user has not made any selections)
here's the code:
List<RCH.EL.EMR.Allergies> AllAllergies
{ get; set; }
List<RCH.EL.EMR.Allergies> RemainingAllergies
{ get; set; }
List<RCH.EL.EMR.Allergies> PatientAllergies
{ get; set; }
private void ResolveAllergies()
{
RemainingAllergies = AllAllergies.Except(PatientAllergies).ToList();
}
protected override void BindListBoxes()
{
lstAllergies.DataSource = RemainingAllergies;
lstAllergies.DisplayMember = "AllergyAr";
lstAllergies.ValueMember = "ID";
lstPatientAllergies.DataSource = PatientAllergies;
lstPatientAllergies.DisplayMember = "AllergyAr";
lstPatientAllergies.ValueMember = "ID";
}
private void btnAddLeft_Click(object sender, EventArgs e)
{
PatientAllergies.Add((RCH.EL.EMR.Allergies)lstAllergies.SelectedItem);
ResolveAllergies();
lstAllergies.Refresh();
lstPatientAllergies.Refresh();
BindListBoxes();
}
private void btnAddRight_Click(object sender, EventArgs e)
{
PatientAllergies.Remove((RCH.EL.EMR.Allergies)lstAllergies.SelectedItem);
ResolveAllergies();
lstAllergies.Refresh();
lstPatientAllergies.Refresh();
BindListBoxes();
}
As you can see, the Lists (not ListBoxes) are of the exact same type, so why the heck isn't the ListBox named lstPatientAllergies not binding properly? By that I mean that I can see that the lstPatientAllergies.DataSource has the proper number of elements and indeed the proper elements, but the lstPatientAllergies.Items is empty and always equals 0.
Ideas?
If the post was helpful, please vote, eh!
Current activities:
Book: Devils by Fyodor Dostoyevsky
Project: Hospital Automation, final stage
Learning: Image analysis, LINQ
Now and forever, defiant to the end.
What is Multiple Sclerosis[ ^]?
|
|
|
|
|
Try this:
Add two BindingSource Components to your Form (remainderBindingSource and patientBindingSource, for my mods below)
protected void BindListBoxes()
{
this.remainderBindingSource.DataSource = RemainingAllergies;
lstAllergies.DataSource = this.remainderBindingSource;
lstAllergies.DisplayMember = "AllergyAr";
lstAllergies.ValueMember = "ID";
this.patientBindingSource.DataSource = PatientAllergies;
lstPatientAllergies.DataSource = this.patientBindingSource;
lstPatientAllergies.DisplayMember = "AllergyAr";
lstPatientAllergies.ValueMember = "ID";
}
private void btnAddLeft_Click(object sender, EventArgs e)
{
patientBindingSource.Add((RCH.EL.EMR.Allergies)lstAllergies.SelectedItem);
remainderBindingSource.Remove((RCH.EL.EMR.Allergies)lstAllergies.SelectedItem);
}
I'm sure that a man of your calibre can work the rest out.
Hope this helps!
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Will do, but why the heck did this happen in the first place? I'm flabbergasted and befuddled.
If the post was helpful, please vote, eh!
Current activities:
Book: Devils by Fyodor Dostoyevsky
Project: Hospital Automation, final stage
Learning: Image analysis, LINQ
Now and forever, defiant to the end.
What is Multiple Sclerosis[ ^]?
|
|
|
|
|
Conceivably you could also do this by deriving your own collection class:
<pre>
public class AllergyCollection : List<RCH.EL.EMR.Allergies>
{
}
</pre>
or better yet:
<pre>
public class AllergyCollection : BindingList<RCH.EL.EMR.Allergies>
{
}
</pre>
and then implementing the <code>IRaiseItemChangedEvents</code> interface, but it's one heck of a lot of work, and <code>BindingSource</code> does it all already.
<blockquote class="FQ"><div class="FQA">Mustafa Ismail Mustafa wrote:</div>but why the heck did this happen in the first place</blockquote>
The problem is that the <code>DataSource</code> property of the <code>ListBox</code> is <b>probably</b> implemented like this:
<pre>
public object DataSource
{
get
{
return this.datasource;
}
set
{
if (this.datasource != value)
{
this.datasource = value;
// now do loads of stuff that only happens if the datasource is a different object
}
}
}
</pre>
in your case, setting the <code>DataSource</code> to the same object (albeit modified) means the test fails and nothing is changed.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Henry Minute wrote: and then implementing the IRaiseItemChangedEvents interface, but it's one heck of a lot of work, and BindingSource does it all already.
That's why I opted for the ready solution of the list box, before I encountered that snag.
Henry Minute wrote: The problem is that the DataSource property of the ListBox is probably implemented like this:
I don't think so, the reason being I actually tried setting the DataSource to null and then resetting it the List<t> I had, and it still wouldn't work.
If the post was helpful, please vote, eh!
Current activities:
Book: Devils by Fyodor Dostoyevsky
Project: Hospital Automation, final stage
Learning: Image analysis, LINQ
Now and forever, defiant to the end.
What is Multiple Sclerosis[ ^]?
|
|
|
|
|
Mustafa Ismail Mustafa wrote: I don't think so, the reason being I actually tried setting the DataSource to null and then resetting it the List I had, and it still wouldn't work.
Interesting!!
I'm wrong again. In that case I have no clue. Computers, hey.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Henry Minute wrote: I'm wrong again.
Don't sweat it, I'm wrong more often than not
Henry Minute wrote: Computers, hey. Laugh
Yep.
Sometimes, I wonder why I didn't listen to my mom and turned out a surgeon or carried on to study Organic Chemistry as a major!
If the post was helpful, please vote, eh!
Current activities:
Book: Devils by Fyodor Dostoyevsky
Project: Hospital Automation, final stage
Learning: Image analysis, LINQ
Now and forever, defiant to the end.
What is Multiple Sclerosis[ ^]?
|
|
|
|