Subject: New to VB/Database (Urgent)
Posted By: FrancisEnem Post Date: 11/21/2006 10:31:00 AM
I Just started VB/Database programming not more than a week ago. I need a whole lot to make my life easier.

1. I have a form with text fields. I have created a dataset and a data adapter. My problems are
i.  how to populate the text fields with the data from the dataset
ii. how to navigate to the next/previous record
iii. how to save/delete records from the dataset
iv. to to navigate yo the first/last records

2.In my application, I have created a menu for several forms; my control(buttons) resides on the menu which is the child MDI. Suppose I have a control (Save) in the Main MDI form, I want to use this control to save a record in a child form within the main MDI form. In order words, I want to know
i. how to pass parameters from Main MDI to child forms
ii. how to write independent procedures and functions(classes) and call them from any of my form within the Main MDI form.

Regards

Reply By: anubisascends Reply Date: 11/24/2006 2:36:07 PM
For answers to all of this, I would take a look at the MSDN library to find the answers, or get one of the wrox books, both of these resources really helped me.

I am still not too familiar with passing DB info to a VB app yet, but I can tell you that your IDE can take care of alot of this.  Try using the help files located in the IDE that you are using.

to pass info from the MDI to the Child, you can try creating a public variable, or create a custom property.

public variable:

Public test as string = textbox1.text

property test() as string
get
textbox1.text
end get
set (byval value as string)
textbox1.text
end set
end property

hope this helps a little.

Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.
Albert Einstein
US (German-born) physicist (1879 - 1955)
Reply By: milledj Reply Date: 12/11/2006 2:04:51 PM
To call functions and procs described in a different form or module, you can make them public and your application will find them. You can also qualify them ie: mod1.get_name(xxx)

I am out of date here, but I have used those techniques in the past.

Simple answer to your simplest question...

Reply By: milledj Reply Date: 12/11/2006 2:11:18 PM
OK, since I am still waiting for a solution to my problem, and in the meantime am waiting for vb.net to load...

1. I have a form with text fields. I have created a dataset and a data adapter. My problems are
i.  how to populate the text fields with the data from the dataset
> there are a few different techniques for this...and it depends on which version of VB, but in general, they are the similar. You can either link them to your dataset field values, or you can move the data in manually (ie: a call to a load_data subroutine). The first method is simpler, if these are indeed database-related values. If not, you MUST use the 2nd technique.
ii. how to navigate to the next/previous record
your dataset should have functions like "movenext" or "moveprevious"
iii. how to save/delete records from the dataset
I usually use SQL for all my data manipulations, so I create either a database proc to do this -- like an API -- and do some checking at that level -- or you could create a sql statement and execute it directly within your VB code.
iv. to to navigate yo the first/last records
your dataset should have movefirst, movelast OR use SQL to do this...

Hope this helps some.



Go to topic 53055

Return to index page 97
Return to index page 96
Return to index page 95
Return to index page 94
Return to index page 93
Return to index page 92
Return to index page 91
Return to index page 90
Return to index page 89
Return to index page 88