|
I think it might be possible, check out XPathExpression.AddSort method. I've never used it, so I can be wrong.
- Kannan
|
|
|
|
|
Thanks Kannan, I'll check it.
Mazy
No sig. available now.
|
|
|
|
|
http://www.topxml.com/xsl/articles/xsl_ado/
look for Sorting
Will
|
|
|
|
|
Have a look at this:
public XPathNodeIterator SelectSorted(XmlNode node, XmlNamespaceManager namespacemanager)
{
XPathNavigator nav = node.CreateNavigator();
XPathExpression xpathExpr = nav.Compile("xpath_expression");
xpathExpr.SetContext(namespacemanager);
xpathExpr.AddSort("sort_expression", XmlSortOrder.Ascending, XmlCaseOrder.None, String.Empty, XmlDataType.Text);
return nav.Select(xpathExpr);
}
|
|
|
|
|
Thanks for your reply. How does xpath_expression or sort one look like? Like SQL?
Mazy
No sig. available now.
|
|
|
|
|
The sort expression is: (from MSDN in VS.NET)
An expression representing the sort key. This can be a string or
an XPathExpression object. The result of this expression is converted
to a string, according to the XPath specification, for comparison. In
an XSLT stylesheet, if xsl:sort is used, but no select expression is
specified, then string(.) is used by default. I just use a string with the elementname or atributename I will have it sorted by.
For the XPath expression bit, you should have a look at this quick introduction to XPath[^] from www.w3schools.com[^]
|
|
|
|
|
Hi!
I need to convert the web browser's notation of path with extra unicode characters (ie. "%20") to regular readable string. There are some converters in System.Text, but I've no idea how to use them.
Any ideas?
h.
|
|
|
|
|
System.Web.HttpUtility.UrlDecode("Encoded%20String");
that should do the trick.
Another Post by NnamdiOnyeyiri l Website
|
|
|
|
|
Whenever I declare an array I have to say how big it is... i.e. [7]...
Now, what if I don't know how big it needs to be...? How would I do that?
/\ |_ E X E GG
|
|
|
|
|
Some examples:
int[] i;
i=new int[]{0,1,2,3,4,5};
i=GetArray();
A good tutorial on arrays in C#[^]
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
Thanks for the link.
/\ |_ E X E GG
|
|
|
|
|
here is an example.
using System.Collections;
...
array = new ArrayList();
int[] myArray = array.ToArray(typeof(int));
this example will turn the ArrayList object into an array of int objects, you can change the type of array returned by changing the parameter of the ToArray method.
Another Post by NnamdiOnyeyiri l Website
|
|
|
|
|
|
There are two different ways of interpreting what you write:
1) You know the size of the array at runtime, but not at compile time.
public int [] CreateArray(int size)
{
int [] array = new int[size];
return array;
} The second method is when you don't know ahead of time how many elements you'll need. This typically happens when you are dealing with data being input by the user.
public int[] CreateArray()
{
string input = "";
ArrayList alist = new ArrayList();
Console.WriteLine("Enter a number then press enter, to quit just press enter");
while("" != (input = Console.ReadLine()) )
{
int i;
try
{
i = int.Parse(input);
}
catch
{
Console.WriteLine("\"{0}\" is not a valid input number, try again",
input);
continue;
}
alist.Add(i);
}
return (int[]) alist.ToArray(typeof(int));
} All code has not been compiled so errors my exist
James
"My words but a whisper -- your deafness a SHOUT.
I may make you feel but I can't make you think." - Thick as a Brick, Jethro Tull 1972
|
|
|
|
|
The second one is what I wanted, thanks.
/\ |_ E X E GG
|
|
|
|
|
I must say once again, Thanks. This nice example you set up for my question really helped me out today.
Good Man.
/\ |_ E X E GG
|
|
|
|
|
I need to embedd a treeview inside each row of a listview. and be able to have row sizes only per row to accomadate the listview.
Does anyone know of any articles on this?
thanks,
nick
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
There's two articles here on CP on exactly this subject, look them up under C# Controls.
|
|
|
|
|
I got below error message when I try to run my application on a Win2000 system with .netframework 1.1 installed.
Application has generated an exception that could not be handled.
No debugger found.
Registered JIT debugger is not available.
An attempt to launch a JIT debugger with the following command resulted in an error code of 0x2(2) . Please check computer settings.
cordbg.exe ! a 0x724.
Pls help me. Thanks a lot for your replying.
Thanks.
coby
|
|
|
|
|
The VS errlook.exe util says this about error 0x724:
Incompatible version of the serializing package.
This seems to hint at problems with either the Object or XMl serializers - check if there's been any changes with the type you are using between framework versions.
Also, try wrapping the code in you Main class in a try{} catch{} group so you can get more meaningful error messages. For example:
[STAThread]
static void Main(string[] args)
{
try
{
Form1 main = new Form1();
main.Show();
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString(), ex.Message);
}
}
|
|
|
|
|
Thank you very much for the response. I did add the code in the project. And then I got below message.
System.Security.SecurityException: Request for the permission of type
System.Data.SqlClient.SqlClientPermission,System.Data, Version= 1.0.5000.0, Culture= neutral,
PublickeyToken=b77a5c561934e089 failed.
at System.Security.CodeAccessSecurityEngine.CheckHelper(PermissionSet grantedSet,PermissionSet deniedSet, CodeAccessPermission demand,PermissinToken permToken,
.....
It seems that I can't get the permission to access Sql server. Could you pls tell me how to resolve this issue?
Thanks.
coby
|
|
|
|
|
When you add a visible control to a form in VS.NET, such as a textbox, the Properties box shows several properties with sub-properties. For example, the Font, Location, and Size properties have a [+] next to them which you can click to reveal sub-properties.
I'm now creating a custom control myself for which I want add a property with sub-properties. How is that done? Is there an example I can look at somewhere?
I really appreciate your help,
Alvaro
If you want to get to the top, prepare to kiss a lot of bottom. -- despair.com
|
|
|
|
|
Bending the PropertyGrid to Your Will[^] by Tony Allowatt. It's an excellent article, well worth reading.
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
I spent some time reading the article but unfortunately it didn't have what I needed with respect to custom controls. However, thanks to one of the "Other Article" links at the bottom of that article, I ran into the solution from one[^] of the comments made on it.
Thanks for pointing me in the right direction.
Regards,
Alvaro
If you want to get to the top, prepare to kiss a lot of bottom. -- despair.com
|
|
|
|
|
Alvaro Mendez wrote:
I'm now creating a custom control myself for which I want add a property with sub-properties. How is that done? Is there an example I can look at somewhere?
I really appreciate your help,
This is done with attributes, here is an example where using the same Category attribute's name will cause the Color property and the String property to be grouped under Options (note each property has it's own Description ). Hope this helps.
internal class Properties
{
[Category("Options"),
Description("The color of the header on main form at top.")]
public Color Color
{
get{return _color;}
set{_color = value;}
}
[Category("Options"),
Description("Some string used in the app.")]]
public String String
{
get{return _s;}
set{_s = value;}
}
private Color _color;
private String _s;
}
-Nick Parker
|
|
|
|