Hey there....! PLEASE HELP! This is the first time I use SQL to read in data! I want to retrieve the entire SQL file into an array. If possible, I'd like ti to work for both SQL 2005 and 2008. Is that possible for a SQL novice! Imports System.Data.SQLClient Private Sub GetDataFromSQLFile () Dim DR As SQLDataReader Dim N As String = Nothing Dim DQ As String = "SELECT * FROM StockStatus ORDER BY StockSymbol" Dim DCommand As New SQLCommand (DQ, SQLConnection1) Dim R(15) As String Dim Index As Integer = 0 SQLConnection1.Open() DR = DCommand.ExecuteReader While DR.Read() For Index = 1 to 15 R(Index) = DR.GetString(Index) Next Index End While DR.Close() SQLConnection1.Close Exit Sub <--- The book I use has this line. Why is it here? End Sub God Bless JEP_Dude
Yeah, the code will work with both version of SQL. I don't think you need the Exit Sub line of code there as it does not make any sense as it is placed at the end of the procedure.