| | |
VB/VS 2008 and database
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Dec 2008
Posts: 7
Reputation:
Solved Threads: 0
Hello,
I am very new to Visual Basic and try to teach myself again after years and years of not using it. Learned very basic codes back in school but that was too long ago.
So far I have wrote only ONE application. Basic input, calculate and output. Came out almost bug free and I was very excited. But was very simple
I am trying to write an application that uses SQL local database. Why it needs to connect is still beyond me, but anyhow.. here is my problem.
I have read many locations that when I created a database I should then use a Database Form Wizard. Well hold and behold VS 2008 doesn't have that feature anymore since the application/form was retired. Great, I have read some more sites but just can't find the help. I figured by having using the Wizard I can better understand the interaction between the form and database by looking at the code.
So... reading the VB6 book and several tutorial sites, I still can't figure out what code I need to a) add data, b) edit data, C) delete data. Specifically how to interact Click with database.
So far I have the form, I have database table, have established connection. Just missing the code for click.
No, this is not a homework assignment which I have read through several posts here. This is for personal purpose, personal fun, personal time. If the application becomes successful, I may write more complex application than this one with bigger database and provide it to the gaming community.
I appreciate you help in advance. I am not expecting for someone to give me the code right off the back. If you do great, if not then please point me to right direction or give me a hint
Xad
I am very new to Visual Basic and try to teach myself again after years and years of not using it. Learned very basic codes back in school but that was too long ago.
So far I have wrote only ONE application. Basic input, calculate and output. Came out almost bug free and I was very excited. But was very simple
I am trying to write an application that uses SQL local database. Why it needs to connect is still beyond me, but anyhow.. here is my problem.
I have read many locations that when I created a database I should then use a Database Form Wizard. Well hold and behold VS 2008 doesn't have that feature anymore since the application/form was retired. Great, I have read some more sites but just can't find the help. I figured by having using the Wizard I can better understand the interaction between the form and database by looking at the code.
So... reading the VB6 book and several tutorial sites, I still can't figure out what code I need to a) add data, b) edit data, C) delete data. Specifically how to interact Click with database.
So far I have the form, I have database table, have established connection. Just missing the code for click.
No, this is not a homework assignment which I have read through several posts here. This is for personal purpose, personal fun, personal time. If the application becomes successful, I may write more complex application than this one with bigger database and provide it to the gaming community.
I appreciate you help in advance. I am not expecting for someone to give me the code right off the back. If you do great, if not then please point me to right direction or give me a hint

Xad
•
•
Join Date: Dec 2008
Posts: 7
Reputation:
Solved Threads: 0
Forgot to mention.
I do not have the code to show since I don't know where to begin. As far as coding goes. The only thing i have now is...
Pretty empty isn't it?
Xad
I do not have the code to show since I don't know where to begin. As far as coding goes. The only thing i have now is...
vb Syntax (Toggle Plain Text)
Public Class Form2 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click End Sub End Class
Pretty empty isn't it?
Xad
Last edited by Xadavus; Dec 10th, 2008 at 4:50 pm.
•
•
Join Date: Dec 2008
Posts: 7
Reputation:
Solved Threads: 0
I am using Visual Studio 2008 Professional (full version).
As for ADO .net I have tried www.ado.net and google search. Mostly find websites about ADO.net but specifically ADO.net tutorial section. Maybe I am looking at the wrong place.
Xad
As for ADO .net I have tried www.ado.net and google search. Mostly find websites about ADO.net but specifically ADO.net tutorial section. Maybe I am looking at the wrong place.
Xad
http://www.startvbdotnet.com/ado/default.aspx
http://www.startvbdotnet.com/ado/Simplebinding.aspx
http://www.startvbdotnet.com/ado/simplebinding1.aspx
Theres a full tutorial on what ADO.NET is and how you can use it in visual basic .net to connect then add/edit/delete/update data from a database
http://www.startvbdotnet.com/ado/Simplebinding.aspx
http://www.startvbdotnet.com/ado/simplebinding1.aspx
Theres a full tutorial on what ADO.NET is and how you can use it in visual basic .net to connect then add/edit/delete/update data from a database
Last edited by jbennet; Dec 10th, 2008 at 6:35 pm.
If i am helpful, please give me reputation points.
•
•
Join Date: Dec 2008
Posts: 7
Reputation:
Solved Threads: 0
Thank you for finding links for me.
One question I forgot to ask. If i make the application to use a database, and let someone else use the application on their computer. Does that computer have to have VB/VS or will the application run without the necessary major application?
As for the link you have sent, thank you. Though I think it confused me even more. First of all why use OLEdbConnect vs SQLdbConnect, or should I ask what is the difference, if I want to use local database? Currently using VS database table maker instead of Access, Excel or .xml.
The other question would be. Is it possible not to directly bind text box to database but rather from search result? Or is it actually bound but won't load until i select specific item/id/name then load?
For example, I want write a code for search engine or search *string* then have a list of names show up on one window, click on one of the names then display all the information in various Text boxes.
Again, many thanks in advance for your help and time.
Xad
One question I forgot to ask. If i make the application to use a database, and let someone else use the application on their computer. Does that computer have to have VB/VS or will the application run without the necessary major application?
As for the link you have sent, thank you. Though I think it confused me even more. First of all why use OLEdbConnect vs SQLdbConnect, or should I ask what is the difference, if I want to use local database? Currently using VS database table maker instead of Access, Excel or .xml.
The other question would be. Is it possible not to directly bind text box to database but rather from search result? Or is it actually bound but won't load until i select specific item/id/name then load?
For example, I want write a code for search engine or search *string* then have a list of names show up on one window, click on one of the names then display all the information in various Text boxes.
Again, many thanks in advance for your help and time.
Xad
•
•
Join Date: Dec 2008
Posts: 7
Reputation:
Solved Threads: 0
Okay, i got whole lot farther than I did few days ago as far as coding goes lol.
But I still have one problem, despite reading those links above. Something just doesn't seem to add up in my code. I was able to add few data into database directly, and during run program it loaded just fine. However when I attempt to Add data to the database with Add Button, nothing happens, no error of any kind.
Here are the file names..
Table: CLTable
Craftlist.mdf
CraftlistDataSet.xsd
And here is the code
Soo, what am I doing wrong. Please bear with me since I am really new to VB. I appreciate your help.
Xad
But I still have one problem, despite reading those links above. Something just doesn't seem to add up in my code. I was able to add few data into database directly, and during run program it loaded just fine. However when I attempt to Add data to the database with Add Button, nothing happens, no error of any kind.
Here are the file names..
Table: CLTable
Craftlist.mdf
CraftlistDataSet.xsd
And here is the code
vb Syntax (Toggle Plain Text)
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Me.BindingContext(CraftlistDataSet, "CLTable").AddNew() MsgBox("Successfully Inserted") End Sub
Soo, what am I doing wrong. Please bear with me since I am really new to VB. I appreciate your help.
Xad
![]() |
Similar Threads
- Query SQL database to retrieve Stored procedure names (VB.NET)
- ASP.Net Database ? (ASP.NET)
- Database vs. Spreadsheet (Windows Software)
- sending a datetime to database (JSP)
- Monitoring a directory for changes - VS C# EE 2008 (C#)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: backspace and delete key
- Next Thread: disconnected Remote Users?
| Thread Tools | Search this Thread |
Tag cloud for Visual Basic 4 / 5 / 6
* 6 429 2007 access activex add age append application basic beginner birth bmp calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver subroutine table tags textbox time timer urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows






