|
Start checking out some books and see which ones you can understand.
|
|
|
|
|
hi
I want to get inner text from the xml node. and i am using
document.getElementsByTagName("AB");
Is there a better way to catch following:
document.getElementsByTagName("AB");
document.getElementsByTagName("ab");
document.getElementsByTagName("Ab");
in a single statement
Thanks in advance
|
|
|
|
|
document.getElementByTagName("ab".toLowerCase());
document.getElementByTagName("Ab".toLowerCase());
document.getElementByTagName("AB".toLowerCase());
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Thanks for the reply
but what to do if xml node is <Ab>some text</Ab>
in this case
document.getElementByTagName("ab".toLowerCase());
document.getElementByTagName("Ab".toLowerCase());
document.getElementByTagName("AB".toLowerCase());
will not work
|
|
|
|
|
Something is wrong here - XML tags are by definition case-sensitive, so a Rose tag in XML is different from a ROSE tag.
If for some odd reason you want to remove the case-sensitivity and you can't find any framework methods to do this, you can use XSL to transform all ROSEs to Roses before you manipulate it.
Cheers,
Vikram. Current activities:
Films: The classic Pink Panther series
TV series: Friends, season 3
Books: Liar's Poker, by Michael Lewis. Carpe Diem.
|
|
|
|
|
Can u give a example or link to implement this?
Thanks
|
|
|
|
|
There are tons of articles that show you how to use XSLT. Google is your friend.
Cheers,
Vikram. Current activities:
Films: The classic Pink Panther series
TV series: Friends, season 3
Books: Liar's Poker, by Michael Lewis. Carpe Diem.
|
|
|
|
|
hi,
I'm using this code to create a new directory into the solution during runtime
string targetPath = @"SampleDirectory"; \\directory name without any path to be copied in the solution
Directory.CreateDirectory(targetPath);
this code is working very well & creates the directory into the solution, but the problem arouses whenever I'm using an open file dialogue before this code, in this case the directory is created into the path specified by the open file dialogue not the solution path.
what can I do?
|
|
|
|
|
Hi,
You can maintain your solution path in a configuration file, namely App.Config.. Have a class that reads the xml file and get the path assigned to a property.. U can then use this property in your code wherever you wish to use the solution's path...
Hope this helps...
|
|
|
|
|
Environment.CurrentDirectory[^] perhaps?
Cheers,
Vikram. Current activities:
Films: The classic Pink Panther series
TV series: Friends, season 3
Books: Liar's Poker, by Michael Lewis. Carpe Diem.
|
|
|
|
|
Your code is assuming that the Current Directory is your "solution" path. This is not that case and you should NOT be relying on it. ALWAYS build a fully qualified path to the target folder/file you want when doing file I/O operations.
In your case, I'm assuming you want the new folder to be created in the same folder as your .EXE file. To get the full path to that folder, you can use Application.StartupPath . Then you can use Path.Combine(...) with that path and your new folder name to create the fully qualified path to this new folder and pass that to CreateDirectory.
|
|
|
|
|
thanks a lot, I used the Application.StartupPath and Path.Combine() and it's working very well.
|
|
|
|
|
Hi,
I was just trying to do some coding on highlighting a portion of text in Powerpoint so that I could insert a hyperlink to it. I could achieve it without any difficulty in Powerpoint 2003 and to my surprise, it did not work in Powerpoint 2007... The code that i used is as follows :
((PowerPoint.Application)applicationObject).ActiveWindow.Selection.TextRange.Text = "PPT";
((PowerPoint.Application)applicationObject).ActiveWindow.Selection.TextRange.Select();
((PowerPoint.Application)applicationObject).ActiveWindow.Selection.TextRange.ActionSettings[Microsoft.Office.Interop.PowerPoint.PpMouseActivation.ppMouseClick].Hyperlink.Address = "http://www.google.com";
((PowerPoint.Application)applicationObject).ActiveWindow.Selection.Unselect();
Can anyone tell me what could have gone wrong in the above code?
modified on Monday, May 11, 2009 7:10 AM
|
|
|
|
|
Hi to all,
I'm using clipboard to insert images in excel sheet, but I can't change the default alignment for these images,
the default alignment for these images is : top left of the cell
I want to change it to : middle center in the cell
I use microsoft office 11.0 object library.
I use this code to insert my images;
(the code is written within a for loop)
Microsoft.Office.Interop.Excel.ApplicationClass Exl = new Microsoft.Office.Interop.Excel.ApplicationClass();
Clipboard.SetDataObject(dataGridView1.Rows[i].Cells["BarCode"].Value);
range.Select();
object dest = Exl.Cells[i + 1, 4];
and then I past it in the sheet cells,
object kui = Exl.Cells[i+1,4];
Microsoft.Office.Interop.Excel.Range mr = Exl.get_Range(kui, kui);
mr.Cells.Worksheet.Paste(mr, mr);
what I exactly need is just to put my pictures in the middle center of the cells
Thank u all
mohammed was a great prophet
|
|
|
|
|
Hi,
I've got an issue with NHibernate and it's causing me all sorts of headaches. I have a routine which takes an object and manipulates it into an appropriate state, then supposedly writes it to a database. What I'm seeing is that when I run SQL Profiler against the database, all the inserts and updates I'm expecting are present, but when I go to look at the database itself, the data has not been updated. Anyone ever experienced this? If I go back to Profiler and copy and paste the SQL into Enterprise Manager, then run it, everything happens as expected, the records are created/updated and everything looks fine. Profiler does not give any indication that anything went wrong with the transaction and I'm struggling to see what's going wrong. How can Profiler claim that the data has been written when it manifestly hasn't?
If anyone's got any ideas I'd be really grateful.
|
|
|
|
|
Ignore me. In fact, don't ignore me, let me serve as an instructional example. Don't forget that NHibernate is going to do some funky stuff with transactions, and if any of your database operations fail, chances are they're all going to fail. Furthermore, you probably won't get to know about it through conventional means either.
|
|
|
|
|
First class reply Is there an article about NHibernate gotchas lurking in your experiences?
Regards
David R
---------------------------------------------------------------
"Every program eventually becomes rococo, and then rubble." - Alan Perlis
|
|
|
|
|
If I get to the end of this project with some hair remaining and my sanity intact then possibly
I'm still having issues with this actually. Everything I see in SQL Profiler now runs fine if I copy it and run it manually, so I don't know where the rollback is coming from. I'm currently wondering if we can just give the users a fancy looking frontend and ask them to write all the important data down somewhere...
|
|
|
|
|
Hi friends,
In C#.NET, in order to verify whether a file exists and take the required action, we use this piece of code:
if (File.Exists(@"D:/whatsup.txt"))
{
}
Similarly, what will be the code to confirm the existence of a particular drive, say E://, in the system?
Your help will be greatly appreciated,
Rajdeep.NET
|
|
|
|
|
Hi,
Read up on System.IO.DriveInfo
Alan.
|
|
|
|
|
Use:
Directory.Exists(@"p:\"); <- true/false
|
|
|
|
|
Hi,
I'm new to Drawing in c#, i want to draw a simple "line chart" (plot).
I have some values (1,3,4,2) and the time when values were taken (10:00, 12:00, 15:00, 21:00).
I want to represent that 2 lists into a chart but don't know how.
|
|
|
|
|
|
I forgot to say that I'm using Visual Studio 2005 with Microsoft .NET Framework 2.0
In a WindowsForm Application i've used ReportViewer and works fine.
Now I want to do a chart for a Windows Mobile Application, but there i can't use ReportViewer.
Any ideea for drawing chart on a Windows Mobile 6.0 Application?
|
|
|
|
|
Ahh...Sorry, I don't really know much about windows mobile. The MSDN page (below) about the graphics class does say that it's supported on the compact framework, so you could go with that. But it's not exactly simple, you will have to draw every line manually. It might be worth looking around for a chart control that is specifically for the compact framework. (Googling around I can see a few, you'll have to evaluate them and see if any meet your requirements)
http://msdn.microsoft.com/en-us/library/system.drawing.graphics.aspx[^]
Simon
|
|
|
|