PC Review


Reply
Thread Tools Rate Thread

How do I do this VB6 ADO code in ADO .NET

 
 
Mark Worsnop
Guest
Posts: n/a
 
      2nd Nov 2008
Below is a short simple ADO in VB6. I have been messing with this most of
the day trying to do the same thing in VB .NET ADO.NET. Can anyone give me a
clue where to look next?

I think I got the connection figured out, but I usually connect once at the
beginning of the program globally, but this seems to only let me declare the
Connection in the class I am in. Sorry for all the dumb questions, still
learning.

THANK YOU!

BaseConnStr = "Provider=MSDataShape.1;Persist Security Info=True;Data
Provider=SQLOLEDB.1;Trusted_Connection=yes ;Data Source=xx;User
ID=xx;Password=xx;Initial Catalog=xx"


CN.Open BaseConnStr

RS.Open "Select top 10 name from customer ", CN, adOpenStatic, adLockReadOnly

While Not RS.EOF

Text1.Text = Text1.Text & RS.Fields("name").Value & vbCrLf

RS.MoveNext

Wend

RS.Close
Set RS = Nothing
 
Reply With Quote
 
 
 
 
Mark Worsnop
Guest
Posts: n/a
 
      2nd Nov 2008
I got the book by William R. Vaughn
ADO and ADO.NET Examples and Best Practices for VB Developers.

Williams recommended his book in another post, and I have been up all night
reading it. GREAT BOOK. For all you newbies (like me) it sure has helped!

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Linq to XML--Are there code examples that make Linq as easy as SQL? Or how can I convert ths simple pseudo code into real code? Reece Microsoft C# .NET 4 10th Dec 2008 03:13 AM
ATI Radeon Drivers - Code 43, Code 37 & Code 10 =?Utf-8?B?SmFrZQ==?= Windows Vista Hardware 14 29th Aug 2006 05:50 AM
ATI Display Drivers - Code 43, Code 37, Code 10 Jake Windows Vista Hardware 2 8th Jul 2006 04:00 PM
what is the difference between code inside a <script> tag and code in the code-behind file? keithb Microsoft ASP .NET 1 29th Mar 2006 02:00 AM
[New] Zipoid - ZIP Code, City Name and Area Code Lookup - Zip Code to Zip Code Distance Calculation Mel Freeware 0 22nd Jul 2005 04:13 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:46 PM.