What is wrong with my code? why the images not shown? i need to assign that method at the asp:image ? if yes - how ?
public int bla()
{
SqlConnection connection = new SqlConnection("Data Source=tcp:**.****;Initial Catalog=*****;User ID=****;Password=****;Integrated Security=False;");
string commandtext = "SELECT Minbuy FROM items";
SqlCommand command = new SqlCommand(commandtext, connection);
connection.Open();
int itemsMin = (int)command.ExecuteScalar();
string commandtext2 = "SELECT purchaseid FROM purchase";
SqlCommand command2 = new SqlCommand(commandtext2, connection);
int purchase = (int)command2.ExecuteScalar();
if (itemsMin >= purchase)
image3.Visible = true;
else
image4.Visible = true;
connection.Close();
return itemsMin;
}
the images at the aspx file:
<asp:Image ID="image3" runat="server" Visible="false" ImageUrl="~/images/V.png" />
<asp:Image ID="image4" runat="server" Visible="false" ImageUrl="~/images/X.png" />