Xtreme Visual Basic Talk

Xtreme Visual Basic Talk (http://www.xtremevbtalk.com/)
-   .NET Database and Reporting (http://www.xtremevbtalk.com/-net-database-and-reporting/)
-   -   ADO.net vs ADO (http://www.xtremevbtalk.com/-net-database-and-reporting/328205-ado-net-vs-ado.html)

JerryEng 05-13-2016 03:32 PM

ADO.net vs ADO
 
I have an app that was developed in VB6 using ADO to get data from Access. I would like to to update the app using VB 2015. I'm having some trouble getting a handle on ADO.net. Could someone give a code snippet that would mimic the following VB6 code to put data in a recordset?

Public adoconnection1 As New ADODB.Connection
Public rs As New ADODB.Recordset
Private Sub Form_Load()

adoconnection1.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source= C:\EC1\EC1Data.mdb"

rs.CursorLocation = adUseClient
rs.Open "Select * from Jobs Where JobNumber = 10243", adoconnection1, adOpenDynamic

Text1.Text = rs!JobName

rs.close

If I just have something to get started, I can usually figure it out from there. BTW, I'm not a developer, I'm an electrical engineer and the app is something 5 or 6 of us use in house. The app makes several calls to get data from the DB and update it but the majority of the calls return one row. The biggest call might return 75 rows but it displays them in a grid.

Dennis DVR 07-04-2016 05:55 AM

Check this ADO.NET Code Examples from MSDN

Quote:

Originally Posted by JerryEng (Post 1409803)
BTW, I'm not a developer, I'm an electrical engineer]

Good Luck then I hope that above link would be helpful to you ;)


All times are GMT -6. The time now is 01:05 PM.

Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Optimisation provided by DragonByte SEO v2.0.15 (Lite) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
All site content is protected by the Digital Millenium Act of 1998. Copyright©2001-2011 MAS Media Inc. and Extreme Visual Basic Forum. All rights reserved.
You may not copy or reproduce any portion of this site without written consent.