|
check your quotes.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
Hi, I'm looking to create a database within my program. I was planning on using a record type, following something my teacher has said about it being similar to an array. However, having looked for this record type, I figure it must have been for an older version of visal basic.
Is there a way that I can create a database, similar to an array? I'd like to keep it within visual basic if possible, rather than using access, as seems to be quite common.
|
|
|
|
|
outhwaik wrote: atabase, similar to an arra
An array is not a database.
The only thing you can do that somewhat is similar to a database is use a datatable / dataset
But anything you store in there is just in memory and will be lost on exiting the program.
outhwaik wrote: using access, as seems to be quite common
Not really, sql-express is common.
What are you trying to do here?
|
|
|
|
|
I'm planning on saving the data in a text file, to be loaded on starting the program, so the data wouldn't be lost.
I want to avoid using access if possible, as the machine this program will eventually be used on doesn't have access.
What I'm acutally trying to do is, or at least i thought, quite simple. It'll effectively be a small database of the members of a Brownie pack, with names, address, phone number etc stored in different fields.
modified on Friday, October 9, 2009 5:52 PM
|
|
|
|
|
You don't need to have access installed to use it in a .NET program.
So for something this simple I'd suggest using access instead of a text file.
|
|
|
|
|
The entries for the database are going to be entered via visual basic by my user, and the access file won't exist til she creates entries. Is this going to be possible?
|
|
|
|
|
Well you could create the access file when you need to but I don't see the point in it.
Just have a empty access database with the needed tables installed along with the program. Then enter the data as needed.
It will make searching the data easier.
You can always go for the XML option Dave told you about.
|
|
|
|
|
So long as you're not going to be doing any SQL queries against this "database", you can just create a collection of "Member" objects and serialize that collection to an XML file to save it. Upon the next start of your app, deserialize the XML file back into the collection.
|
|
|
|
|
Can you explain a bit more about using an 'XML file'? Again, its not something I've used before.
I'll want to be able to search for records by a couple of different fields, and display parts of the records in different text boxes. Would I be able to do that?
|
|
|
|
|
Here ya go,
HOW TO: Serialize and Deserialize XML in Visual Basic .NET http://support.microsoft.com/kb/316730[^]
I don't speak Idiot - please talk slowly and clearly
I don't know what all the fuss is about with America getting it's first black president. Zimbabwe's had one for years and he's sh*t. - Percy Drake , Shrewsbury
Driven to the arms of Heineken by the wife
|
|
|
|
|
outhwaik wrote: I was planning on using a record type, following something my teacher has said
Suspect what your teacher referred to was a RecordSet which is ADO technology. With the introduction of ADO.NET RecordSets have been superceded with DataTables and DataSets .
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
Do datatables or datasets work in a similar way to arrays? Are they purely contained within visual basic? (with any text files for saving or equivilent)
|
|
|
|
|
outhwaik wrote: Is there a way that I can create a database
Do you want to create a database-file (in any format, say Access), or do you want to create your own database-driver (your own Access, so to speak)?
outhwaik wrote: Is there a way that I can create a database, similar to an array?
Yup, just open Microsoft Access and create a table with a single column. That's a one-dimensional array.
outhwaik wrote: I'd like to keep it within visual basic if possible, rather than using access, as seems to be quite common.
That's quite common indeed, because Access is good at storing data, and it's usually faster/cheaper than rolling-your-own.
I are Troll
|
|
|
|
|
I'd prefer to avoid using Access if possible, as I've said, the machine this will eventually be used on doesn't have access, hence the fact I'd rather save data in text files (or alternative).
I'm reasonably competent at using arrays, I just wondered if there was an 'array' where different datatypes could be stored in different 'columns'. It now seems the solution may not be quite that simple
|
|
|
|
|
outhwaik wrote: the machine this will eventually be used on doesn't have access
The machine doesn't need to have Microsoft Access installed. You can create and manipulate databases without the Access-application.
I are Troll
|
|
|
|
|
Maybe you could use an embedded Db such as SQL CE or SqlLite?
I don't speak Idiot - please talk slowly and clearly
I don't know what all the fuss is about with America getting it's first black president. Zimbabwe's had one for years and he's sh*t. - Percy Drake , Shrewsbury
Driven to the arms of Heineken by the wife
|
|
|
|
|
I'm unfamiliar with these methods (hence the fact that I've come here looking for help!)
Are any of these methods entirely contained within visual basic, and relatively simple to use?
|
|
|
|
|
SQL Compact Edition comes as a DLL that you reference in your project. Very simple to use and you can use the Database Editor in Visual Studio to work with the files - Also woks via SSMS.
SqlLite is similar - has a nice addin admin console, small footprint and is pretty speedy.
I wont do it for you, but Google SQL CE and SqlLite - you will be surprised at the info out there.
I don't speak Idiot - please talk slowly and clearly
I don't know what all the fuss is about with America getting it's first black president. Zimbabwe's had one for years and he's sh*t. - Percy Drake , Shrewsbury
Driven to the arms of Heineken by the wife
|
|
|
|
|
What you are looking for is dataset and datatable (as stated by others) these have a WriteXML and ReadXML methods. This will allow you to persist your data across sessions. The only real issues is you have to manually construct the dataset/table before you can use it. You may want to look at this article[^], it uses this method.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
To connect to a Database their are several ways and most commonly used are the datasets or to create your Objects , i always prefers creating objects but have seen most of the ppl using datasets , which one is better Objects or Datasets , regarding application performance point of view
Best Of Regards,
SOFTDEV
If you have knowledge, let others light their candles at it
|
|
|
|
|
S0FTDEV wrote: which one is better Objects or Datasets , regarding application performance point of view
No one can really answer that for you as the answer would vary depending the data you are using.
The only way to be sure is to do a test application using both methods and time them.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hello Everybody,
I have created application which is working successfully. This application is developed in vb.net 2005 and outlook 2007 is using for mail sending purpose.
I m sending mail at particular email id with ReadReceiptRequested=Ture property. I also got ReadReceiptRequested mail from particular Email ID.
My problem is that how i know that this ReadReceiptRequested mail which is comes from particular email id with my mail which i send before.
I want to compare and check my send mail and ReadReceiptRequested mail and want to store information into database. Is any unique fields(key) in both mail sothat i can conform this ReadReceiptRequested mail is reply of particular send mail?
For sending mail through outlook my code is below:
Dim Forward_newMail As Outlook.MailItem = Application.CreateItem(OlItemType.olMailItem)
Try
Forward_newMail.To = Agent_Receiver_Email_ID
Forward_newMail.Subject = newMail.Subject
Forward_newMail.Body = newMail.Body
Forward_newMail.ReadReceiptRequested = True
Forward_newMail.Send()
Catch ex As System.Exception
End Try
Thanks in advance
Regards
Dharmchand Dhingra
|
|
|
|
|
AFAIK, there is no link between the mail sent and the "read receipt" email that might come back. I for one have turned off that functionality in my email prog. The only link that I can see that may be good is matching up the subject lines.
|
|
|
|
|
Thanks for reply.
Yes, it is possible to match with subject but if duplicate subject name are in outlook then it is going to fail. i solved it (using temporary logic) with send a unique no. with subject when i send mail to user. when user receipt this mail then this unique comes along with read receipt mail.
if you find another solution then plz reply me.
Regards
Dharmchand Dhingra
|
|
|
|
|
dcdhingra wrote: if you find another solution then plz reply me.
Why would I even be lookging for another solution? I'm not getting paid to do your work.
|
|
|
|