Code Creating

I would like to create 4 different codes. I would like to create 1 code that would insert a column(A) into my data table. I would also like to create a code that will insert a column(B) into my data table. The next line of code that I need is to ensure that one of my column will constantly add the values of all column(A)s and divide the values insert into any column(A) by the number of column(A)s in the data table, and I am sure you can guess I would like the next code to do the same function for the values inserted into any column(B).

example.

button control a button control b

string string colm a colm b colm a total a total b

text text 8 8 2 5 8

So this example I am showing that the total for a columns is 5 (8+2)/2=5 and total b is showing 8 (8+0)/1=8 the divided by number should change according to the number of column types.

This is what I am trying to get do.

Thanks




Answer this question

Code Creating

  • David Rainis

    I would like to learn how to do this coorectly. But I have no Idea of where to start. I am new to programming.

  • KateCooper

    Well, perhaps you are too new to be learning 2 languages at once ( SQL is a language ). Or perhaps you need to take it in smaller portions. How new is new Can you ( easily ) write a program that mimics the Windows calculator If not, then you need to spend some time learning how to write windows programs. Can you (easily) create a console calculator program If not, then you should forget abuot windows and do some console programming to learn the language before you worry about forms programming.



  • alexdon

    You should never store totals in your database, you should derive them from stored procs that perform the maths. Otherwise, you're duplicating data needlessly.

    As for the rest, to insert data into a database, you can either write SQL, or you can use the built in wizards. I tend to write SQL, but if you don't want to learn every aspect of programming, if you're just a hobbyist, the wizards are fine.

    // The next line of code that I need is to ensure that one of my column will constantly add the values of all column(A)s

    If you were going to store a total for all of column A somewhere, it would be in another table, but it's still a bad idea.,

    What database are you using Do you want to know how to do it properly, or just how to make a wizard work to do it for you



  • gjon

    There's a free ebook with VB Express, I thought. Beyond that, http://www.amazon.com/gp/product/0321169514/104-8806796-4187104 v=glance&n=283155 looks good to me.

  • Brian Cahill

    I think that I should start at the basis of vb coding. Now if you could just point me in the right direction I will gladly get the materials I need to start from step one in vb express.

  • Code Creating