div {
background: url({url});
width: 200px;
height: 200px;
background-size: cover;
}
But if you are using img tag, you may useobject-fit: cover;
Example:
img {
width: 200px;
height: 200px;
object-fit: cover;
}
div {
background: url({url});
width: 200px;
height: 200px;
background-size: cover;
}
But if you are using img tag, you may useobject-fit: cover;
img {
width: 200px;
height: 200px;
object-fit: cover;
}
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
'Specify the datasource
Dim CONNECTION_STRING As String = "Data Source=LOCALHOST;Initial Catalog=DB_NAME; Integrated Security=True"
Dim conn As SqlConnection = New SqlConnection(CONNECTION_STRING)
'Specify the SELECT query
Dim cmd As SqlCommand = New SqlCommand("SELECT ProductName FROM ProductTable", conn)
'Open the Database
conn.Open()
Dim sdr As SqlDataReader = cmd.ExecuteReader
'Do the adding through looping
While sdr.Read()
If Not sdr("ProductName").ToString = String.Empty Then product.Items.Add(sdr.Item("ProductName").ToString)
End While
'Close the Database
conn.Close()
End Sub