So I used to know a bit of VB6 during the one year of college I took. I was unable to make it to class for all the database lectures (all the good stuff), though. I now have a copy of VB.net and a new registration on this forum I found by chance on google 5 minutes ago (wonderful site by the way). I work in a warehouse that stores books and Audio/Visual material. I want to make my life easier, while at the same time learn how to program with VB.net, by creating an inventory program to use at this warehouse.

I understand the creation of such a program will be heavy with database work. I do not have access to Microsoft Access, and I don't have much money to spend on a comparable program. I was wondering what the best route to take would be if I need an inexpensive/free database program to coincide with my program, as well as tutorials for a newcomer to VB.net.

I plan on consulting this forum throughout the duration of this program's production (if that's alright with you). Right now I just want to make sure I start with a good foundation. I'd appreciate any and all suggestions. Thank you!

Free database = MySQL? But access IS the easiest to use with VB.NET IMHO. Access 2007 is shit btw)

For a good book rto go from VB6 to .NET whoch covers some very basic DB stuff get "Visual Basic 2005 Step By Step" By Michael Halvorson of Microsoft Press. Highly reccomend.

I would consider using Microsoft SQL Express (A FREE Version of SQL Server)

I use it for my Home/Development databases

You will need to download
Microsoft SQL Server 2005 Express Edition (The Database)
and
SQL Server Management Studio Express (The Database Viewer)
Which are FREE from the Microsoft website

Awesome! Both of you left me very relevant and helpful responses. Thank you! I will get Halvorson's book and it's great to know MS offers free support for SQL databases. This is a great start! Will let you know when I have more questions.

You can only use SQL Express for a limited amount of clients i think (3?)

And yeah, VB 2005 Step By Step is an awesome book. Once you get to grips with .NET then you may also be inrerested in a book in the same series called ADO.NET which is everything you need to know about databases

I will be conducting this project on my own time and my own dime. I want to throw the least amount of money into it as possible. Eventually, if I succeed in my goals for the program, I will use it as a prototype for a proposal. I will suggest for our IT guy to create a similar program and to integrate it within our network. If they turn that down, at least I'll have something to help me keep track. Right now, inventory is conducted per my boss' request, and the only way I can keep track is on paper. The least amount of random papers I have to keep track of, the better. I'm the only one in the warehouse, so I'm pretty much always busy.

I bought the book. I skimmed through it and it looks very comprehensive and easy to read; exactly what I was looking for. Would've started yesterday but I came home and my buddy was on WoWcrack on my computer. I didn't have the heart to kick him off 'cause he was running my rogue through the Deadmines.

Today, if he's on my computer when I get home, he's getting the boot. I can't wait to start programming again. It's been too long.

:)

later it gets into an exampke database for a (gym?) built in access. Its a good intro to the server explorer and other database tools

2 things to be aware of though. I dont think the express version has the dataform wizard and you will need visual web developer express to the web (asp.net) chapter

I noticed when I installed Visual Studio yesterday, it said something about installing a SQL server or something like that. I'm not sure if it's only for mobile development or whatnot. I need to look into the actual product more.

Yesterday I was just getting re-acquainted with the whole system, as well as finding new things about VB 2005 that weren't in VB6.

One thing I never understood is "Rnd()". I understand we put "Randomize" in the Form Load function to prevent subsequent, identical random numbers. I also understand we use Int(Rnd() *10) to generate a random number but I never fully understood why.

I reaaaaly need to brush up on some basics before I even think about working on the databases.

Rnd generates a decimal value between 0 and 1 so you times it by 10 to make it between 1 and 10 , if you know what i mean

You can install SQL express / MSDN libary later through add/remove programs

So, whatever number we multiply with the number that Rnd generates, will affect the number of digits possible in the random number? Like, x10 would only give it 2 digits (not counting numbers past the decimal point)?

Thanks again!

Sort of. Heres an example

Rnd() = a number between 0 and 1 with SEVERAL decimal places

Using Int(Rnd *10 ) returns integer (whole) number between 1 and 9 (because of the way it is rounded)

thats why sometimes if you want a number between 1 and 10 you see people adding 1 to it

use Cdbl instead of Cint if you want whole numbers with A LOT of decimal places (Cdbl is a double floating point value)

I see. So say Rnd() generates .0000001. If we have Int(Rnd *10), it would generate the number 0 because 10(.0000001) = .000001, rounded = 0? If Rnd() generates .7834689, Int(Rnd * 10) = 8, because 10(.7834689) = 7.834689, rounded = 8?

Why would .9999999 as Rnd() be rounded to 9? If you have the +1, wouldn't it round up to 11? Or is it because 9 is the max?

Also, is Int(Rnd *10) a proper format, or does it have to say Int(Rnd()*10)?

Thank you!!

Why would .9999999 as Rnd() be rounded to 9

because it doesnt technucally round up, what changind it to an int does is lop off the decimas

Ah. So no rounding takes place; just a conversion. Awesome I will keep that in mind. Thanks yet again!

thats what cint means

Cint = convert to int


VB will you let you get away with it by default but you really shouldnt do somthing like put an integer into a text box as it is a string

you should use Cstr to convert to string

e.g textbox2.text = Cstr(some number)

I'm starting to remember the C"variable type" commands from my computer science class in college. Thanks for the reminder on that one.

Just for example, if I want someone to input a number and then press a button for it to be multiplied by 10 and displayed in the same text box, it would be something like this (assuming all variables are declared)?:

btnMULTIPLY.click ' This is the action of the button being clicked while everything below is the code for the action
strINPUT = txtINPUT.text ' This takes what the user input and stores it in a string variable
intINPUT = Cint(strINPUT) * 10 ' This converts the string variable to an integer, multiplies it by 10, and then stores it in an integer variable
strINPUT = Cstr(intINPUT) ' This converts the integer variable to a string and then stores it in a string variable
txtINPUT.text = strINPUT ' This displays the string variable contents in the textbox

Of course this is half-a'd code without any error handling, so I am assuming the user doesn't input any actual text in the textbox.

the easy way to know waht i mean is to make a project then go into thye project options (i think in express you double click my project and choose the debug tab) and then set OPTION STRICT to ON. It will then give you warnings if you do not have the right variable conversions

If you could use it on a large scale then microsoft would make no money from the rel sql. MSDE was limited to 8 and sql express is limited to 5 concurrent users.

it is also limited to:


-- Support for only 1 CPU. In systems with multiple CPUs, Express will only bind to one CPU at a time, and it cannot run queries in parallel.

-- 1 GB RAM. Express cannot use more than 1 GB of RAM at a time for queries and data pages. The program's own memory footprint is not counted.

-- 4 GB maximum database size. No one database in Express can be larger than 4 GB, but there is no limit on the number of databases you can use in Express.

I came up with an interesting idea for my final program (which will obviously be in development for quite some time). I don't want the final product to only be an inventory program. I also want to integrate it with a space management program with a 3-D view of the entire warehouse. I'll eventually take measurements of the entire warehouse, as well as each box & piece of equipment. I'll then create them to scale with a 3-D program, and place them accordingly across a 3-D map of the warehouse. Here is what I'm imagining:

One of our staff attorneys needs books and promotional materials to go promote our business at a local law school. I'm sick, out to lunch, or just too busy to do anything else but what I'm doing. Instead of being screwed into searching the entire warehouse for what he needs, he simply logs into our networked inventory/space-management program (I'll call it "Invent-Space" 'cause of the obvious double feature, as well as it would give me an opportunity to "invent" or create space in the warehouse). He chooses the option: "Find an item in the warehouse." He is then presented with different categories of choices, such as "Books", "Promotional Materials", "Forms & Applications", "Office Supplies", etc. Once he makes a choice, he is then presented with an organized list of items pertaining to his chosen category.

He clicks on an item, and is told how many there are available in the warehouse. If he clicks the "3-D view" option, he is presented with the 3-D map of the warehouse. Everything will be visible in block/cube form (for simplicity's sake), and everything will be grey. Since he clicked on an item before clicking 3-D view, that particular item is "highlighted" with an eerie green glow (he will have the option to click on an item after choosing the 3-D view; I only want the choice given because obviously a 3-D map takes more RAM than a few text boxes). So instead of searching the warehouse for a box of books that looks like every other box of books in the warehouse, he searches a grey 3-D map for a highly-noticeable green glow, prints out a snapshot of the 3-D map if need be, comes downstairs, grabs what he needs, and then still has time for coffee and mingling before he leaves.

Of course this program will be under the GNU1 public license, 'cause software is just too expensive these days.

A little FYI. You do not need a random number seed. Just use:

Dim RanGen As New Random

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        ' The next number
        TextBox1.Text = RanGen.Next
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        ' Min and max numbers
        TextBox1.Text = RanGen.Next(7, 28)
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        ' Max number
        TextBox1.Text = RanGen.Next(234)
    End Sub

I've been away for a few days; just been busy with work. I ended up working this weekend, cleaning a warehouse that hadn't been cleaned since 2000. I decided, after coming home and upchucking/sneezing dust, to treat myself to some mong-out time on wowcrack. I will be back as soon as I feel my brain is powered back on. :p Shouldn't be long at all.

As for that code above this message, thank you, but I don't understand it much. I could just use it and it would probably work like a charm, but I am always trying to understand the work I do so I can get a better hang of it all. I see there are three buttons that all affect the same variable and the same text box?

I just created a form with 3 buttons and a textbox.
Button 1 displays the next random number everytime you press the button (0 to 1)
Button 2 displays a random number between a minimum number(7) and a maximum number(28).
Button 3 displays a random number between 0 and a maximum number(234)

This article has been dead for over six months. Start a new discussion instead.