Visual Basic Help

Please support our VB.NET advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
Reply

Join Date: Feb 2007
Posts: 6
Reputation: ajaytee is an unknown quantity at this point 
Solved Threads: 0
ajaytee ajaytee is offline Offline
Newbie Poster

Visual Basic Help

 
0
  #1
Aug 14th, 2007
Hello, i need to make a major project in Visual Basic.Net. My project idea was to make a program that tells me the value of a persons assets (and hence how rich you are ), provided you enter in data for such things as cars, house, credit cards etc.

The question is how could i implement such an idea into a program and if it is too simplistic/too complicated for a beginner programmer like myself, if complicated can anyone suggest other original ideas for a major project, thanks would be great help.

From ajaytee.
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 82
Reputation: preetham.saroja is an unknown quantity at this point 
Solved Threads: 1
preetham.saroja's Avatar
preetham.saroja preetham.saroja is offline Offline
Junior Poster in Training

Re: Visual Basic Help

 
0
  #2
Aug 14th, 2007
hai ajaytee,
take 4 txtboxes(4 car,house,credit card& name)& button to calculate his/her assets...u can calculate assets by addin all of them.store the result in database& compare value of all persons assets(dependin on values rate them..)thats it!!
The idea is very simplified(its good 4 beginner)-keep goin& try to solve the errors by urself -or take help of the forums& google(dont ask for others-manually)...Once u pass this stage then u can get the confidence(dont worry for all the technical prblms-google will hlp u or become member in p2p.wrox.com,daniweb,asp.net(forums)....
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 6
Reputation: ajaytee is an unknown quantity at this point 
Solved Threads: 0
ajaytee ajaytee is offline Offline
Newbie Poster

Re: Visual Basic Help

 
0
  #3
Aug 14th, 2007
Hey if i didnt want to use a database to store the data, would i need to use an array of some sort?
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 645
Reputation: binoj_daniel is an unknown quantity at this point 
Solved Threads: 17
binoj_daniel's Avatar
binoj_daniel binoj_daniel is offline Offline
DaniWeb Expert

Re: Visual Basic Help

 
0
  #4
Aug 14th, 2007
If you dont want to use databse to store data then you have other options too.
- You can use an XML file which can easily parsed.
- You can aslo try .dat or txt files

You can use array to fetch the records saved in these files or database but you can't save directly to arrays as they are virtual objects.
You need a physical storage to store and retrive the data.
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 322
Reputation: Hamrick will become famous soon enough Hamrick will become famous soon enough 
Solved Threads: 33
Hamrick's Avatar
Hamrick Hamrick is offline Offline
Posting Whiz

Re: Visual Basic Help

 
0
  #5
Aug 14th, 2007
A database just makes sure the data persists between runs of the program. If you set up all of your assets and then close the program, the assets are stored somewhere on your hard drive so that when you run the program again, everything is still the same as when you closed it.

You don't have to use a database to do that, but if there's a lot of data or relationships between the data, a relational database like SQL server is a good idea. If you still don't want to use a database, saving the assets to an xml file is pretty easy if you set up an object hierarchy and then serialize it with the stuff in System.Xml.Serialize. It's very easy. Here's a class that does it in C# and you can translate to VB without any trouble.
  1. using System;
  2. using System.Xml;
  3. using System.Text;
  4. using System.IO;
  5. using System.Xml.Serialization;
  6.  
  7. namespace Hamrick {
  8. /// <summary>
  9. /// Basic utility class for serializing with XML
  10. /// </summary>
  11. public class XmlWrapper {
  12. private XmlWrapper() { }
  13.  
  14. /// <summary> Convert an XML string into a root object </summary>
  15. public static object Deserialize( string xml, Type objType ) {
  16. try {
  17. XmlSerializer xs = new XmlSerializer( objType );
  18.  
  19. using ( StringReader stream = new StringReader( xml ) ) {
  20. return xs.Deserialize( stream );
  21. }
  22. } catch {
  23. return null;
  24. }
  25. }
  26.  
  27. /// <summary> Convert a root object into an XML string </summary>
  28. public static string Serialize( object obj, Type objType ) {
  29. try {
  30. using ( MemoryStream ms = new MemoryStream() ) {
  31. using ( StreamWriter writer = new StreamWriter( ms, Encoding.UTF8 ) ){
  32. XmlSerializer xs = new XmlSerializer( objType );
  33.  
  34. xs.Serialize( writer, obj );
  35.  
  36. return Encoding.UTF8.GetString( ms.ToArray() ).Trim();
  37. }
  38. }
  39. } catch {
  40. return string.Empty;
  41. }
  42. }
  43. }
  44. }
Or you can do just straight file work which is even easier if you have simple data. I like to use the xml approach because it's a great way to take my business objects and serialize them right to a file without any effort.
The truth does not change according to our ability to stomach it.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the VB.NET Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC