Hey im trying to fill a ListView object with data selected from an SQL SELECT command
but im not sure how to do it
here is my code i have attempted:
im not sure but do u have to declare a datareader then initiate a while loopCode:Dim mySqlCommand As sqlcommand = New SqlCommand mySqlCommand.CommandType = CommandType.Text mySqlCommand.Connection = SqlConnection1 mySqlCommand.CommandType = CommandType.Text mySqlCommand.CommandText = "SELECT showID, showTitle, showOwner FROM shows WHERE showOwner LIKE @showOwner;" mySqlCommand.Parameters.Add(New SqlParameter("@showOwner", SqlDbType.VarChar)) mySqlCommand.Parameters("@showOwner").Value = System.Environment.UserName Try mySqlCommand.Connection.Open() Catch ex As Exception MessageBox.Show(ex.Message) End Try mySqlCommand.Connection.Close()
thanks




Reply With Quote