Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub Form9_Load(sender As Object, e As EventArgs) Handles MyBase.Load
- 'This should work and can't find why it doesn't
- NoMovies.Visible = False
- Result.Visible = False
- Dim query As String
- Dim ds As New DataSet
- MysqlConn = New MySqlConnection
- 'another query and a two table join
- MysqlConn.ConnectionString = "server=mysql.scss.tcd.ie;userid=murpha83;password=gh8ht6789;database=murpha83_db"
- MysqlConn.Open()
- query = "SELECT movie_name from movie2 Where movie_id=" & _
- "(SELECT movie_id from rental where client_username= @name AND start_date<= @date AND return_date>= @date"
- Using cmd = New MySqlCommand(query, MysqlConn)
- cmd.Parameters.AddWithValue("@name", currentUser)
- cmd.Parameters.AddWithValue("@date", DateTime.Now)
- Dim da = New MySqlDataAdapter(cmd).Fill(ds)
- Result.DataSource = ds.Tables(0)
- If ds.Tables.Count = 0 Then
- Result.Visible = False
- NoMovies.Visible = True
- End If
- End Using
- MysqlConn.Close()
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement