Showing posts with label image. Show all posts
Showing posts with label image. Show all posts

Saturday, February 25, 2012

adding image to the webpage

hi

i am a beginner of asp and want to add an image to the page ?

would u guide me?

See the thread here:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1769613&SiteID=1

Jens K. Suessmeyer.

http://www.sqlserver2005.de

adding image dynamically to crystal report

hello
please could anyone help me to insert an image into crystal report if I saved the link in the database . I tried to change the type to "ole object" it works, but i don't have to change the type in my project.If you are using SQL Server then search for TextCopy.exe, you will get lot of related code.|||it is very easy in the Crystal 11.5 and later.

Place the OLE object -> Bitmap Image on the report. Right click the OLE Object -> Format Graphics -> Picture (tab) -> Graphic Location.

And enter the URL where the image file is placed.
Now the crystal Report will show the image on runtime by picking from the location mentioned.|||i'm using v8.0 , i'll download the XI version and I'll try

Sunday, February 12, 2012

adding an image to SQL

Looking for any help someone can offer on adding an image to SQL.

Working on what will hopefully be quite a big site and the user will be asked for some details, one of which will be an image (jpg, gif or bmp).

Rather than add the image to a folder on the server,?a?folder which could end up being quite large, I was hoping someone could give me some help, suggestions?or even point me towards a tutorial on how to store the image in an SQL database.

Any helps appreciated, thanks :)never mind, read some articles about why this isn't a good idea :)

just going to store the images in a folder|||Here is an article from msdn if someone still interests:Read and Write BLOB Data by Using ADO.NET Through ASP.NET

Adding an image to details view

I'm some what of a noob when it comes to ASP.NET 2.0 and SQL Server 2005 Express editions, so please bare with me.

I have created a basic database that is only one table. One of the fields is LogPicture with type of image.

I just want to go into the table and manually place a picture in the table, but it seems like I can not get the format down. I have tried including the picture I want into the project, but no dice. I've also tried putting the physical pathname (on the harddrive) and the web address of this field in there. Suggestions please?

ss*bump*

I am basically just looking for the syntax of how an image is inserted. Anyone..... please?|||

Image data is stored as binary stream in SQL Server. You can either use bcp.exe utility to insert BLOB data (image/text/ntext) or write your own code to input binary stream to the column. You can take a look at this post:

http://forums.asp.net/thread/1257487.aspx

And here is a article that introduces bcp utility:

http://msdn2.microsoft.com/en-us/library/ms162802.aspx

adding an image to a database table

Hi,

I am using SQL Server 2005. I have a table in my database which has two columns :

ImageId (Type: nvarchar (50))

Image (Type: image)

I need to store images in this table. How can I do this?

Depends on what do you use for writing client applications.|||

Example using VB 6.0, SQL Server 2005 and SQLNCLI as the provider.

Private Sub Main()
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim mystream As New ADODB.Stream

cn.CursorLocation = adUseClient
cn.Open "Provider=SQLNCLI;Data Source=.;Integrated Security=SSPI;"

mystream.Type = adTypeBinary
rs.Open "select * from imagetable where imagetable.ImageId=''", cn, adOpenStatic, adLockOptimistic
rs.AddNew
mystream.Open
mystream.LoadFromFile "c:\\test.jpg"
rs!ImageId = "image1"
rs!MyImage = mystream.Read
rs.Update
mystream.Close
rs.Close

cn.Close

End Sub

adding an image to a database table

Hi,

I am using SQL Server 2005. I have a table in my database which has two columns :

ImageId (Type: nvarchar (50))

Image (Type: image)

I need to store images in this table. How can I do this?

Depends on what do you use for writing client applications.|||

Example using VB 6.0, SQL Server 2005 and SQLNCLI as the provider.

Private Sub Main()
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim mystream As New ADODB.Stream

cn.CursorLocation = adUseClient
cn.Open "Provider=SQLNCLI;Data Source=.;Integrated Security=SSPI;"

mystream.Type = adTypeBinary
rs.Open "select * from imagetable where imagetable.ImageId=''", cn, adOpenStatic, adLockOptimistic
rs.AddNew
mystream.Open
mystream.LoadFromFile "c:\\test.jpg"
rs!ImageId = "image1"
rs!MyImage = mystream.Read
rs.Update
mystream.Close
rs.Close

cn.Close

End Sub

Adding an Image

Hello:

I have an Image control on my report .

I have a Class for example :

public Class Class1

private _MyPic as System.Drawing.Image

public property MyPic as System.Drawing.Image

......

end

end

the Dataset Of My Report is Class1.

i Drop an Image from toolbar in My Report and set Source to Database and set value to =Fields!MyPic.value

befor showing the Report i Create an object from Class1 and fill MyPic and set DataSet of Report to that Object

but i see a Red X instead of Picture

please help me

thanks alot

Setting the image source = Database is correct, but you have to convert the System.Drawing.Image into the actual image data as byte array.

Here is a C# code snippet to convert an image into a byte[] using a MemoryStream:

// save image to byte[]
System.IO.MemoryStream renderedImage = new MemoryStream();
myImage.Save(renderedImage);
renderedImage.Position = 0;
return renderedImage.ToArray();

-- Robert

Adding an image

Hi, I have a pretty simple question. I have a table, and I need one of my columns to be an 'image' column. I've set the column type to 'image', but now I don't know how to actually add images to that column. Can someone please help me.

Hello, SuperNove289 (wow! :)

Simple question- simple answer:

Assume, you have this Table_1 with SelectedImages and Path fields.

CREATE TABLE [dbo].[Table_1](

[SelectedImages] [image] NOT NULL,

[Path] [ntext] NOT NULL

)

to add an image, do this:

INSERT INTO [testing].[dbo].[Table_1]

([SelectedImages]

,[Path])

VALUES

('D:\desktop\05022006\free_chart1.gif' ,'D:\desktop\05022006\free_chart1.gif' )

So, then you will do this :

SELECT [SelectedImages]

,[Path]

FROM [testing].[dbo].[Table_1]

You will get something like this:( <Binary data>)

SelectedImages Path

- -

0x443A5C6465736B746F705C30353032323030365C667265655F6368617274312E676966 D:\desktop\05022006\free_chart1.gif

(1 row(s) affected)

Probably the next question will be is how to see the entered image J

|||

Hi SuperNova,

As suggested you may definately add images to your database but this is not the best practise you should avoid such BLOB operation refer http://research.microsoft.com/research/pubs/view.aspx?msr_tr_id=MSR-TR-2006-45 research done at MS, instead store file path of documents and handle it from Front End Applciation.

HTH

Hemantgiri S. Goswami

|||That depends on your coding language how to upload the data to the server, for C#, see this sample which is quite simple.

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=622943&SiteID=1

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de