There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios blue screen boot bsod computer connection cpu crash css dell desktop dma driver drivers dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware hijackthis hjt install internet internet explorer itunes keyboard laptop macro malware monitor motherboard network networking outlook outlook 2003 outlook 2007 outlook express pio problem problems router seo server slow sound sp3 spyware trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless
Software Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
VB.Net and Oracle SQL


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
toonworld's Avatar
Junior Member with 26 posts.
 
Join Date: May 2004
Experience: Novice
22-Jan-2005, 04:19 PM #1
VB.Net and Oracle SQL
I know VB.net and sql can be used together and I was wondering what exactly is involved in doing this. This post is probably vague but I want to do a program in visual basic. net using a sql database already created. Can someone tell me if its a hard process to use them together? And for vb.net what controls and other things that I will have to use with the sql database and displaying the sql database? If anyone can offer any comments its very appreciated. Thank you.
Ciberblade's Avatar
Computer Specs
Community Moderator with 15,700 posts.
 
Join Date: Sep 2003
Location: Heart of the Bluegrass Ky
Experience: Mostly Harmless
23-Jan-2005, 03:28 PM #2
Yes, this can be done. If you know SQL then the format is all you will need to get used to.

To get started you must connect to the database, and utilize a DataAdapter and DataSet. I have worked with this through Access via SQL and the three used are shown in red. You might need to use the two in green for your's. You will need the DataSet regardless.

The first thing you will need to do is connect to your database. In the properties for data...select "new connection" from the dropdown list...and then browse to your database,,,don't forget to test your connection or it will crash.

Second, configure your DataAdapter. When you click on it, the bottom of your properties box will contain a link that says "Configure Data Adapter..." Click on that.

Finally, the DataSet. This is what you will load the results of your query's into and pull from.

Now lets take a look at some of the code you will need to use. (keep in mind that this is only for syntax -- real names and values will be yours)
Quote:
Originally Posted by code
OleDbConnection1.Open()
sql = "select students.studentID, students.name, students.password "
TestDataAdapter.SelectCommand.CommandText = sql
DataSet.Clear()
TestDataAdapter.Fill(DataSet, "students")
avtests = DataSet.Tables("tests")

Catch exception As System.Data.OleDb.OleDbException
MessageBox.Show("Invalid Query")
TestDataAdapter.UpdateCommand.CommandText = squpd
TestDataAdapter.UpdateCommand.ExecuteNonQuery()
Now avtests is global and declared as type "DataTable" So you can get to it from other locations.

You may notice that I used the error correction of type exception...I use this so if there is an error, regardless of what it is, I can exit w/o the crash (saves time in debug)

There is much to this type of setup, and I know I just scratched the surface for you. I do not know if this is enough for completion, but it should get you in that direction. Good luck
Toonworld!  To the best tech-support site on the net!
Attached Thumbnails
vb-net-oracle-sql-vbsql.jpg  
__________________
82,268
*AD-Aware*AIDA32*AVG-7*Filemon*Hijack This*PortMon*Process Explorer*TSG Forums menu*

Far righty-tighty Wingnut Libertarian ( ) - annoyingly free thinking with no tendency to agree on anything with anyone. - BF

If you wish...you can now come to church with me! A church that is NOT normal...a church for people who don't like 'church'

Last edited by ciberblade : 23-Jan-2005 03:46 PM.
toonworld's Avatar
Junior Member with 26 posts.
 
Join Date: May 2004
Experience: Novice
23-Jan-2005, 08:27 PM #3
Thanks a lot. I do remember using data adapters and dataset once before. Unfortunately I don't think I know enough about visual basic.net to use sql with it and would be think it would take to longer to complete the project. I'm a novice still in this field and although it would be a good experience to use them together. Its a very difficult decision. I'll probably end up just using Oracle forms builder as i know it fairly well and am more comfortable with it. But like i said using vb.net with sql might be more beneficial to me in the long run like getting my first job.....
Ciberblade's Avatar
Computer Specs
Community Moderator with 15,700 posts.
 
Join Date: Sep 2003
Location: Heart of the Bluegrass Ky
Experience: Mostly Harmless
23-Jan-2005, 08:59 PM #4
Well then, you might want to consider using what you know to complete the project...then work on the .NET side later to better understand it.

Good Luck
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 05:33 PM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.