<asp:Image ID="image1" runat="server" ImageUrl="ImgLnk" Height="100px" Width="100px" />
string strConnectionString = ConfigurationManager.ConnectionStrings[""].ConnectionString; string strSelect = "SELECT ImgLnk FROM Business WHERE ImgLnk = @ImgLnk"; SqlConnection sqlCon = new SqlConnection(); sqlCon.ConnectionString = strConnectionString; SqlCommand cmdCustomerDetails = new SqlCommand(); cmdCustomerDetails.Connection = sqlCon; cmdCustomerDetails.CommandType = System.Data.CommandType.Text; cmdCustomerDetails.CommandText = strSelect; cmdCustomerDetails.Parameters.AddWithValue("@ImgLnk", strImgLnk); sqlCon.Open(); //Create DataReader to read the record SqlDataReader dReader = cmdCustomerDetails.ExecuteReader(); GridView2.DataSource = dReader; GridView2.DataBind(); while (dReader.Read()) { image1.ImageUrl = HttpUtility.UrlEncode(dReader["ImgLnk"].ToString()); } sqlCon.Close();
string strSelect = "SELECT ImgLnk FROM Business WHERE ImgLnk = @ImgLnk";
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)