| | |
Image stored in sqlserver
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Sep 2008
Posts: 1
Reputation:
Solved Threads: 0
I m writting a project
i want to save finger print image in sqlserver
but io.filemode.open is error occured, how can i solve for this, help me
'///////////////coding
how can i solve for this io.filemode.open error exception
help me
i want to save finger print image in sqlserver
but io.filemode.open is error occured, how can i solve for this, help me
'///////////////coding
vbnet Syntax (Toggle Plain Text)
Dim sqlConn As New SqlClient.SqlConnection(ConnectionString) sqlConn.Open() Dim sqlComm As New SqlClient.SqlCommand("SELECT * From InkPaperData", sqlConn) Dim SaveAdapter As SqlClient.SqlDataAdapter '(" Select * From InkPaperData", sqlconn) 'SaveAdapter = New SqlClient.SqlDataAdapter("Select * From InkPaperData", sqlConn) 'Dim myReader As SqlClient.SqlDataReader = sqlComm.ExecuteReader() Dim datPubs As DataSet = New DataSet() SaveAdapter.Fill(datPubs, "InkPaperData") Dim drNewRow As DataRow = datPubs.Tables("InkPaperData").NewRow 'Manipulate the data locally using the DataSet 'SaveAdapter.Update(datPubs, "InkPaperData") Dim Idno, Name, strMsg As String Dim DirImage1, DirImage2, DirImage3, DirImage4, DirImage5 As String Dim DirImage6, DirImage7, DirImage8, DirImage9, DirImage10 As String Dim DirImage11 As String 'Prompt for data to insert Idno = Trim$(TextBox1.Text) Name = Trim$(TextBox2.Text) If Trim$(Idno) = "" Then strMsg = "Please enter your ID Number before saving the record." MsgBox(strMsg, vbInformation, "FingerPrintIdentification") TextBox1.Select() Exit Sub End If If Trim$(Name) = "" Then strMsg = "Please enter your NAME before saving the record." MsgBox(strMsg, vbInformation, "FingerPrintIdentification") TextBox2.Select() Exit Sub End If DirImage1 = Trim$(TxtPicDir1.Text) DirImage2 = Trim$(TxtPicDir2.Text) DirImage3 = Trim$(TxtPicDir3.Text) DirImage4 = Trim$(TxtPicDir4.Text) DirImage5 = Trim$(TxtPicDir5.Text) DirImage6 = Trim$(TxtPicDir6.Text) DirImage7 = Trim$(TxtPicDir7.Text) DirImage8 = Trim$(TxtPicDir8.Text) DirImage9 = Trim$(TxtPicDir9.Text) DirImage10 = Trim$(TxtPicDir10.Text) DirImage11 = Trim$(TxtPicDir11.Text) '/////////////////// Try Dim fs1 As New IO.FileStream(Trim$(DirImage1), IO.FileMode.Open) Dim Data1() As Byte = New [Byte](fs1.Length) {} fs1.Read(Data1, 0, fs1.Length) drNewRow(3) = Data1 '///////left pointer Dim fs2 As New IO.FileStream(Trim(DirImage2), IO.FileMode.Open) Dim Data2() As Byte = New [Byte](fs2.Length) {} fs2.Read(Data2, 0, fs2.Length) drNewRow(4) = Data2 drNewRow(1) = Idno drNewRow(2) = Name drNewRow(13) = FingerimageData1 drNewRow(14) = FingerimageData2 drNewRow(15) = FingerimageData3 drNewRow(16) = FingerimageData4 drNewRow(17) = FingerimageData5 drNewRow(18) = FingerimageData6 drNewRow(19) = FingerimageData7 drNewRow(20) = FingerimageData8 drNewRow(21) = FingerimageData9 drNewRow(22) = FingerimageData10 datPubs.Tables("InkPaperData").Rows.Add(drNewRow) Catch ex As System.Data.SqlClient.SqlException MsgBox(ex.Message) End Try 'Save Ink finger String Data to record 'End Save Ink finger String Data to record Add_Data() 'Save_Record = True Buttons_Caption(False) Exit Sub Save_Record_Error: Err.Raise(Err.Number, Err.Source, Err.Description) Err.Clear() '///////////////end coding
how can i solve for this io.filemode.open error exception
help me
Last edited by cscgal; Sep 4th, 2008 at 3:42 am. Reason: Added code tags
Would it not be better to set the 'image' field in the database as an Image or VarBinary(max). Then to add an image to the database you could pass in the bytes of the new image file that you want to upload.
Thats the approach I used when I wanted to store documents/images in SQL Server
Thats the approach I used when I wanted to store documents/images in SQL Server
Michelle (Junior Developer)
•
•
Join Date: Aug 2008
Posts: 1,162
Reputation:
Solved Threads: 138
It really depends on the amount of images you will expect to have in your database, security and speed needed.
Of course more image mean more space. If speed is an issue, the database isn't optimized for files, the filesystem is.
If you need the images in the database, correct, store them as images in sql, byte arrays as code, and pull them out as byte arrays.
Of course more image mean more space. If speed is an issue, the database isn't optimized for files, the filesystem is.
If you need the images in the database, correct, store them as images in sql, byte arrays as code, and pull them out as byte arrays.
Custom Application & Software Development
www.houseshark.net
www.houseshark.net
![]() |
Similar Threads
- How To Upload Image In Vb.net (VB.NET)
- Login used to work (ASP.NET)
- URGENT! Loading Roles From ticket.UserData (ASP.NET)
Other Threads in the VB.NET Forum
- Previous Thread: Plz Help me out ..AM WATING
- Next Thread: Creating a Login Text file
| Thread Tools | Search this Thread |
Tag cloud for VB.NET
.net 2005 2008 access account application arithmetic array arrays basic bing button buttons c# center check checkbox code combobox component convert crystalreport data database datagrid datagridview date dissertation dissertations dropdownlist excel fade file-dialog ftp generatetags google gridview hardcopy images inline input insert intel internet listview mobile monitor ms net networking objects output passingparameters peertopeervideostreaming picturebox picturebox1 port print printing problem problemwithinstallation project remove save searchbox searchvb.net select serial server shutdown soap sorting survey table tcp temperature text textbox timer toolbox trim update updown user validation vb vb.net vb.netcode vb.netformclosing()eventpictureboxmessagebox vb2008 vbnet view visual visualbasic visualbasic.net visualstudio visualstudio2008 web winforms wpf






