Displaying Image from SQL Server on Mobile Web Form

Hi,

I'm new to mobile web development and need some kick start on  "Displaying Image from SQL Server on Mobile Web Form".... Please help me out.

 Thanks 

 

 

0
rayben
12/5/2007 3:32:04 AM
asp.net.mobile_devices 3052 articles. 0 followers. Follow

1 Replies
825 Views

Similar Articles

[PageSpeed] 42

Hi,

 I have code which retrieves the images from sql server and displays it on the mobile web form. Hope this helps.

   byte[] data = new byte[0];
  SqlConnection conn = null;
       string doxtopDbConn = ConfigurationManager.AppSettings["doxtopDbConn"];    
        try
        {
            conn = new SqlConnection(doxtopDbConn);
            conn.Open();
            SqlCommand command = new SqlCommand();
            command.Connection = conn;
            command.CommandText = string.Format("select [ATTACHMENT] FROM [HDS_FILES] where [DOC_UNID]='{0}' and [ATTACHMENT_NAME]='{1}'", docUnid, attachmentName); // for me, I have the attachment in the sql server, here im retrieving it with the given Id and attachment name.


            data = (byte[])(command.ExecuteScalar());
        }

        catch (Exception ex)
        { }
        finally
        {
            if (conn != null && conn.State != ConnectionState.Closed) conn.Close();
        }
          Response.ContentType = "image/png";
          Response.BinaryWrite(data);
          Response.Flush();
        Response.Close();

 

Bye

Aruna 

0
arunagottimukkala
12/7/2007 9:59:21 AM
Reply:

Similar Artilces:

How to display SQL Server Image column in a Image control in a web formview??
I have a SQL Server 2005 table with a column called WBTImage with a data type as image.  The images were already loaded into the table using a MSAccess program. I want to display the WBTImage column in a asp image control (imgTrain) on a web form.  There is no data binding property for the image column.  I have looked at many posts across many forumns and all of the solutions do not appear to work.  Some used the system.drawing,image.fromstream, some used binary.write, one showed a windows form with a data binding that I could not find and the other used a memorystream...

display images from SQL Server image across intranet using ado.net filestream object
folks  i recently attended an MCPD boot camp where they taught me to access and store images using SQL Server and the filestream object.  Previously i had (sensibly) used a file server and impersonation to copy files. Uploading works fine.  Viewing works fine in debug so i rolled out an app in my work where the pics are uploaded and viewed across the intranet. to my horror i realised (too late!) that whilst it works fine in debug, it does not work when published. now no one but me can access these pics and it is a night mare.  the only documentation i have found ...

Display Images onto web Application through SQL Server
Having trouble displaying images on the actually webpage which is connecting to the SQL Database. The database stores the link to the image but i cant seem to display the image onto the page....can anyone help the web app is written in ASP.NET C# I assume you're pulling the link from the database and putting it into an image tag somehow in your HTML???? Does the rest of the page display? If so, view source and see what you have for the URL of the image tag and that it's formatted correctly. It's a pretty straightforward deal if it's just the link you're storing. in the db The ima...

How to display SQL Server Error Message on Web Form
I have following Stored Procedure ... How do I display Error Message Return by Stored Procedure ?? CREATE PROCEDURE [AddNewUserDetails] ( @UserName nvarchar(30), @Passcode nvarchar(10), @FName nvarchar(30), @LName nvarchar(30), @UserRoleID int, @AccStatus nvarchar(50) ) AS IF EXISTS ( SELECT 'TRUE' FROM UserDetails where logname = @UserName) BEGIN -- Notify user about duplicate username SELECT 'Username already exists' END ELSE BEGIN -- Username doesn't exists in database, add it and notify admin SELECT 'Record Added' DECLARE @userid...

Mobile Search Web Form to display image from database
Hello, I'm am looking to create a mobile web form which is accessed from a blackberry using a web browser which uses 2 text boxes to enter an individuals first or last name and when the submit button is pressed the individuals image displays from databse. Am I in the right place? Can anyone help? Hello, you can use the Image Control to display images. The image url depends on where your images are stored. If they are stored in the database you have to find a solution for this scenario (cf.: http://www.google.de/search?hl=de&q=ASP.NET+image+database&meta=). If they are sto...

Backcolor to mobile:link in mobile web form in mobile .net site
Hello every one  How to set back ground color to mobile: link in mobile web formI used backcolor property but doesn't work. Help me.Thank you.. ...

Display sql server image in image control
I am trying to display an image selected from an sqlserver image field in an asp image control.  I am not getting a result, no image being displayed.  Debug shows that there is data in the field so I think my problem is after the select statement.  I have listed the c# code as well at the markup.  Thanks for any help you can give me.public System.Drawing.Image RetrieveImage() {System.Drawing.Image image = null;SqlConnection cn = new SqlConnection(ConfigurationManager.ConnectionStrings["FoodService2005ConnectionString"].ConnectionString); {SqlCommand cmd = cn...

Where to order the table values displayed in a web form object? In Sql Server or in the Application?
Hi, I have a table in my database with several car types, and the order I want for that table is: Car_typeA_1 Car_typeA_2 Car_typeA_3 Car_typeA_4 Other_Cars_typeA Car_typeB_1 Car_typeB_2 Car_typeB_3 Other_Cars_typeB Car_typeC_1 Car_typeC_2 Car_typeC_3 Car_typeC_4 Car_typeC_5 Other_Cars_typeC .... This table is more or less always the same, but from time to time I want to add a new car type, for instance; Car_typeA_5, but this new type must be located under the last register, in the example under ‘Other_Cars_typeC’. So, now the order i...

Web forms and mobile web forms
Hey everyone, I am looking to develope a web site that depending on the device connecting to it, it will display a certain page. In this case im looking to create a web and wap version of the same project. I have the Web forms version finished using ASP.NET and C# and I am wondering how to create the mobile web form and incorporate it in the project. In the project folder, can I just add a mobile web??? But what about displaying device specific pages?? Cheers -Dudach Yes, you can add mobile web forms and controls to your Web Application project. No problem. For device/br...

display image in Gridview from sql image in .Net 2005
Hi all, I need to Display the Image directly from SQL Database in the GridView as Thumnails. This i can do in .Net 2003 with Help of ItemDatabound Event and Template Column. But in the .Net 2005 there no ItemDatabound event in GridView. For Example I need to Show it like this:  Help Me ASAP.Tamil See :http://www.beansoftware.com/ASP.NET-Tutorials/Images-Database.aspxHope this helps. Vikram.S, DeveloperDiscountASP.NETInnovative ASP.NET Hosting & SQL Hosting Thanks a lot Sharma. It was very useful.  Tamil...

How to save image in sql server and display that image in datagrid??
Hay Friend's Can u plese send me the way how to save image in sql server and display that images in datagrid or other control also like Image control or Image control Button?? Plese send the coding in C#.  Thank's Amit try this link...it display image in data grid... http://www.odetocode.com/Articles/172.aspx and for further reference you can refer http://forums.asp.net/p/1122135/1754824.aspx#1754824  RegardsAmit Hi amit, thanks for ur link but I m not fully Satisfy.. so kindly Send me more solutions.. Thank's Amit Hi Amit, Thanks for ur Link,...

how to display image in the gridview. I have image name in the sql server table.
What am I supposed to do for displaying image in the gridview. What am I supposed to write in the aspx to display that secific image in the gridview from the database table. Thanking you in advance. Digish A D You can do this using BoundColumns in ASPX, Please find more details in the MSDN Link below http://msdn.microsoft.com/en-us/library/aa479350.aspx Since your image name is in database so you can manipulate the following line dr("PictureURL") = ResolveUrl("~/DisplayingImages/Images/Blue hills.jpg") and assign the database value in PictureURL.  See th...

Difference between mobile web applications and standard web applications + mobile web forms in them ?
I have a series of existing sites, but I need to make a PPC version of them (there already is one, but it uses standard web forms). Since the code-behind looks a lot in the PC and in the PPC version, I'd like both versions to use the same files for the code. I'm left with 2 options : - either create a new mobile web application for each existing web application, and put all the code behind in .dlls which I'll call from each page ; - or, if this is possible (and I'd rather do it), simply add mobile web forms to the existing web applications and redirect at login to the appropriate ve...

SQL Server Reporting Services for SQL SERVER 2000 AND Visual Studio.NET 2005 .NET 2.0
Hi, Which version of SQl Server Reporting Services will work with SQL SERVER 2000 in pararrel with ASP.NET 2.0 (.NET 2.0 framework)?  Thanks, Azam HighOnCodingWanna get high! Hi, Okay I got the answer. Yes, we can use the SQL SERVER 2005 Reporting Services with SQL SERVER 2000. HighOnCodingWanna get high! ...

Web resources about - Displaying Image from SQL Server on Mobile Web Form - asp.net.mobile_devices

List of mammals displaying homosexual behavior - Wikipedia, the free encyclopedia
For these mammals, there is documented evidence of homosexual behavior of one or more of the following kinds: sexual behavior , courtship , affection ...

Facebook Displaying Page Insights On Page Admins’ Personal Pages?
Some Facebook page administrators are seeing modules on their personal pages displaying page insights ad, campaign , and like totals for pages ...

Facebook Displaying Unread Messages from Pages in a New Updates Module
Facebook is displaying a new “Updates” sidebar module which shows some users unread messages sent to them by Pages. Users will see the Updates ...

Don Lemon Holds Up Sign Displaying the N-Word, Uncensored, on Air CNN Live - YouTube
Don Lemon Holds Up Sign Displaying the N-Word, Uncensored, on Air Lemon held up a Confederate flag first before holding up the sign. He asked, ...

Hazelwood coal mine fire: Morwell residents displaying symptoms similar to cigarette smokers, expert ...
An expert says some locals near Victoria's Hazelwood mine fire have symptoms similar to cigarette smokers.

Police accused of displaying fake G20 weapons
Toronto's top police officer misled the public by displaying fake weapons used in a medieval-themed role-playing game to help justify their actions ...

No charges for U.S. host for displaying high-capacity magazine on TV
NBC television journalist David Gregory won't face charges for displaying a high-capacity ammunition magazine on his "Meet the Press" news program ...

Jays' Escobar suspended three games for displaying slur
Toronto Blue Jays shortstop Yunel Escobar has been suspended three games for displaying a homophobic slur on his eye-black during a game on Saturday. ...

Google Play Store now displaying age-based ratings
We reported back in May that Google was adding age-based ratings to all apps in the Play Store as determined by the International Age Rating ...

Apple displaying Ferraris & other cars at WWDC hinting at CarPlay announcements
... 2014 Filed under: AAPL Company , iOS Continue reading more about AAPL Company and iOS at 9to5Mac . What do you think? Discuss "Apple displaying ...

Resources last updated: 1/23/2016 12:14:31 PM