+ Reply to Thread
Results 1 to 13 of 13
  1. nel
    nel is offline
    Senior Member
    Join Date
    Jun 2006
    Location
    Australia
    Posts
    2,847

    Certifications
    A+ , Network+, MCSA 2003, CCENT, CCNA, CCDA, CCNP, CCDP, JNCIA-JunOS, JNCIS-ENT, Bsc(hons) & Msc Degree
    #1

    Default new to c#, any help?

    hi guys,

    basically ive created a little app which basically stores IT equipment (just for learning purps). the app is just a single form with 3 txt boxes which display the pc make, its item ID and some installation notes.

    ive created an one dimensional arraylist for each bit of information that goes in each of the text boxes(not sure this is the right way or whether a multi dimensional arraylist is better?) basicalli for each bit of kit in the app i want a pictures that piece of kit. does anyone know how i will add the pics to my app?

    i would also like a search feature to search by either the item ID/number and/or by a keyword but im not sure how to do this.

    any help would be good, or if anyone could point me in the right direction? would i be right in thinking there is something in the array class to use so i could search each array by either a string or int? or am i way off haha?

    cheers

    btw im using visual studio 2k3.
    Reply With Quote Quote  

  2. SS -->
  3. Certification Invigilator Forum Admin JDMurray's Avatar
    Join Date
    Jul 2003
    Location
    Surf City USA
    Posts
    10,596
    Blog Entries
    50

    Certifications
    GSEC, EnCE, CISSP, SSCP, CEH (ANSI), CASP, CCNA, CCENT, CWSP, CWNA, CWTS, Security+, Server+, Network+, A+, DHTI+, PDI+, MSIT InfoSec
    #2
    You are making an inventory application? You will want to store the inventory information in a SQL Server 2005 Express database. The data-aware controls in Visual Studio 2005 can then be linked to the database, making input, queries, and reports very easy to code.

    Many sample .NET/SQL Server applications are inventory apps. Have a look at the SQL Server 2005 walkthroughs at the MSDN Web site, like this one.

    SQL Server Express Infocenter
    Microsoft SQL Server Samples & Community Projects
    Moderator of the InfoSec, CWNP, IT Jobs, Virtualization, Java, and Microsoft Developers forums at www.techexams.net
    --
    Blog: www.techexams.net/blogs/jdmurray
    LinkedIn: www.linkedin.com/in/jamesdmurray
    Twitter: www.twitter.com/jdmurray
    Reply With Quote Quote  

  4. nel
    nel is offline
    Senior Member
    Join Date
    Jun 2006
    Location
    Australia
    Posts
    2,847

    Certifications
    A+ , Network+, MCSA 2003, CCENT, CCNA, CCDA, CCNP, CCDP, JNCIA-JunOS, JNCIS-ENT, Bsc(hons) & Msc Degree
    #3
    hi, thanks for the reply JD.

    I have been thinking of doing an sql backend at some point but not yet. i just wanted to have a play with the basics first then move upto things like that.

    anyone any idea on how to search arraylists?
    Reply With Quote Quote  

  5. Certification Invigilator Forum Admin JDMurray's Avatar
    Join Date
    Jul 2003
    Location
    Surf City USA
    Posts
    10,596
    Blog Entries
    50

    Certifications
    GSEC, EnCE, CISSP, SSCP, CEH (ANSI), CASP, CCNA, CCENT, CWSP, CWNA, CWTS, Security+, Server+, Network+, A+, DHTI+, PDI+, MSIT InfoSec
    #4
    Moderator of the InfoSec, CWNP, IT Jobs, Virtualization, Java, and Microsoft Developers forums at www.techexams.net
    --
    Blog: www.techexams.net/blogs/jdmurray
    LinkedIn: www.linkedin.com/in/jamesdmurray
    Twitter: www.twitter.com/jdmurray
    Reply With Quote Quote  

  6. nel
    nel is offline
    Senior Member
    Join Date
    Jun 2006
    Location
    Australia
    Posts
    2,847

    Certifications
    A+ , Network+, MCSA 2003, CCENT, CCNA, CCDA, CCNP, CCDP, JNCIA-JunOS, JNCIS-ENT, Bsc(hons) & Msc Degree
    #5
    do you think it would be easier to save it all to an xml file and read/write it to there? because i cant seem to figure out how to search an arraylist by a keyword?
    Reply With Quote Quote  

  7. Certification Invigilator Forum Admin JDMurray's Avatar
    Join Date
    Jul 2003
    Location
    Surf City USA
    Posts
    10,596
    Blog Entries
    50

    Certifications
    GSEC, EnCE, CISSP, SSCP, CEH (ANSI), CASP, CCNA, CCENT, CWSP, CWNA, CWTS, Security+, Server+, Network+, A+, DHTI+, PDI+, MSIT InfoSec
    #6
    You need to explore the different data structure and storage objects available in .NET. Start with the Dictionary object: http://www.kirupa.com/net/dictionary_hashtable.htm
    Moderator of the InfoSec, CWNP, IT Jobs, Virtualization, Java, and Microsoft Developers forums at www.techexams.net
    --
    Blog: www.techexams.net/blogs/jdmurray
    LinkedIn: www.linkedin.com/in/jamesdmurray
    Twitter: www.twitter.com/jdmurray
    Reply With Quote Quote  

  8. nel
    nel is offline
    Senior Member
    Join Date
    Jun 2006
    Location
    Australia
    Posts
    2,847

    Certifications
    A+ , Network+, MCSA 2003, CCENT, CCNA, CCDA, CCNP, CCDP, JNCIA-JunOS, JNCIS-ENT, Bsc(hons) & Msc Degree
    #7
    hi, thanks for the reply.

    ive setup my program so it can read from the xml file.
    i have a method which reads the xml but im getting an error on 2 of the four elements i require to be displayed in text boxes on the form.

    here is my c# code which points to the data in the xml file:

    Code:
                          // called from constructor function
    			itemId = inventoryNode.Attributes["ItemId"].Value; // this works 
    			item = inventoryNode["Item"].InnerText; // returns error
    			notes = inventoryNode["Notes"].InnerText; //returns error
    			photoPath = inventoryNode["PhotoPath"].InnerText;// this works
    Now here is the structure of my XML file:


    <?xml version="1.0" encoding="utf-8" ?>

    <Inventory>
    <Inventory ItemId="01">
    <Item>Dell</Item>
    <Notes>Notes</Notes>
    <PhotoPath>../../Dell PC.jpg</PhotoPath>
    </Inventory>
    <Inventory ItemId="02">
    <Name>HP</Name>
    <Programme>Notes</Programme>
    <PhotoPath>../../HP PC.jpg</PhotoPath>
    </Inventory>

    Could anyone shed some light on this for me?

    cheers

    [/code]
    Reply With Quote Quote  

  9. Senior Member
    Join Date
    Mar 2007
    Posts
    12,308
    #8
    In your XML file, the second item uses "Name" and "Programme" instead of "Item" and "Notes"
    Reply With Quote Quote  

  10. nel
    nel is offline
    Senior Member
    Join Date
    Jun 2006
    Location
    Australia
    Posts
    2,847

    Certifications
    A+ , Network+, MCSA 2003, CCENT, CCNA, CCDA, CCNP, CCDP, JNCIA-JunOS, JNCIS-ENT, Bsc(hons) & Msc Degree
    #9
    OMG! cant believe i made that school boy error! my head is in bits at the moment.

    Thanks for the spot dynamik!
    Reply With Quote Quote  

  11. nel
    nel is offline
    Senior Member
    Join Date
    Jun 2006
    Location
    Australia
    Posts
    2,847

    Certifications
    A+ , Network+, MCSA 2003, CCENT, CCNA, CCDA, CCNP, CCDP, JNCIA-JunOS, JNCIS-ENT, Bsc(hons) & Msc Degree
    #10
    So for all you guru's out there, is it possible to enter the itemid, item and notes into 3 seperate textboxes and save them to the same xml file as above and save them in the same structure?

    Would you have to create the elements and append the data to it or something?(sorry for not being technical there, im still trying to learn my way!)
    Reply With Quote Quote  

  12. Senior Member
    Join Date
    Mar 2007
    Posts
    12,308
    #11
    This guide will probably help you out: http://www.developer.com/net/csharp/article.php/3489611

    You should really look at doing this with SQL though. I think you're making things much more complicated than they have to be.

    I'd check out this book if you haven't yet: http://www.wrox.com/WileyCDA/WroxTit...47019135X.html
    Reply With Quote Quote  

  13. Certification Invigilator Forum Admin JDMurray's Avatar
    Join Date
    Jul 2003
    Location
    Surf City USA
    Posts
    10,596
    Blog Entries
    50

    Certifications
    GSEC, EnCE, CISSP, SSCP, CEH (ANSI), CASP, CCNA, CCENT, CWSP, CWNA, CWTS, Security+, Server+, Network+, A+, DHTI+, PDI+, MSIT InfoSec
    #12
    Yes, SQL would be the way to go. You can use SQL objects to import/export your recordset data as XML too.
    Moderator of the InfoSec, CWNP, IT Jobs, Virtualization, Java, and Microsoft Developers forums at www.techexams.net
    --
    Blog: www.techexams.net/blogs/jdmurray
    LinkedIn: www.linkedin.com/in/jamesdmurray
    Twitter: www.twitter.com/jdmurray
    Reply With Quote Quote  

  14. nel
    nel is offline
    Senior Member
    Join Date
    Jun 2006
    Location
    Australia
    Posts
    2,847

    Certifications
    A+ , Network+, MCSA 2003, CCENT, CCNA, CCDA, CCNP, CCDP, JNCIA-JunOS, JNCIS-ENT, Bsc(hons) & Msc Degree
    #13
    thanks for the replies.

    Ive thought about sql backend but the course i follow at uni hasnt covered this yet and they want us to try and do it with only the things we have covered - and im finding it pretty frustrating most the time!
    Reply With Quote Quote  

+ Reply to Thread

Social Networking & Bookmarks