|
Hi,
Ok i have my XML file a generate in my application which holds account information.
How can i populate only the "AccountName" field in a treeview?
i tried and am struggling it doesnt populate correct.
Im using VS2005 and this is a windows application.
my xml file looks like this:
<accountdatabase>
<xs:schema id="AccountDatabase" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="AccountDatabase" msdata:isdataset="true" msdata:usecurrentlocale="true">
<xs:complextype>
<xs:choice minoccurs="0" maxoccurs="unbounded">
<xs:element name="AccountTable">
<xs:complextype>
<xs:sequence>
<xs:element name="AccID" msdata:autoincrement="true" msdata:autoincrementseed="1" type="xs:int">
<xs:element name="AccountName" type="xs:string" minoccurs="0">
<xs:element name="UserName" type="xs:string" minoccurs="0">
<xs:element name="Password" type="xs:string" minoccurs="0">
<xs:element name="Note" type="xs:string" minoccurs="0">
<xs:unique name="Constraint1" msdata:primarykey="true">
<xs:selector xpath=".//AccountTable">
<xs:field xpath="AccID">
<accounttable>
<accid>1
<accountname>gmail
<username>me
<password>1234
<note>njun
<accounttable>
<accid>3
<accountname>codeproject
<username>me2
<password>1234555
<note>hhhhhhhh
<accounttable>
<accid>8
<accountname>myacc1
<username>qwe
<password>111
<note>fgfg
I only want the "AccountName" field to show in the treeview so when they click on it the rest of the data shows in labels.
I have done this with a listbox but would like to use a treeview
thanks alot guys hope you can help
Regards
|
|
|
|
|
Hi
You can use xpath to query a specific node within a xml file.
Open a xml file in a XmlDocument object (System.Xml namespace) and then you can get its elements using xpath.XmlDocument has some methods that you can use to query a xml file for example you can use SelectNodes or SelectSingleNode or GetElementsByTagName.
You can use serialization to serialize and deserialize your xml file into an object model.You can use xsd utility to build this object model from your xml file the you can use XmlSerializer (System.Xml.Serialization namespace) to deserialize your xml file into your object model and use this object model to populate a treeview.
Regards
Nima
|
|
|
|
|
Hi, Dear Respected Programmers
Kindly let me know about (Set CSS Class) in CrystalReport.
I need some easy examples / Source Link about said.
Thank you
Have a nice day!
|
|
|
|
|
hi everybody,
i was working with gridview with a column in it where i added a linkbutton to it after making a temolatefield.i need to pass a value with it that is there in gridview. my code is like this :
'<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server" OnClick="LinkButton1_Click" CommandName='<%#
"Default2.aspx?diaryid=" + Eval("diaryid")%>' Text='<%
#Eval("diaryid") %>' Style="position: static"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>'
code behind is :
protected void LinkButton1_Click(object sender, EventArgs e)
{
LinkButton lb = (LinkButton)sender;
Server.Transfer(lb.CommandName);
}
i think ihv passed the value correctly,but i dont know how to fetch it in a label on next page.
thanks in advance.
|
|
|
|
|
MyLabel.Text = Request.QueryString["diaryid"] ;
|
|
|
|
|
hi everybody,
how to add event to a check box. as soon as the checkbox is clicked i want to display a label which was invisible earlier.
thanx n regards,
saurabh.
|
|
|
|
|
click on checbox and then open Properties windows and then click on Events
|
|
|
|
|
hi
i am a friend of saurabh.pls also tell what the next step is?
|
|
|
|
|
in the code window
make the visible property of label true
like label1.visible=true;
Hope this will work.
NEHA GUPTA
|
|
|
|
|
hi
but i want textbox to be enabled at the checking of checkbox.else it should remain non-editable.
i tried what u suggested.but it didnt work.
|
|
|
|
|
It takes two of you to work this out ? Are you in a class ? If not, then you need probably to give up on windows for a while and learn enough basic programming to give you a background which would make you able to follow how these things work.
A checkbox has an event which is fired when the check state is changed. What you do when that happens is up to you, if it's setting the Enabled property, the Visible property, or something else. You asked to make a label visible, the answer you got was correct.
Christian Graus - C++ MVP
|
|
|
|
|
How to change the value in RUN TIME?
I wish expect your Source Code.
thanks
K.Alex
|
|
|
|
|
Sir,
I want to know something about the internal keyword and how it is different from the private keyword and one more questions please that is what is the difference between internal and protected internal.
Thanks
|
|
|
|
|
Internal is visible only to items inside the assembly. Protected internal is only visible to derived classes within the assembly.
Christian Graus - C++ MVP
|
|
|
|
|
Actually, 'protected internal' is visible to all derived classes and everywhere within the assembly. It is "protected OR internal", not "protected AND internal".
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: C# to C++ converter, VB to C++ converter
Instant Python: VB to Python converter
|
|
|
|
|
Hi
can someone tell me how can i define my own file format. i mean a custom file format which no other application can read and which can also not be opened in any readable form. like we can open some files in notepad or wordpad, and so we can read everything in that file. i want that my custom file format can not be read in that way too. can someone guide me please.
regards
sAqIb
"Our scientific power has outrun our spiritual power. We have guided missiles and misguided men."
Dr. Martin Luther King Jr.
|
|
|
|
|
A noetpad file is just plain text.
Your question makes no sense. How can we tell you how to store stuff that you've not defined ? You can make up any file format you like, and if it's more complex than plain text, no other app will open it, simple as that.
Christian Graus - C++ MVP
|
|
|
|
|
but how can i make that file format? by just giving a self defined extension? or there is some way to do that?
sAqIb
"Our scientific power has outrun our spiritual power. We have guided missiles and misguided men."
Dr. Martin Luther King Jr.
|
|
|
|
|
What are you asking ? Do you want your file to open when it's double clicked ? That's a registry entry ( easily found with google ). Do you just want to create the file ? ( Just use the System.IO namespace, and all the info you'd find with google ) Do you want to know the specifics of a file format for your app ? We really can't tell you.
Christian Graus - C++ MVP
|
|
|
|
|
I am a new c# programmer. I am trying to understand ADO.NET. can anybody explain, how can store SQL Connection string in a text file or web.config file and how to call that in c#?
wMan
|
|
|
|
|
|
Hi...
How i can select all items in a CheckedListBox on selction of a first CheckedListBox item...?
Items in CheckedListBox are as follows-
'Selct All'
First Item
Second Item
Third Item
So on click of 1st CheckedListBox item(SelectAll), i want to select all items...How i can do this...?
Thanks in adavnce,
Vinay
|
|
|
|
|
This is bad UI. You can make it work, but select all should be a button, not one of the items in the list.
Christian Graus - C++ MVP
|
|
|
|
|
Christian Graus wrote: This is bad UI.
Not sure I agree with that. If you have a huge field of checkboxes, say to determine which fields to search on, one of the options could be All, which would select all of the checkboxes for you.
I've seen this done out in the wild, and it seems to make sense. Not saying there's not a better way, just saying I don't think it's a bad UI.
[edit]Ahh, it's a list box. Should have read that a little closer. I agree with Christian, use a button.[/edit]
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
I have to make this type of application....
since that is the requirement...so can u tell me ...
How i can do this...?
Regards,
Vinay
|
|
|
|