Problem In Saving Image ????

Mar 27, 2008

Hi
i am using textcopy to store image (named as mypic.jpg) in image column.
But i am getting error :
text or image pointer and timestamp retrieval failed

I guess this is bacause of image size ...
The default image column length is 16. I tried changing it but it's not changing and Books Online shows that the image column can store max upto 2 GB.

I just want to know also how to change that size to say 100kb?????


thanx in advance

San

View 3 Replies


ADVERTISEMENT

Saving Image To Database

Oct 24, 2006

Using: Compact Framework 1.0 and SQL Server CE 2.0

i want to save an image to my sql server ce 2.0 database on the device.
In the Compact Framework 1.0 the Image class does not have .FromStream method, and the PictureBox class does not .Save method.

Has anyone done this before in SQL CE 2.0 and CF1.0


Thanks

View 1 Replies View Related

Uploading An Image And Saving Itz Path In Sql !!!! (plz)

Nov 1, 2006

well, i'm using vs2005 and sql server 2000.i've got this snippet for uploading an image and creating itz thumbnail and also saving the thumbnail and the original image in a folder.but i also want the path of the image and the thumbnail to be stored in sql 2000 database, instead of saving the images in sql.can some one plz provide me the way.thanx in advance.-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click' Initialize variablesDim sSavePath As StringDim sThumbExtension As StringDim intThumbWidth As IntegerDim intThumbHeight As Integer' Set constant valuessSavePath = ".Image"sThumbExtension = "_thumb"intThumbWidth = 160intThumbHeight = 120' If file field isn’t emptyIf Not fileUpEx.PostedFile Is Nothing Then' Check file size (mustn’t be 0)Dim myFile As HttpPostedFile = fileUpEx.PostedFileDim nFileLen As Integer = myFile.ContentLengthIf nFileLen = 0 ThenlblStatus.Text = "No file was uploaded."ReturnEnd If' Check file extension (It must be .JPG)If System.IO.Path.GetExtension(myFile.FileName).ToLower() = ".jpg" Then' Read file into a data streamDim myData() As Byte = New Byte(nFileLen) {}myFile.InputStream.Read(myData, 0, nFileLen)' Make sure a duplicate file doesn’t exist. If it does, keep on appending an ' incremental numeric until it is uniqueDim sFilename As String = System.IO.Path.GetFileName(myFile.FileName)Dim file_append As Integer = 0While System.IO.File.Exists(Server.MapPath(sSavePath + sFilename))file_append = file_append + 1sFilename = System.IO.Path.GetFileNameWithoutExtension(myFile.FileName) + file_append.ToString() + ".jpg"End While' Save the stream to diskDim NewFile As System.IO.FileStream = New System.IO.FileStream(Server.MapPath(sSavePath + sFilename), System.IO.FileMode.Create)NewFile.Write(myData, 0, myData.Length)NewFile.Close()' Check whether the file is really a JPEG by opening itDim myCallBack As System.Drawing.Image.GetThumbnailImageAbort = New System.Drawing.Image.GetThumbnailImageAbort(AddressOf ThumbnailCallback)Dim myBitmap As Drawing.BitmapTrymyBitmap = New Drawing.Bitmap(Server.MapPath(sSavePath + sFilename))' If jpg file is a jpeg, create a thumbnail filename that is unique.file_append = 0Dim sThumbFile As String = System.IO.Path.GetFileNameWithoutExtension(myFile.FileName) + sThumbExtension + ".jpg"While System.IO.File.Exists(Server.MapPath(sSavePath + sThumbFile))file_append = file_append + 1sThumbFile = System.IO.Path.GetFileNameWithoutExtension(myFile.FileName) + file_append.ToString + sThumbExtension + ".jpg"End While' Save thumbnail and output it onto the webpageDim myThumbnail As System.Drawing.Image = myBitmap.GetThumbnailImage(intThumbWidth, intThumbHeight, myCallBack, IntPtr.Zero)myThumbnail.Save(Server.MapPath(sSavePath + sThumbFile))imgPicture.ImageUrl = sSavePath + sThumbFile' Displaying success informationlblStatus.Text = "Image uploaded successfully!"' Destroy objectsmyThumbnail.Dispose()myBitmap.Dispose()Catch errArgument As ArgumentExceptionSystem.IO.File.Delete(Server.MapPath(sSavePath + sFilename))End TryElselblStatus.Text = "The file must have an extension of JPG or GIF"ReturnEnd If End SubPublic Function ThumbnailCallback() As BooleanReturn FalseEnd Function

View 2 Replies View Related

Saving Image In SQL Server Or In Harddrive

Sep 24, 2003

I am trying to store about millions of pictures in Web server with lots of traffic. some poeple told me. SQL server cannot handle it and may freeze quickly. can anybody tell me which way is better and more efficent? store image in SQL server image field or store in server's harddrive?

View 13 Replies View Related

Saving Image To Db Using ADO. Crystal V6 Problem

Sep 11, 2006

Hi folks,

I am really hoping there is someone out there with the answer to my problems??

I need to save customer signatures to our SQL DB and then display them on a Crystal Report. The problem is that the client uses Crystal v6. I am saving the image to an Image field using an ADO rs on a VB6 application. It saves fine and will read back fine. Crystal however has a problem and throws an error "Not Supported".(Later versions of Crystal erad the images fine)

Northwind Database has a Table 'Categories' which as images that crystal v6 is able to display. As of yet I have been unable to save images in this format. I have tried .bmp,.jpg ...... I have also tried appendChunk..

All the images on Northwind start with '0x151C2...'

My bmp start with '0xFFD8....'

Any suggestions would be greatly appreciated.

View 1 Replies View Related

Saving An Jpeg Into Database And Displaying It Into A Image Box

Oct 19, 2006

can some one help me. im using visual studio.net 2005. its a web application.i have a database with attribute name logo. so i want to upload an image and save it into the database and than display it into the image box to preview how the image looks like.can some one please help me as i am very new in using C# codes and visual studio.net 2005

View 5 Replies View Related

VB (5or6) Does Something Wierd With Image Data While Saving To Sql2000

Apr 27, 2006

Vb stores an image (bitmap/jpg) in a SQL2000 image field. For somereason it doubles the size by adding 00 for each byte. But sometimes itdoesn't add 00 (0000.0000) but 01 or 20 or ?? and also the byte thatshould be transferd is changed...So SQLImageData = Imagebyte + 00and sometimesSQLImageData = CHANGEDImagebyte + xx.Some example data: (hex notation):A1 => A1 0003 => 03 00-----------91 => 18 2083 => 92 018C => 52 01Could anybody give me an explanation, because I need to know what ishappening, so I can remove te extra bytes added......I have already a image when I remove the extra bytes, but with somewrong data (on the place where things like 8C => 52 01 happen)....Thx,Geronimo

View 2 Replies View Related

My Dataset Is Saving Only The First Image Saved In The Database In Subsquent Rows

Mar 13, 2007

When i click upload image button when my database table has no any row, the selected image is saved(one row saved in table). If i continue and select a different image, i get no error sa if the image has been saved but when i view the images i have been saving, its strange even if i saved 10 records they all contain the first image that i saved. In short only the first image is saved the rest of the rows are just duplicates of the first row. so it basically becomes a table of ten rows but with same data rows(same image). Code is below.
Protected Sub btnupload_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim intLength As Integer
Dim arrContent As Byte()
If FileUpload.PostedFile Is Nothing Then
Lblstatus.Text = "No file specified."
Exit Sub
Else
Dim fileName As String = FileUpload.PostedFile.FileName
Dim ext As String = fileName.Substring(fileName.LastIndexOf("."))
ext = ext.ToLower
Dim imgType = FileUpload.PostedFile.ContentType
If ext = ".jpg" Then
ElseIf ext = ".bmp" Then
ElseIf ext = ".gif" Then
ElseIf ext = "jpg" Then
ElseIf ext = "bmp" Then
ElseIf ext = "gif" Then
Else
Lblstatus.Text = "Only gif, bmp, or jpg format files supported."
Exit Sub
End If
intLength = Convert.ToInt32(FileUpload.PostedFile.InputStream.Length)
ReDim arrContent(intLength)
FileUpload.PostedFile.InputStream.Read(arrContent, 0, intLength)
If Doc2SQLServer(txtTitle.Text.Trim, arrContent, intLength, imgType) = True Then
Lblstatus.Text = "Image uploaded successfully."
Else
Lblstatus.Text = "An error occured while uploading Image... Please try again."
End If
End If
End Sub
Protected Function Doc2SQLServer(ByVal title As String, ByVal Content As Byte(), ByVal Length As Integer, ByVal strType As String) As Boolean
Try
Dim cnn As Data.SqlClient.SqlConnection
Dim cmd As Data.SqlClient.SqlCommand
Dim param As Data.SqlClient.SqlParameter
Dim strSQL As String
strSQL = "Insert Into Images(imgData,imgTitle,imgType,imgLength,incident_id) Values(@content,@title,@type,@length,@incident_id)"
Dim connString As String = "Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|safetydata.mdf;Integrated Security=True;User Instance=True"
cnn = New Data.SqlClient.SqlConnection(connString)
cmd = New Data.SqlClient.SqlCommand(strSQL, cnn)
param = New Data.SqlClient.SqlParameter("@content", Data.SqlDbType.Image)
param.Value = Content
'cmd.Parameters.AddWithValue(param)
cmd.Parameters.AddWithValue("@content", Content)
 
param = New Data.SqlClient.SqlParameter("@title", Data.SqlDbType.VarChar)
param.Value = title
cmd.Parameters.Add(param)
param = New Data.SqlClient.SqlParameter("@type", Data.SqlDbType.VarChar)
param.Value = strType
cmd.Parameters.Add(param)
param = New Data.SqlClient.SqlParameter("@length", Data.SqlDbType.BigInt)
param.Value = Length
cmd.Parameters.Add(param)
cmd.Parameters.AddWithValue("@incident_id", id.Text)
cnn.Open()
cmd.ExecuteNonQuery()
cnn.Close()
Return True
Catch ex As Exception
Return False
End Try
End Function

View 1 Replies View Related

Automating A Query And The Saving Saving Of Subsequent Results

Dec 13, 2007

Hi Guys,

I am trying to automate a basic task using SQL Server 2005 Express.

Currently I have a query script that I run and then save the results as a CSV file. I need to do this on a daily basis and so I am looking to find out how best to go about this. There are a multitude of third party tools that claim to be able to do this - can anyone recommend this or enlighten me of the best way to set up this automation.

All ideas gratefully received!

View 1 Replies View Related

Sending Uploaded Image To Data Access Class When Storing Image In SQL Server 2005

Apr 20, 2007

I am using the 3-tiered architecture design (presentation, business laws, and data acess layers). I am stuck on how to send the image the user selects in the upload file control to the BLL and then to the DAL because the DAL does all the inserts into the database. I would like to be able to check the file type in the BLL to make sure the file being uploaded is indeed a picture. Is there a way I can send the location of the file to the BLL, check the filetype, then upload the file and have the DAL insert the image into the database? I have seen examples where people use streams to upload the file directly from their presentation layer, but I would like to keep everything seperated in the three classes if possible. I also wasn't sure what variable type the image would be in the function in the BLL that receive the image from the PL. If there are any examples or tips anyone can give me that would be appreciated.

View 2 Replies View Related

How To Save Image In Sql Server And Display That Image In Datagrid??

Jun 27, 2007

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

View 5 Replies View Related

How To Store Image In Image Field In Sql Server 2000

Jul 12, 2007



hi all,

i have created a table with image field in it. Now i just want to store a jpeg file in it but not finding any way to do so.



how can i store any image ? what are the steps???????





thanx in advance



View 5 Replies View Related

HOW To Retrieve An Image From Sql Server And Display It In ASP.net Using Imagemap Or Image ?

Jul 6, 2006

Ok, the problem is that , i have a field called "Attach" in sql of type image, when selecting it , the field is getting data of type BYTE(). which am being unable to display them on an Image on the panel.

using the following vb.net code:

'Dim sel2 As String

'Dim myCom As SqlCommand

'Dim conn As New SqlConnection

'Dim drr As SqlDataReader

'Dim image As System.Drawing.Image

'sel2 = "select * from attach where att_desc = '" & DropDownList1.SelectedItem().Text & "' and doc_code = " & w_doc_code & " and subcode = " & w_doc_subcode & " and doc_num= " & w_doc_num & " "

'conn.ConnectionString = ("server=developer01;uid=sa;password=aims;database=DVPSOC;timeout=45")

'myCom = New SqlCommand(sel2, conn)

'conn.Open()

'drr = myCom.ExecuteReader()

'If drr.Read Then

' Me.ImageMap1.ImageUrl = drr.Item("attach")

'End If

'conn.Close()

Am getting an exeption on the following line Me.ImageMap1.ImageUrl = drr.Item("attach")

saying: Conversion from type 'Byte()' to type 'String' is not valid.

knowing that i tried converting using ToString but it's not getting any output then.

thanks for your help.

View 4 Replies View Related

How Image Display From SqlServer To Image Control

Feb 13, 2007

I have learned lots of informative thing from your forums. I have little problem regarding “Display image from SQL Server on ASP.NET� I have done it and image display on my page from SQL Server. I have cleared you here I have adopt two different methods which are following for displaying picture.

1.Response.BinaryWrite(rd("picture"))
2.image.Save(Response.OutputStream, ImageFormat.Jpeg)

but in both above methods I have faced little problem when image display on my page all other information can not display and I also want to display picture on my specific location on the page. My second question is can use any web control like “Image1� to display image from SQL Server where my pictures are stored.

Hope you will help me.

Thanks and regards


Aftab Abbasi

View 4 Replies View Related

Inserted The Image In A Column----how Can I View The Image

Mar 7, 2006

hi,i have inserted the image present in mydocuments using alter commandcreate table aa(a int, d image)insert into aa values (1,'F:prudhviaba 002.jpg')when i doselect * from aai am getting the result in the column d as0x463A5C707275646876695C70727564687669203030322E6A 7067how i can i view the image?pls clarify my doubtsatish

View 2 Replies View Related

1st Image Control Shows Wrong Image

Jan 30, 2007

In my asp.net application I have a local report with an image control in thedetail row of the table and the Value attribute set as="File://" & Fields!FQPhotoFileName.ValueThe first row in the table always shows the wrong image and it's always thesame wrong image. The problem is there even when I change the sort order orthe criteria for the underlying dataset. For example, I ran a small testthat populated the dataset with 2 rows and 2 images. When I sort by anycolumn (e.g. ID) in ascending ascending order the ID=1 row (the 1st row)shows the wrong image and the ID=2 row shows the correct image. When I rerunthe report sorting in descending order the ID=2 row (which is now the 1strow) shows the wrong image and the ID=1 shows the correct image.Any suggestions?

View 1 Replies View Related

Image Located On Web, Url For Image Stored In Database

Aug 17, 2007



Hi,
I have a website and i am uploading the gif image to the database. i have used varchar(500) as the datatype and i am saving the file in the webserver so the path to it c:intepub....a.gif


my upload table has the folliwing feilds
UploadId Int Identity, Description, FileName, DiskPath varchar(500), weblocation varchar(500). I have a main sproc for the report where i am doing a inner join with other table to get the path of the gif..

So my question is how can i get a picture to show up on the report. .
What kinda datatype the gif file should be stored in the database? If it is stored as a varchar how can i access it and what is best way to reference that particular.

any help will appreciated....
Regards
Karen

View 9 Replies View Related

Inserting Image File Into Image Column In DB

Sep 20, 2006

I have inherited a VS 2005 database with a table that has a column of type IMAGE. I need to change the image for one of the rows in the table. I have the new image in a *.PNG file on my C: drive. What is the correct method for inserting this file into the IMAGE column.

Many thanks!

View 6 Replies View Related

Showing Image Using Image Url

Apr 1, 2007

Hi,



I need to show images in the report based on the urls from the db. The images are stored within a folder and not in the db (only the url in db). I couldnt find any way to give an url in the report and show the image. I'm stuck here , could you please help?



Thanks,

Sonu.

View 10 Replies View Related

Not Saving

Nov 22, 2006

Please i need to save records using DataSet. I created the connectionstring as a global variable. In th button_Click event i have this :
Protected Sub btnAdd_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim InsAdapter As New SqlDataAdapter
Dim StrInsert As String = "insert into Products(CategoryId,ProductName,ProductCode,ProductPrice,) values(@CategoryId,@ProductName,@ProductCode,@ProductPrice)"
Dim ObjComm As New SqlCommand(StrInsert, ObjConn)
ObjComm.Parameters.Add("@CategoryId", SqlDbType.Int).Value = drpCategory.SelectedValue
ObjComm.Parameters.Add("@ProductName", SqlDbType.NVarChar, 30).Value = txtName.Text
ObjComm.Parameters.Add("@ProductCode", SqlDbType.NVarChar, 10).Value = txtCode.Text
ObjComm.Parameters.Add("@ProductPrice", SqlDbType.Int).Value = txtPrice.Text
InsAdapter.InsertCommand = ObjComm
End Sub
But on clicking the button, the record is never saved. Please help

View 4 Replies View Related

Saving To SQL

Nov 29, 2007

I am currently migrating my application from Access to SQL. It looks like it's working good but one thing I cannot understand is why when I have created a varchar(40) field and after I insert a field that is less then 40 characters long, the rest of the string is filled with the leading spaces. I have also create an nchar(40) that did not solve it ether. For example: the text is "Hello World". The text is 11 characters long but the data saved to the table is: "Hello Wolrd" + 29 spaces. Am I doing something wrong?Thanks for your help in advance. 

View 6 Replies View Related

DTS Not Saving

Dec 5, 2007

When I open a DTS package, save it as a bas file, make changes, close the package and save it when prompted, where are my changes saved?

The answer appears to be nowhere. When I reopen the package it's back to it's original setup. When I check the bas file it's as it was when I originally saved it.

Any ideas? Like where my mornings work is gone?

View 3 Replies View Related

Saving Changes

Feb 27, 2008

We have a table with 3.5 million records in it. We have been forced to add two fields and set indexes on those fields. But when we try to save the changes it times out. When we try to generate a change script it also times out. Is this a memeory issue? Any ideas on whats causing this or how to fix it woudl be greatly appriciated.

View 4 Replies View Related

Saving Changes

Nov 20, 2007

Hi, all.This might be a silly question... but I am very new to programming inSQL so please bear with me :)So. I'm using MS SQL Server 2005 Management Studio Express. I have atable that was created via an existing .sql file. Included were abunch of stored procedures. I went in to re-format these procedures.(They were written in haste by another programmer. It is my task to goback and improve their readabilities.) However, I am having difficultyfiguring out how to save the changes to these stored procedures. Thusfar, I have been individually saving each stored procedure in itsown .sql file. This is obviously not the way to go... but it's atemporary solution (so as not to lose the changes I have made todozens of procedures).Can someone please explain to me how I commit these changes to thedatabase?Thanks,Allie

View 1 Replies View Related

Saving Changes In MDX

Feb 22, 2007

Hi,

I have written a report in Reporting Services 2005 which gets its data from a cube.

I want to edit the mdx generated by the Mdx builder in RS 2005, so I click on the "design mode" button to do this.

However, when i make the changes, i cannot save it. How can I do this?

Thanks,

Ashleys.

View 1 Replies View Related

Saving

Feb 1, 2007

Good day

Using vb 2005 express I have my grid veiw on the form and a icon to click to save my work.

But is there a passage of code I can write to pop up a message box to remind me to save my work when I close my form. Similar to ms office forms when you close they ask you if you want to save any changes.

Thanks

Rob

View 3 Replies View Related

Saving Pictures

Sep 13, 2006

Is it better to have users that upload pictures have them saved to SQL server or to a folder?  I have a site where users enter things that they own (and each item has a unique id) and now I would like to add the functionality to add a picture.  I am sure I should use the fileUpload control, but should this save to a folder created for each user or to the SQL record itself?  Or possibly a separate SQL table just for pictures?Thanks for the help.

View 1 Replies View Related

Saving Date Into SQL

Nov 6, 2007

Hi,
      I want to save date into SQL server pls help me how to save this date into server. its give me syntax error that converting datetime to character string. and also I want to save date only in mm/dd/yy format in a sql not including time.
The following code I am using
  sub SaveEvent(sender as object, e as EventArgs)         Dim dt As DateTime = DateTime.Parse(eventdate.Text)
         lbl.text=dt   dim con as new SQLConnection("server=london-home; Database=tony; uid=rashid2; pwd=test; ")
      dim cmd as new SQLCommand("insert into events values('" & dt & "','" & desc.text & "')",con)           con.open()     cmd.executenonquery()   con.close()       end sub 
 
 
 

View 13 Replies View Related

SQL For Saving A Value In A Variable

Jun 15, 2008

 Hello Im having a little problem getting some values from a database.....
What I need is to get the value of the keyfield of the last entry introduced, I know how to to do the SQL statement for this, the problem is that i dont know how to save this value in a variable. I need to save this value in a variable in the session object or in a hidden field, and then use this variable in another different page. That's way i need to save this ID value, later in the other page I introduce data in a different table and one of the fields has to be this ID value which I have as a foreign key in the table so I need to use the same value in all the rows i introduce(Id value).
If you know how to accomplish this let me know, many thanks, Sergio

View 6 Replies View Related

Saving Files In DB

Apr 14, 2006

In my system, I generate invoices as PDF for my clients and I need to email them and save them on the database. What is the best approach for achieving that?!
 
Shall I save the files path in the SQL server 2000 as ( varchar ) and save files in a folder in the server or there is another approach?! is there any recommendation or advice about the procedure to send emails shall i save them first then send them or ...!??
 
Appreciate your advice!

View 1 Replies View Related

Saving Values

Aug 10, 2007

Hi All
2 post in a row first time in ages so i must be getting better but i get stuck on crappy little things like this hopefully
I have data in the following format
4.1399999999999997
4.2400000000000002
5.4800000000000004
5.1799999999999997
6.7699999999999996
i want to select the data as such
4.13
4.24
5.48
5.17
6.76
I keep chasing my tale on this one around and around any one got a simple idea i am missing, you would not believe how much time i have spent on this.
Cheers
Phil

View 15 Replies View Related

Saving In Database

Sep 12, 2007

Hey Guys need your help please!

we are now on our second week back log...

database file is not full and not limited to growth. As a matter of fact batch transactions are done but our proble is very slow. 28 records has been successfully save after 45 mins. Before it's just 5 minutes. Then some other process are not working. Is there anything that I must do? We have 460 tables in our software using SQL server 2000 and our application is using VB 6.0

View 3 Replies View Related

Saving HTML To Sql

Oct 25, 2007

hello,

Im not really sure if this is the right thing to do. But i want to save a copy of the html from my invoice to sql so that i can keep a history of the invoices in case their are changes done to them. Anybody know what would be the best way to do this?

Thank you,

~ Mauricio

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved