|
hi all
i have an xml file as:
<?xml version="1.0" encoding="utf-8" ?>
<Pages>
<Page>
<Name>ManageUser.aspx</Name>
<User>
<ID>Admin</ID>
<ID>WebMaster</ID>
</User>
</Page>
<Page>
<Name>Traders.aspx</Name>
<User>
<ID>Admin</ID>
</User>
</Page>
</Pages>
my query as:
var result = xmlDoc.Descendants("Page").Select(s => new { Name = s.Element("Name").Value, User = s.Element("User").Value }).Distinct().ToList();
and finally result as:
result |Count =2
+[0] {Name="ManageUser.aspx",User="AdminWebMaster"}
+[1] {Name="Traders.aspx",User="Admin"}
My problem is that how i can sub divide "User" into "ID"
like
result |Count =3
+[0] {Name="ManageUser.aspx",User(ID)="Admin"}
+[1] {Name="ManageUser.aspx",User(ID)="WebMaster"}
+[2] {Name="Traders.aspx",User(ID)="Admin"}
actually i want IDs against Pages
thanks
|
|
|
|
|
Try this:
var result = (from page in xmlDoc.Descendants("Page")
from id in page.Descendants("ID")
select new
{
Name = page.Element("Name").Value,
ID = id.Value
}).Distinct().ToList();
|
|
|
|
|
I have a problem, I have created app in Visual Studio 2008 in XP windows, with framework 3.5 but when I launch it on Windows Vista it dosent start. I get the Application Recovery screen. On XP is no problem, everything works.
|
|
|
|
|
Does your Vista machine contains .Net FW 3.5?
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Yes, that is why I am so confused. Dont know what to do.
|
|
|
|
|
Do you get any useful message?
Does it work if you right click and select 'Run as administrator'?
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Oo need to check that thx
|
|
|
|
|
If it does work then you may need to create a manifest[^] file for your application. Do a search for 'C# vista manifest' for more information.
It's not always needed for every application, I think it is dependent on what the application actually does as to if you need one or not. Not 100% thou
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
HELLO.......
I want to split a byte[].....
Suggest me with code sample...
Thanx
|
|
|
|
|
gauravems wrote: I want to split a byte[].....
It's an array of bytes - I'm not sure how you could split it any further.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
i have a byte[]of image and i want to break them in multiple parts so that i can store them in to blocks of smart card which have usually less memory(1k).
suggest me some c# code
|
|
|
|
|
gauravems wrote: i have a byte[]of image and i want to break them in multiple parts so that i can store them in to blocks of smart card which have usually less memory(1k).
Array.Copy(sourceArray, sourceStartIndex, destinationArray, destinationIndex, length)
|
|
|
|
|
Dear All,
How to open ms excel file in C#. And How to read and Write the data in the Xl Sheet.
Please kindly needful.Thanks in advance
With Regards
Mahesh
|
|
|
|
|
Common sense.[^]
If at first you don't succeed, you're not Chuck Norris.
|
|
|
|
|
Hi All,
I am re-posting this question with some more detail.
In my windows application I am using 'Zedgraph' dll for displaying graph. In my code I am not using multithreading anywhere. On some of the systems (Windows XP) it shows unhandled exception 'System.InvalidOperationException' (object is currently in use elsewhere). And the instead of graph it just shows RED CROSS.
At client side network, if the user is an Administrator then the application runs fine. But if the user is not an Administrator then after few seconds above error is being observed. That means non-admin user can view the graph only for few seconds during starting of the application.
Any idea...
I have googled about this issue but I found that it may be due to Multithreading and I am not using it anywhere.
Any suggestion would be helpful...
Regards,
-SIFAR.
|
|
|
|
|
Check the event viewer for any permission errors as you mentioned the administrators doesnt have any issues in viewing the graph...
Hariharan.T
|
|
|
|
|
Thanks Hariharan,
But a non-admin user can view the graph for few seconds when the application starts. After that the 'Red Cross' appears...
Regards,
-SIFAR.
|
|
|
|
|
we often create a winform manually(project-->add-->winform),the created winform is template, then we create an instance of this winform with "new" word. Now I want to know how to create a new winform with code and have not template winform of this new winform(that is no need create a template winform by manually first).
|
|
|
|
|
Form form = new Form();
form.Show();
...
|
|
|
|
|
Hi,
there is no magic involved: all that Visual Designer does is put some code in a file called myForm.Desisgner.cs; you can open that file and have a look; then create similar code in your own file (don't edit the designer.cs files, your changes may get lost, and might confuse Visual Designer).
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
i waz working on a c# project on windows 7......... when i run or debug the code ...... and if there is a compile time error, it will display the errors...........but after i correct this errors.......there will be a permanent error which says..........."Cant find C:\......\\ProjectName.pdb access denied".....pdb=program debug database.......but this error disappears only if i restart my laptop........ so please help me ppls....which save my time rather than restarting my pc if some error happens....tnx
|
|
|
|
|
Check if the pdb is readonly or do a rebuild it might help
Hariharan.T
|
|
|
|
|
i already cheked it ..... it is not read only...but i will try to rebuild it again....tnx.....by z way wat is z difference betwen....release ...and debug....i realy dont know what release do.....
|
|
|
|
|
This generally happens when you make changes to your code when the application is running in debug mode. Since the code has been modified, VS block access to the pdb file and you get a access denied to the .pdb file.
You have the following solutions to this problem
1. As Hariharan had said, do a Rebuild of the solution. This in most cases clears the lock on the pdb file.
2. Locate the pdb file using the windows explorer and delete it and then try build/rebuild from the VS. If you get file is being used error, check if there are any process that are using this file still running using the task manager / process explorer and kill it and re-try.
3. Do a build/rebuild of the solution in "Release" mode and then do a build in "Debug" mode. Not sure if this would work for C# Win Forms, I've done this only on my Web apps.
|
|
|
|
|
I had this same problem with Windows 7 beta, the problem was intermittent and I'm not sure what was causing it. Do you run Visual Studio as administrator?
The problem seems to have been solved since Windows 7 release candidate.
|
|
|
|