|
Well, that doesn't match what you posted originally, is this a new bit of XML?
|
|
|
|
|
no, its the same, I just changed the names
"/Data/page/content[.='1.820%']");
|
|
|
|
|
I found that the problem is not with "%". The values is having extra spaces as " 10.34%"
So the below expression is not working.
"/Data/page/content[.='10.34%']". Please guide me to solve this issue. Thanks in advance
<Data>
<page>
<content> 10.34%</content>
</page>
</Data>
|
|
|
|
|
Issued solved with the below expression
"/Data/page/content[normalize-space(.)='10.34%']".
|
|
|
|
|
Excellent.
|
|
|
|
|
I would like to convert the text data to uppercase and I wrote the expression as below
"/RawData/page/text[upper-case(.)='ABC']"
its throwin exception "XsltContext is needed for this query because of an unknown function"
Reference:
http://www.w3schools.com/xpath/xpath_functions.asp[^]
|
|
|
|
|
I don't know, and it's not not in the book I have. Try the XML / XSL forum. Good luck.
|
|
|
|
|
Hi all,
I wanted to create a table trhough c# code and add bind each row of it from the values from the database
Pls help me...Thanks In advance
Reogeo2008
|
|
|
|
|
What environment? Web, Windows, Mobile?
No comment
|
|
|
|
|
|
Its called DataBinding. Read about it.
No comment
|
|
|
|
|
You want to programatically create and fill a DataTable? I do that all the time.
See the ExecuteSQL method in:
Database Connector[^]
|
|
|
|
|
What do you mean by 'bound'? If you get a DataTable through a DataAdapter (i.e. by executing a SQL query), it will come pre-filled with the correct database values, and you don't need to bind it. If you want live updating or two way binding, then you're starting to look at entity modelling frameworks, like NHibernate or whatever the new Microsoft one is – but that's massive overkill for most applications.
|
|
|
|
|
BobJanova wrote: that's massive overkill for most applications
And severe underkill for many others.
|
|
|
|
|
Hi experts,
there is an application for which I created a setup project in Visual Studio 2008 Standard Edition. The setup is to be burnt onto CD.
After being inserted in a CD drive, setup shall start automatically. I created an "Autorun.inf" that should be in the CD root directory along with the setup.exe.
I can copy it there before burning the CD, but I would prefer it to be copied automatically during setup project build.
How can I make a file to be copied to setup project's bin\release directory (Not the application directory but the one with setup.exe, setup.msi, DotNetFX and WindowsInstaller3_1)?
Ciao,
luker
modified 13-Oct-11 5:02am.
|
|
|
|
|
I don't know what this has to do with C#, but you could copy your file manually or just set its build properties to custom and use a copy statement which is executed during the project build process.
|
|
|
|
|
My fault. I'm used to code in C# but in this case the Visual Studio forum seems more appropriate. Let's continue there[^].
Ciao,
luker
|
|
|
|
|
Hi All,
I want to zip a folder in C# without any third party dll. Can any body help me out.
Thanks,
Sunil G.
|
|
|
|
|
not sure what version of .Net but take a look at the following:
ZipPackage Class
hope it helps.
|
|
|
|
|
C# Zip Files and/or Folders[^] could help you out.
Too much of heaven can bring you underground
Heaven can always turn around
Too much of heaven, our life is all hell bound
Heaven, the kill that makes no sound
|
|
|
|
|
If you actually want to make a ZIP compatible file, I strongly recommend SharpZipLib. It's a third party DLL but so what? ... you are almost certainly already deploying more than one file, unless there is a really good reason not to use a library you should do so. It's free and doesn't have license restrictions that stop you using it.
|
|
|
|
|
The deflator in .NET is bad[^]. I can't think of any reason to use it, but maybe you have one. If you do, we can help you better if you share that reason.
|
|
|
|
|
Anyways I noticed how wrong my last code was so far.
// DECLARATIONS
// Declaring all my variables
const decimal SLICE_OF_PIZZA_AREA = 14.125M; //
const int diameter_12_16 = 8;
double diameterPizza;
double slicesPizza;
double area;
//INPUT
// Prompt for and get input from user
Console.Write("Please enter the diameter of your pizza:";
diameterPizza = Convert.ToInt32(Console.ReadLine()); // reads the line of text from the keyboard
// PROCESSING
if (diameterPizza >= diameter_12_and_16)
// END
// This allows the user to read what has been outputted then simply press any key to end.
Console.WriteLine("\n\nPress any key to end this application...");
Console.ReadKey();
That is the code I have so far the problem I am having with is these instructions and I feel really dumb, I am not able to understand what to do.
• Prompt the user to enter the diameter of a pizza in inches, that value will be implemented in the determination of the number of slices to cut that pizza into.
• Use a compound condition test to check that the diameter entered is within the range of 12” to 36” inclusive.
• When the diameter entered is good, determine the number of slices to cut the pizza in using an “if … else if” decision structure based on the following:
Diameters of 12” to < 16” cut in eight slices.
Diameters of 16” to < 24” cut in 12 slices.
Diameters of 24” to < 30” cut in 16 slices.
Diameters of 30” to 36” cut in 24 slices.
Calculate the area of the pizza in question, and then calculate the area of each slice.
Display the number of slices that should be cut from a pizza that size along with the area of each slice, formatted as shown in the sample output above.
• When the diameter entered is outside of the allowable range, display an appropriate error message.
• In either case, good or bad diameter entry, end the program when the user presses any key.
Sorry for the wall of text, anyways my next question is how do all this I have no idea. any hints would be great!!
|
|
|
|
|
It's basic maths, and can be done in a procedural manner, or better still by creating a class that contains the main functionality.
Consider this Pizza class that contains all the pizza related stuff, a Pizza instance can now be created and you just need to handle the UI stuff and the class will contain all the other info you need:
using System;
public class Pizza
{
public const int MaxDiameter = 36;
public const int MinDiameter = 12;
private int diameter;
public Pizza(int diameter)
{
if (diameter < MinDiameter || diameter > MaxDiameter)
throw new ArgumentOutOfRangeException(
"diameter",
string.Format(
"diameter must be between {0} and {1}",
MinDiameter, MaxDiameter));
this.diameter = diameter;
}
public double Area
{
get { return Math.PI * (Math.Pow((diameter / 2d), 2)); }
}
public int Diameter
{
get { return diameter; }
}
public double SliceArea
{
get { return Area / Slices; }
}
public int Slices
{
get
{
int slices;
if (diameter < 16)
slices = 8;
else if (diameter < 24)
slices = 12;
else if (diameter < 30)
slices = 16;
else
slices = 24;
return slices;
}
}
}
|
|
|
|
|
I don't mean to be rude but I don't believe that's how it is suppose to be done I believe I am suppose to make multiple constants then have multiple if and else if, I'm not sure how to do this though if you could show me that way, would be much appreciated.
|
|
|
|