ITWriting.com

Home

Books for developers

Contact

 

A simple VB.Net database example

 


   

 

Your comments

 

I like VB.Net, and in particular I much prefer the ADO.Net database API to ADO or DAO in VB 6.0 and earlier. Having said that, if you open up Visual Basic .Net for the first time and try to build a database application, it's not obvious how to proceed. To make matters worse, the data form wizard is not particularly helpful. Therefore, in Visual Programming Hands On, March 2004 edition, I gave a small example.

Download the code here.

It's one of many, many ways to create a database application, it's very short, it needs more error handling, and there are better and more sophisticated approaches you could take. However, it does split the data access from the presentation. One of the advantages is that you can re-use your data access DLL behind an ASP.Net web application, on an intranet or on the Internet. That's why I made Sub New in the SchoolData class take a path in its constructor. Just have your web app pass it the path to your MDB on the web server - probably somewhere not directly accessible from the Web. Or you can use some other database server. Most ASP.Net sites offer SQL Server.

April 2004: Now added New and Delete buttons to complete a very simple application.

Here's an example using the same data access DLL behind a web application.

Of course it's not only data access that you can use behind both web apps and Windows forms apps. Build all your non-visual code into a separate assembly; that way you have maximum flexibility for future deployment.

 

Copyright Tim Anderson 18th January 2004. All rights reserved.

Sign up to be notified of future articles


 
 
69 comments
Comment posted on 2008-10-03 09:05:07 by: nisha.
kindly send me the vb.net mysql, server 2000, connection code.as well as to add,update,delete the records
Comment posted on 2008-09-14 19:22:03 by: rajarajeswari.
Sir My problem is that my front end is vb.net and my database is oracle 8i so how can i connect frontend to backend and how can i open the database.please sir give me all details with examples because i am working on a project of Loan Management System.i have designs the forms but i am not able to get the value from the database.And also give me some code examples for inserting, deleting, updating on oracle database from vb.net.please tell me the code on raji.perachi@gmail.com
Comment posted on 2008-09-13 14:14:03 by: amit.
code
Comment posted on 2008-09-13 08:48:13 by: preetam.
sent coding for detail with database implement and using report for excel and word document and pdf file
Comment posted on 2008-09-10 13:35:41 by: preetam.
sending for vb.net project material for codind
How can find the record in database in vb.net with exapmle

Comment posted on 2008-09-09 08:51:41 by: Dung.
thks so muk
Comment posted on 2008-09-06 02:19:01 by: r.
xcbfvbvc
Comment posted on 2008-09-01 11:46:50 by: solomon.
sir, i did a program using vb.net and access... i need to put a search button in the form so that if i give a register number in the textbox and press the search button means, it should provide the other details corresponding to that register number.. please send the coding for that search button
Comment posted on 2008-08-28 02:36:00 by: Nil Barros.
i would like to know how to connect my front end Vb.net and ms access database, it's my first learning, i would like to know how would you able to make database work, I am using asp.net matrix.... i want to learn about it,,, tnxs
Comment posted on 2008-08-26 08:09:58 by: mikey.
hi.I need to create a relation beetween many databases records and the data itself .How can i do that
Comment posted on 2008-08-24 13:44:12 by: vigneshbabuji.
Sir My problem is that my front end is vb.net and my database is oracle 8i so how can i connect frontend to backend and how can i open the database.please sir give me all details with examples because i am working on a project of Loan Management System.i have designs the forms but i am not able to get the value from the database.And also give me some code examples for inserting, deleting, updating on oracle database from vb.net. please tell me code on mjvigneshbabuji@yahoo.co.in
Comment posted on 2008-08-24 13:37:56 by: vigneshbabuji.
Sir My problem is that my front end is vb.net and my database is oracle 8i so how can i connect frontend to backend and how can i open the database.please sir give me all details with examples because i am working on a project of Loan Management System.i have designs the forms but i am not able to get the value from the database.And also give me some code examples for inserting, deleting, updating on oracle database from vb.net
Comment posted on 2008-08-23 08:34:08 by: pradeep.
how to search a particullar data in textbox and textbox display all the list of particullar record in vb.net.
for ex:-if we search a name like "pradeep"then we insert 'p'in a textbox then it should be display all the name list those start from 'p' then we select a particullar name like"pradeep".
plz tell me code on callirfan_12rediffmail.com

Comment posted on 2008-08-23 08:32:32 by: irfan.
how to search a particullar data in textbox and textbox display all the list of particullar record in vb.net.
for ex:-if we search a name like "pradeep"then we insert 'p'in a textbox then it should be display all the name list those start from 'p' then we select a particullar name like"pradeep".
plz tell me code on callirfan_122rediffmail.com

Comment posted on 2008-08-23 08:28:40 by: irfan.
how to search a particullar data in textbox and textbox display all the list of particullar record.
for ex:-if we search a name like "pradeep"then we insert 'p'in a textbox then it should be display all the name list those start from 'p' then we select a particullar name like"pradeep".

Comment posted on 2008-08-21 06:22:19 by: Santhiya.R.

This site is good at clearing all the basic doubts i had.

please help me to how to perform CRUD operations in

Nhibernate for Vb.Net. Thank you.

Comment posted on 2008-08-14 08:19:51 by: Ganesh.
plzz..... any one send me msflexgrid program.

i need to enter data's in msflexgrid at runtime

how can i make this

if anyone know .. tell me plz


k.waran@rediffmail.com


Comment posted on 2008-08-14 08:16:10 by: Ganesh.
I want source code for FTP program using vb.net
Comment posted on 2008-08-14 08:14:20 by: Ganesh.
plz........... how can i make slide program
Comment posted on 2008-08-13 14:10:44 by: ptr.
thank you
Comment posted on 2008-08-07 16:59:10 by: Nithyapriya.
hi friends, can you please send .net material with more examples.
Comment posted on 2008-08-01 07:19:31 by: sanjay kumar chuadhary.
How can find the record in database in vb.net with exapmle
Comment posted on 2008-07-31 02:26:34 by: rhenzlove.
pls. provide me a source code in vb.net(search) and the data will display on the text box.... thanks
Comment posted on 2008-07-25 09:02:44 by: palani.
coding please
Comment posted on 2008-07-24 08:43:58 by: geetha.
how to write function to add items from database to combobox
in DLL,that function i have to call in vb.net

Please help me

Comment posted on 2008-07-16 07:37:58 by: siva.
i want to add,delete,edit in vb.net it is stored to access database and connect to database codings
thank you

Comment posted on 2008-07-12 17:23:43 by: Reshu.
Sir My problem is that my front end in vb.net and my database is oracle 8i so how can i connect frontend to backend and how can i open the database.please sir give me all details with examples because i am working on a project of payroll system.i have designs the forms but i am not able to get the value from the database.
Comment posted on 2008-07-01 07:29:17 by: ARJAY.
Sir,
Please help me because i cant find on how to view the data report in vb.net for printing like in vb6.0. Is there still data report in vb.net? I dont want to use crystal report because it needs additional software to install.
Thank you!

Comment posted on 2008-07-01 07:20:51 by: ronald.
I hope you provide a complete example of a system.
Comment posted on 2008-06-26 11:07:13 by: sudheer.
Sir
I have to make a database of project details using vb.net in short time.i know the basic of vb.net but i dont know how to connect database in vb.net version 2005.I design a form with combobox & textbox, i created ms access table . so pls send some ideas and source code
for updation(insert) and search option of the project details. if i click the button these things should happen.

Comment posted on 2008-06-24 12:01:56 by: shanti patel.
are there any good beginners book on vb.net and database
Comment posted on 2008-06-15 18:51:06 by: LEELA.
Sir
I have to make a database stock management project using vb.net in short time.i know the basic of vb.net but i dont know how to connect database in vb.net version 2005.I design a form with combobox & textbox, i created ms access table . so pls send some ideas and source code
for updation(insert, select,delete) and navigation(first,next,previous,last) i need simple program. if i click the button these things should happen.

Comment posted on 2008-06-15 08:42:03 by: nitesh.
how to create database in vb.net?
Comment posted on 2008-05-31 12:53:06 by: john.
two comboboxes
1st combobox item is selected
2nd combobox item is selected
then click "button"
data dispay on grid view
send me code sample project i download
thanking
john

Comment posted on 2008-05-22 12:34:46 by: Tahir Ali Shah.
I need database related programming help.
Comment posted on 2008-04-20 14:04:02 by: Mohammad Tarequl Islam.
I need some project which is done by vb.net.by the way, dtabase should be ms access.pliz help me.i want to learn about that.
MY ID

tareq_ibcs2006@yahoo.com

Comment posted on 2008-04-16 14:08:22 by: prashant dubey.
send me a simple example for database connectivity
Comment posted on 2008-04-09 05:59:08 by: Shaneesh Patel.
Thanks for the great intro to database use in .NET with access database it would really help me understand how to get access to a database using web pages.


Comment posted on 2008-03-19 14:52:09 by: joyanta bora.
sir i build a software project. My database create in oracle. form create in vb.net. i have a problem ? how i coonect oracle 8i/9i dbms with my vb.net forms?
Comment posted on 2008-03-17 18:14:30 by: liaqat khan .
please send me vb.net database code
Comment posted on 2008-03-14 16:35:08 by: Greg.
Could you share your source for the webapp version?
Comment posted on 2008-03-07 06:07:44 by: chinnu.
hi..
i need help friends..i gt job in .Net platform...bt I hav no idea about that...please help me to provide materials about VB .Net, DataBase access...n more ...pls help me...

Comment posted on 2008-02-26 05:47:57 by: ankur.
friends i am in big trouble pls help me out.
i have to make a databaase project using vb.net in short time.i dont know anthing about vb.net .but i know about vb so pls send some ideas and source code

Comment posted on 2008-02-17 04:18:02 by: prashant.
sir,
i want to know that how to connect database .
i want to connect my simple form to oracle.
plz help me.

Comment posted on 2008-02-17 04:03:22 by: prashant.
sir,
i want to know that how to connect database .
i want to connect my simple form to oracle.
plz help me.

Comment posted on 2008-02-04 14:56:59 by: Prasad.
Good
Comment posted on 2008-01-30 03:21:38 by: fayyaz.
to see databases
Comment posted on 2007-12-21 15:29:59 by: tek leng.
I want to learn more with database that conect with Access
Comment posted on 2007-12-14 18:10:32 by: vijay.
very usefull.

i need for some more example with instruction.
How to find the particular record in datagrid using oledb connection and display record in controls

Comment posted on 2007-12-10 10:06:42 by: vani.
hi
tell me use of .net application

Comment posted on 2007-10-19 05:41:17 by: Yogesh Rishipathak.
Hi firstly thank for doing this nice work. ie very helpful for us. Actually i have one proble. Iam doing project in vb.net but i want to use database which is on my webserver.can we use web database in vb.net application?if yes then please give me some hint.ok iam weaiting...

Comment posted on 2007-09-24 14:41:02 by: Rick.
I found this sample very useful. I am just learning VB.NET and it is hard to find sample applications that focus on the basics to get you up and running.
Comment posted on 2007-08-24 18:46:47 by: Nabi.
in the form there are 100 textboxs. How to clear the data in textboxs in simple codeing
Comment posted on 2007-08-15 07:12:20 by: loganathan.
it is very useful
Comment posted on 2007-08-09 07:03:05 by: roshan.
how to connect one website to other in asp and their fields
Comment posted on 2007-07-18 08:30:46 by: santy.
Database program
Comment posted on 2007-07-14 17:10:27 by: Jay.
Thank You very much - very useful
Comment posted on 2007-07-14 01:28:39 by: yjgcshyb.
qqaeqxyk http://icrusoom.com iziadwlq qsiciykq
Comment posted on 2007-07-14 01:23:53 by: eafizxyq.
kvfnnxdm http://arlobvzz.com rgngsclg edfpuhxs
Comment posted on 2007-07-14 01:20:52 by: eafeakyg.
aboemcav http://rvshyhit.com qlvxsjff nilgjmaz
Comment posted on 2007-07-14 01:16:49 by: ataykgbt.
lmsrnfta http://goinchmj.com zaoiahwn rtmhksqi
Comment posted on 2007-07-14 01:15:46 by: jfhwfrel.
jcsgntqh http://lhztjmkt.com rwfbdkkf reezikoz
Comment posted on 2007-07-12 04:57:09 by: Bob.
I dont even know how ur code works but i played around with it enuff to make it work and i can not thank you enough because I have made several apps for an inventory managment for my company to keep track of our stock and I have slowly learned how to refine it a bit to my needs. Again I would be a step 0 scratching my head if it was not for this great sample code! THANK YOU!
Comment posted on 2007-03-27 07:33:39 by: Ann.
Thank you for the great introduction to database connection using .Net.

It was so helpful for a new vb.net explorer like me.

Comment posted on 2007-03-13 23:21:30 by: alexis.
This sample is really great.
Can you provide the source for your same data access DLL behind a web application.
thanks

Comment posted on 2007-01-31 13:44:42 by: gowri.
for updation(insert, select,delete) and navigation(first,next,previous,last) i need simple program. if i click the button these things should happen. i need like that program but without using databinding.
Comment posted on 2007-01-31 13:31:19 by: gowri.
for updation (insert, delete, select,edit) and navigation(first,next,previous,last) need a simple program without using databinding. just code is necessary...
Comment posted on 2007-01-26 12:42:17 by: mido007.
thank you a looooooooooooooooooooooooooooooooot

Comment posted on 2006-06-22 16:42:15 by: Gil.
Thanks for the great intro to database use in .NET --- can you provide the source for your "same data access DLL behind a web application" --- it would really help me understand how to get access to a database using web pages.

Thanks

You are welcome to comment on this page. For your guidance, HTML is not supported and URLs will be displayed as plain text. Add your comment here:

Your name: 

Your email (optional - will not be displayed or made public):

Type this code:    

Your comment