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
ADVERTISEMENT
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
View Related
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
May 3, 2001
A long shot but someone may have experienced same problem. We are using Crystal Info to run reports against a SQL 7 database. Reports that usually take 1 or 2 minutes to run are taking up to 15 minutes to run. The database is fine ie you run the query through the query analyser and it runs in 1 or 2 minutes. Any ideas... I've spoken to Seagate but not making much progress.
Thanks in advance..
View 1 Replies
View Related
Sep 6, 2000
Can any one tell me where can I find good online help for Crystal Reports for learning?
Thanks!
View 1 Replies
View Related
Feb 2, 2007
I just started using Crystal, and I have to say, its a pain in the arse.
Can I just run a simple SQL query and get the results I want, without having to use Crystal Syntax?
Here is the query I want to use:
Code:
select * from esmpvald, esmprmtr
where esmpvald.permit_id = esmprmtr.permit_id and
esmprmtr.issue_date >= ('01/01/06') and
esmprmtr.issue_date <= ('12/31/06') and
esmprmtr.permit_id in (select esmvardd.permit_id
from esmvardd, esmudfvr
where esmvardd.var_fld_id = esmudfvr.var_fld_id and
esmvardd.permit_id in
(select esmvardd.permit_id from esmvardd, esmudfvr where esmvardd.var_fld_id = esmudfvr.var_fld_id and
(esmvardd.var_fld_value = 'a') and
(esmudfvr.var_fld_name = 'Commercial Type')) and 1=1)
I will be looping through the "esmvardd.var_fld_value = 'a'" part, going a through f, but for now, I just want to start with the 'a'.
I could do this manually, and throw it in a Word doc, but I'm trying learn this thing. Ideas?
View 1 Replies
View Related
Apr 19, 2006
I am working on creating Crystal Reports from a SQL database.
In CR you can define a multiple range parameter i.e. 1-10, 100-200, 300-400 and Cr will filer records that satisfy this criteria.
How can I transfer this functionality using a stored procedure?
View 1 Replies
View Related
Mar 6, 2006
Hi,
I am new to crystal reports.
I need to change the database connection in the reports to different sql server database and use the same report layout.
Any help is appreciated.
View 4 Replies
View Related
Mar 20, 2007
I'm new to SQL but have quite happily been using Crystal Reports without it until now.
I am creating a letter template and it has the name at the top then the address
<name>
<address1>
<address2>
<address3>
<address4>
There is always an address 1, but maybe not a 3 or a 4, and aparently we dont want any line gaps to show, so I figured i should use an isnull to eliminate the line and to move the other address line up?
Not sure what to put though, any ideas?
Thanks in advance for any help :o)
View 2 Replies
View Related
Sep 27, 2007
THE TIME PORTION OF THE DATE/TIME IS NOT DISPLAYING IN CRYSTAL 8.5
IT SEES THE DATE...BUT NOT THE TIME
ANY SUGGESTIONS
View 3 Replies
View Related
Jan 24, 2008
ive come from a crystal background and im having difficulty writing reports.
An example of the problem im having is with saved formulas (crystal calls them formulas)
eg
i would create a forumula called Difference
it would be something like this
=DateDiff("d",Field1, Field2) save that and then it was stored
then in a text box i would reference it like so.
=iif( Difference <= 23,"Too New","Just Right")
is this possible in RS??? as i have reports i need to convert from crystal to RS, and the iif statements are becoming huge, especially when you reference the same formula in the expression multiple times.
bit long winded i know, and i hope this makes sense, but i am witts end with this issue
thanks in advance
Jonny
View 3 Replies
View Related
May 17, 2007
Hi,
I have a question. How can i fill a report made in CrystalReports in .net
Thanks in advance
View 1 Replies
View Related
Aug 10, 2007
I've created an app that connects to a SQLCE database. I need to create Crystal Reports that connect to the database. There is no ODBC driver for SQLCE. How can I do this?
Thanks,
Kathy
View 9 Replies
View Related
Mar 14, 2008
what are the good resources for crystal reports.
Also is it something which is difficult to work with ? Suggestion, experiences and notes please.
View 4 Replies
View Related
Apr 26, 2002
Hi,
I am trying to run the crystal report from asp.
its says SQL Server connection failed. But i could connect SQL server using the same DSN. Any idea???
Set crp = Server.CreateObject("Crystal.CRPE.Application")
iReturn = crp.LogOnServer("p2sodbc.dll", "DSNNAME","USERID","PASSWORD")
Set oRep = crp.OpenReport("C:inetpubwwwrootpdftestest.rpt")
oRep.Preview
Set crp = nothing
Thanks
Ilango
View 1 Replies
View Related
May 27, 1999
hey folks...
i am new to store procedures, crystal and sql server... ..one heck of a combination..yikes....neways.... writing a stored procedure in 6.5 to run a crystal report 7.0... want to create an output variable in the procedure that the report will see as a field... can i do this...and if so how....
any and all help muchos gracious.... the higher ups just don't get why i can't do all in 10 days of learning sp's on my own.... egads... management
:-)
take care.....kim
View 2 Replies
View Related
Jan 12, 2004
Does Crystal Report 8.5 work OK with SQL Server 2K ?
Anyone encoutered problems for with this couple of programs ?
View 3 Replies
View Related