| | |
Visual Basic Help
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Feb 2007
Posts: 6
Reputation:
Solved Threads: 0
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.
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.
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)....
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)....
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.
- 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.
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.
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.
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.
c# Syntax (Toggle Plain Text)
using System; using System.Xml; using System.Text; using System.IO; using System.Xml.Serialization; namespace Hamrick { /// <summary> /// Basic utility class for serializing with XML /// </summary> public class XmlWrapper { private XmlWrapper() { } /// <summary> Convert an XML string into a root object </summary> public static object Deserialize( string xml, Type objType ) { try { XmlSerializer xs = new XmlSerializer( objType ); using ( StringReader stream = new StringReader( xml ) ) { return xs.Deserialize( stream ); } } catch { return null; } } /// <summary> Convert a root object into an XML string </summary> public static string Serialize( object obj, Type objType ) { try { using ( MemoryStream ms = new MemoryStream() ) { using ( StreamWriter writer = new StreamWriter( ms, Encoding.UTF8 ) ){ XmlSerializer xs = new XmlSerializer( objType ); xs.Serialize( writer, obj ); return Encoding.UTF8.GetString( ms.ToArray() ).Trim(); } } } catch { return string.Empty; } } } }
The truth does not change according to our ability to stomach it.
![]() |
Similar Threads
- Playing .Wav/MIDI files in a Visual Basic Program (Visual Basic 4 / 5 / 6)
- Creating an OS in visual basic 6.0 (Visual Basic 4 / 5 / 6)
- The Move.....Visual Basic 6, Visual Basic .NET ? (VB.NET)
- Encrypting a Visual Basic application (Visual Basic 4 / 5 / 6)
- passing arrays in visual basic (Visual Basic 4 / 5 / 6)
- Visual Basic.net (VB.NET)
Other Threads in the VB.NET Forum
- Previous Thread: how to start with vb
- Next Thread: Help
| Thread Tools | Search this Thread |
.net .net2008 2008 access account add advanced application array basic beginner browser button buttons click code combo cpu cuesent data database datagrid datagridview date datetimepicker designer dissertation dissertations dissertationtopic employees excel exists fade filter forms generatetags html images input intel internet listview mobile module monitor mysql net number objects open panel pdf picturebox picturebox2 port position print printing printpreview problem regex reuse right-to-left save search searchvb.net select serial settings shutdown socket sqldatbase sqlserver storedprocedure survey temperature textbox timer timespan transparency txttoxmlconverter update user usercontol vb vb.net vb.netformclosing()eventpictureboxmessagebox vba vbnet vista visual visualbasic.net visualstudio.net visualstudio2008 web winforms wpf wrapingcode xml year





