.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Multiple images from database

Posted By:      Posted Date: September 13, 2010    Points: 0   Category :ASP.Net
Hi, I have what I hope is an easy question. I am building a report which will show some images of a site. Some sites may have 1 image stored in the database while others have more (the number varies). I can get the image control to show the first image but not the rest. Is there a way to get an image control to repeat (like rows in a table) depending on how many images there are? Thanks    

View Complete Post

More Related Resource Links

Multiple Images upload to SQL Database C# code help pls !



I have a web form where user can upload image and store to SQL database. (SQL tables has a relation like one title has multiple images fields).

Title: <asp:TextBox ID="txtTitle" runat="server" Width="300px"></asp:TextBox>

Image Name:<asp:TextBox ID="txtImage" runat="server" Width="200px"></asp:TextBox>

<asp:FileUpload ID="FileUpload1" runat="server" />
<asp:Button ID="btnSubmit" runat="server" Text="Submit Information" 
               onclick="btnSubmit_Click" />

aspx.cs code:

 protected void btnSubmit_Click(object sender, EventArgs e)
//to store image into sql database.
         string strImageName = txtImage.Text.ToString();      

                    if (FileUpload1.PostedFile != null &&
                    FileUpload1.PostedFile.FileName != "")
                           byte[] imageSize = new byte[FileUpload1.PostedFile.ContentLength];

Multiple database support with Entity Framework

One of the features introduced in Entity Framework is being database independent. Which mean each database provider can support Entity Framework by implementing its provider.

This feature allows you build applications independent from the underplaying database provider. In this post I'm going to show how to build an application that support multiple databases using same conceptual model made by Entity Framework.

Adding Multiple Columns and Rows in GridView without using a Database

This article describes on how to add multiple columns and rows in GridView without using a database. Basically the GridView will be populated with data based on the values entered in each TextBoxes on Button Click and retain the GridView data on post back.

Reading and Writing Images From a Windows Mobile Database using UltraLite 10(C#)

Periodically I get a request for information on how to read and write binary data to a database running on Windows Mobile. If you search the Internet you can typically find examples that are available on Windows Desktops or allow you to read and write to a local file system. The problem is that it can take a bit of work to get this code to work on Windows Mobile accessing a database.

Ultimately you might be asking, why would I want to store and image in a database? Well in an environment where you synchronizing data between a local mobile database and a consolidated (central) database this can be extremely useful. Imagine if an insurance adjuster went to an accident scene, took a picture of a damaged car, loaded it into his Windows Mobile database and then replicated that image up to the Insurance headquarters for approval. All of this could be done in a very short period of time when using images in the database. Another good example might be a doctor who was waiting for a patient chart to become available. If you could store the image in a database this chart could be sent down to the doctor's device once it became available.

For this article I am not going to get into how to synchronize the images to and from a remote and central database as this is typically fairly straightforward when using a data synchronization technologies like MobiLink

Store and Display Images from MS Access Database Using C#

There is only the difference of coding syntax to stream the binary data of image content type to upload it into MS Access Database using C#/VB in ASP.Net 2.0

Namespaces required:-
using System.Data.OleDb;

OleDb is used to connect the web site forms with MS Access Database using Microsoft.Jet.OLEDB.4.0

Exposing WCF Service for multiple clients with the feature of multiple database support

i have ceated a WCF service and hosted it properly. now i want to Exposing this Service for multiple clients with the feature of multiple database support.In this functionality how could i do the proper multiple database management. what i am doing now:1. i am taking database string from the client.2. Then setting the refference of above provided database to the all functions call.ISSUE: if the mulitple clients calling the service at the same time and both are giving different database string then the database string provided by the clients is overlapping.....

database design for multiple vendors

 I have constructed a simple database schema with one vendor.now i would like to add multiple vendors who can/may provide similar products. so i am looking for a design that lists products,there attributes and can be filtered on respective Product Sizes,Brand,Colour easily.    

Datareader: Set multiple random images into appropriate image field

Hi, first of all, sorry if my title isn confusing as i dont really sure the specify description regarding what i wan to do.   Now what i trying to do is, I getting 5 random images from the database, this is the code for me to get random 5 records from database: Dim command As New SqlCommand("SELECT TOP 5 Description,Image,ImageID FROM Properties ORDER BY ImageID", con)  and with the help of image handler to display it to 5 Images components i put in the page, lets say name it "Image1" to "Image5". Now the question is, how do i assign the 5 diff imageID into the 5 image components? Lets say i wan my Image1's imageID is 1, and Image2's imageID is 2. What im doing now is assigning all the same imageID to all 5 images. Below is how i assign the imageIDDim reader As SqlDataReader reader = command.ExecuteReader If reader.HasRows = True Then While reader.Read Image1.ImageUrl = "GetThumbnail.aspx?ImageID=" & reader("ImageID") & " " Image2.ImageUrl = "GetThumbnail.aspx?ImageID=" & reader("ImageID") & " " Image3.ImageUrl = "GetThumbnail.aspx?ImageID=" & reader("ImageID") & " " Image4.ImageUrl = "GetThumbnail.aspx

SQL Server database restore with multiple logicalfiles by using t-sql

Hi,   I have set of database backups created in the production sql server 2005. I need restore these backups into another sql server 2005 by using t-sql script(stored procedure). Each database will have different number of logical files in it. The physical location of the target server may be different for these logical files. I know that i should use WITH MOVE 'YourMDFLogicalName' TO 'D:DataYourMDFFile.mdf' clause. Now i want to know how would i put it in a t-script stored procedure such a way that it automatically identifies all the logical files and create a physical file on the target server. User will supply source of bakup file and target folder for mdf,ldf, etc files. Do i need to populate the sql query as string by looping through all the logical files? If so how would i execute the populated sql query as string ?  Mr Genius


the database result is as follows DATE     code   class1 class2  class3 1/8/10     M1     10       20     30     3/8/10     V2      20       30     10      1/8/10      H1      1           2      3         7/8/10     ! ! 8/8/10     !M2    5      5      5       3/8/10     B2      4      4     4       1/8/10     V1      3      7     3       THE OUTPUT SHOULD BE AS FOLLOWS:- DATE           M1                          M2           

Update Statement help from Multiple database

Hi I am having two separate datbase on same sever one datasbase name private from where i am executing my below query and other name is ODS Table name in Private=[A].[DimCapabilitySpecialty] Table name in ODS = [A].[CapabilitySpecialty]   both of them having column SpecialtyCd   i want to update the flag value of ODS table where there is particular specialitycd missing in source means table in private database   so for that i wrote below query   update A.DimCapabilitySpecialty set ActiveInd ='I' where SpecialtyCd !=[ODS].[A].[CapabilitySpecialty].[SpecialtyCd]   But it is giving me this error   Msg 4104, Level 16, State 1, Line 1 The multi-part identifier "ODS.CapabilitySpecialty.SpecialtyCd" could not be bound.

Insert multiple files to SQL Database in VB

My files are being inserted but the byte array is showing as a 0x0000... etc for every file after the first inserted file. The first inserted image is correct. The database is set up as an Image type. The problem exists in the code here. Thank you in advance! Dim uploads As HttpFileCollection uploads = HttpContext.Current.Request.FilesFor i As Integer = 0 To (uploads.Count - 1) If (uploads(i).ContentLength > 0) Then Dim c As String = System.IO.Path.GetFileName(uploads(i).FileName) 'Dim upload As HttpPostedFile = uploads(i) If Not fileUpEx.PostedFile Is Nothing And _ fileUpEx.PostedFile.ContentLength > 0 Then Try If CallingTab >= "" Then Call UploadImage(c, uploads(i).ContentLength, uploads(i).ContentType, uploads(i).InputStream, _ strUsername, intSiteID, intCompanyID, strDocumentType, CallingTab, NewVersionNumber) Else lblStatus.Text = "Document Not successfully uploaded to the database! Problem occured with the Calling Tab" End If Catch Exc As Exception Response.Write("Error: " & Exc.Message) End Try

Posting multiple images to one Image tool

I want to create a if statement which i select an area on a imagemap then the corresponding label discription will appear and corresponding image. The code if what i have so far    Protected Sub ImageMap1_Click(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.ImageMapEventArgs) Handles ImageMap1.Click        If e.PostBackValue = "ME" Then            Image1.ImageUrl = "F:\WebSite1\images\one.jpg" & label1.text="Me" <------- How do you join a label and image selection in one if statement i keep getting errors on this and image doesnt load also        ElseIf e.PostBackValue = "Car" Then            Label1.Text = "CAR" & Image1.ImageUrl = "F:\WebSite1\images\two.jpg"        ElseIf e.PostBackValue = "Mysister" Then            Label1.Text = "My sister" &Image1.ImageUrl = "F:\WebSite1\images\two.jpg"        Else            Label1.Text = ""        End If 

Multiple Data Files Per Database Not Allocating

We recently read that I/O performance can be increased by creating multiple data files for a database: "As a general guideline, create one data file for each CPU" So went ahead and did this, and restarted the SQL engine, but still it is writing all data to the first file "Production_data_1". We would assume after we restarted it would reallocate the data across all four data files. Currently, the other three data files have 1GB of space allocated, but the engine is not writing data to the other three files. How can we distribute the existing data across all four data files? See a screenshot we took at: http://www.ftoperations.net/screenshot.png

creation of multiple .aspx pages from database name


 hi ,
i am making an internal social networking application for my small organisation where i work  .i have a list of all employee  names in a mssql 2000 database that are the names of 5000 employees of the company  one by one arranged in rows in a single coloumn of a table . i have a folder ,i want to make  .aspx files/pages in that folder ,the file name should be same as names of the person in database coloumn.can any help me with codes to automatically make the .aspx pages with the same names as it is in database coloumn.(note that folder will not take any duplicate values(name will not be repeated)) .i am making application using asp.net 2.0.file will be automatically created in the folder as soon as new name is entered in database.its very difficult to make 5000 aspx page with each employee name and it will be difficult to make new pages again and again after new employees names are entered.so i want that files will be automatically created after employee names are registered.  

thanks in advance.

hoping for help for someone.

Database across multiple drives


I have database spread across a few drives as below table.

The issue is that shouldnt SQL be intelligent enough to fill each drive equally??? I have my Netwrok drives being filled unevenly.

Logical Name     Type    FileGroup        Initial size   Autogrwoth                              Path
Database_Data     Data     Primary             86               By 10%, unrestricted growth     M:\MDF file
Database_Data_1  Data     Data File Gp1     30632         By 10%, unrestricted growth     N:\NDF file
Database_Data_2  Data     Data File Gp1     8725           By 10%, unrestricted growth     O:\MDF file
Database_Data_3  Data     Data File Gp1 &

Database snapshots do not work well with databases having multiple log files


It appears there is a bug in the implementation of database snapshots.

If you create a snapshot on a database with multiple log files:

Then restore from the snapshot:

then all of you log files, but one will disappear. As a result the backup command will fail with the following message:
Msg 3636, Level 16, State 2, Line 1
An error occurred while processing 'BackupMetadata' metadata for database id 12 file id 10.
Msg 3046, Level 16, State 2, Line 1
Inconsistent metadata has been encountered. The on
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend