Click here to Skip to main content
15,887,417 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Put task in the background Pin
F-ES Sitecore9-Sep-15 23:35
professionalF-ES Sitecore9-Sep-15 23:35 
QuestionIs it possible to store CheckBoxList values into separate database column names? Pin
samflex9-Sep-15 4:54
samflex9-Sep-15 4:54 
AnswerRe: Is it possible to store CheckBoxList values into separate database column names? Pin
David Mujica9-Sep-15 5:18
David Mujica9-Sep-15 5:18 
GeneralRe: Is it possible to store CheckBoxList values into separate database column names? Pin
samflex9-Sep-15 5:27
samflex9-Sep-15 5:27 
GeneralRe: Is it possible to store CheckBoxList values into separate database column names? Pin
Richard Deeming14-Sep-15 3:31
mveRichard Deeming14-Sep-15 3:31 
GeneralRe: Is it possible to store CheckBoxList values into separate database column names?(SOLVED) Pin
samflex22-Sep-15 15:59
samflex22-Sep-15 15:59 
AnswerRe: Is it possible to store CheckBoxList values into separate database column names? Pin
aarif moh shaikh10-Sep-15 18:28
professionalaarif moh shaikh10-Sep-15 18:28 
QuestionTo Feach images from database where images are in varbinary(max) type Pin
Member 118785418-Sep-15 19:36
Member 118785418-Sep-15 19:36 
i Want to display an multiple images using datalist

asp Code:
XML
 <asp:DataList ID="DataList1" runat="server" RepeatColumns="3" RepeatDirection="Horizontal"
   Width="100%" BorderColor="#336699" BorderStyle="Solid" BorderWidth="2px">

   <ItemTemplate>
       <asp:Label ID="lblsStatus" runat="server"></asp:Label>
      <asp:Label ID="Label1" runat="server" Text='<%# Eval("imgname1") %>' Font-Bold="True"
         Font-Size="10pt" ForeColor="#336699" Width="100%" />
      <br />
      <asp:Image ID="imgsss" runat="server" />
   </ItemTemplate>
   <ItemStyle HorizontalAlign="Center" VerticalAlign="Top"  />
</asp:DataList>



c#:
C#
protected void Page_Load(object sender, EventArgs e)
   {

       FetchImage();
   }

   private object GetData(string query)
   {
       DataTable dt = new DataTable();
       string constr = ConfigurationManager.ConnectionStrings["constr"].ConnectionString;
       using (SqlConnection con = new SqlConnection(constr))
       {
           using (SqlCommand cmd = new SqlCommand(query))
           {
               using (SqlDataAdapter sda = new SqlDataAdapter())
               {
                   cmd.CommandType = CommandType.Text;
                   cmd.Connection = con;
                   sda.SelectCommand = cmd;
                   sda.Fill(dt);
               }
           }
           return dt;
       }
   }
   protected void FetchImage()
   {

       string id = "1";
       imgss.Visible = id != "0";
       if (id != "0")
       {

           byte[] bytes = (byte[])GetData("SELECT imgdata1 FROM Tbl_images WHERE id =" + id);
           string base64String = Convert.ToBase64String(bytes, 0, bytes.Length);
           imgss.ImageUrl = "imgdata1:image/png;base64," + base64String;
       }
   }

AnswerRe: To Feach images from database where images are in varbinary(max) type Pin
Kornfeld Eliyahu Peter8-Sep-15 21:14
professionalKornfeld Eliyahu Peter8-Sep-15 21:14 
GeneralRe: To Feach images from database where images are in varbinary(max) type Pin
Member 118785419-Sep-15 0:32
Member 118785419-Sep-15 0:32 
GeneralRe: To Feach images from database where images are in varbinary(max) type Pin
Kornfeld Eliyahu Peter9-Sep-15 1:05
professionalKornfeld Eliyahu Peter9-Sep-15 1:05 
GeneralRe: To Feach images from database where images are in varbinary(max) type Pin
Richard MacCutchan9-Sep-15 1:08
mveRichard MacCutchan9-Sep-15 1:08 
AnswerRe: To Feach images from database where images are in varbinary(max) type Pin
aarif moh shaikh10-Sep-15 18:34
professionalaarif moh shaikh10-Sep-15 18:34 
SuggestionRe: To Feach images from database where images are in varbinary(max) type Pin
Richard Deeming14-Sep-15 3:24
mveRichard Deeming14-Sep-15 3:24 
QuestionGridView Pin
Member 111616258-Sep-15 18:38
Member 111616258-Sep-15 18:38 
AnswerRe: GridView Pin
Member 977403910-Sep-15 3:47
Member 977403910-Sep-15 3:47 
QuestionLinqChatVB-Msg not seen whene entered Pin
baijuep7-Sep-15 15:11
baijuep7-Sep-15 15:11 
QuestionEMBED LIVE VIDEO IN asp.NET WEB Pin
baijuep7-Sep-15 15:06
baijuep7-Sep-15 15:06 
QuestionDate Time Picker Not appear? Pin
Member 118897997-Sep-15 1:43
professionalMember 118897997-Sep-15 1:43 
AnswerRe: Date Time Picker Not appear? Pin
F-ES Sitecore7-Sep-15 4:21
professionalF-ES Sitecore7-Sep-15 4:21 
GeneralRe: Date Time Picker Not appear? Pin
aarif moh shaikh10-Sep-15 18:37
professionalaarif moh shaikh10-Sep-15 18:37 
AnswerRe: Date Time Picker Not appear? Pin
Blikkies7-Sep-15 19:54
professionalBlikkies7-Sep-15 19:54 
QuestionGPS Tracking Software Pin
Amitk7655-Sep-15 4:52
Amitk7655-Sep-15 4:52 
AnswerRe: GPS Tracking Software Pin
Kornfeld Eliyahu Peter5-Sep-15 20:47
professionalKornfeld Eliyahu Peter5-Sep-15 20:47 
GeneralRe: GPS Tracking Software Pin
Manfred Rudolf Bihy7-Sep-15 5:29
professionalManfred Rudolf Bihy7-Sep-15 5:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.