[ad_1]
上記の質問のようなアプリケーションを開発する方法を教えてください。無料のソース コードを入手したいのですが。
誰か助けてください
解決策 1
VB
'Add A Sql Column With Data Type varbinary Dim fd As OpenFileDialog = New OpenFileDialog() 'fd.Filter = "pdf file|*.pdf" If fd.ShowDialog = Windows.Forms.DialogResult.OK Then 'Interaction.MsgBox("File saved into database", MsgBoxStyle.Information) End If sqlStr = "" sqlStr = "" Dim fs As New FileStream(fd.FileName, FileMode.Open, FileAccess.Read) Dim br As New BinaryReader(fs) Dim bytes As Byte() bytes = System.IO.File.ReadAllBytes(fd.FileName) 'insert the file into database strConn = New SqlConnection(oCommon.DSN()) strConn.Open() sqlStr = "" sqlStr = "update YourTable set Columns = @Columns WHERE Column = '" & detgrd(detgrd.Row, 0).ToString().ToUpper().Trim() & "' " SqlCmd = New SqlCommand SqlCmd.CommandText = sqlStr SqlCmd.Parameters.Add("@Columns ", SqlDbType.Binary).Value = bytes SqlCmd.Connection = strConn SqlCmd.ExecuteNonQuery() MessageBox.Show("SuccessFull", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information)
PDF を取得するには
VB
Dim filePdf As String filePdf = Application.StartupPath & "\" & fileNmaeYouWant & ".pdf" If System.IO.File.Exists(filePdf) Then File.Delete(filePdf) End If Dim bytesLoad As Byte() bytesLoad = Nothing sqlStr = "" sqlStr = "select pdfColumn from yourtable where "' " mydatatable = New DataTable mydatatable = modFunctions.ReturnData(sqlStr) If mydatatable.Rows.Count > 0 Then If IsDBNull(mydatatable.Rows(0).Item("pdfColumn")) = True Then Exit Sub Else bytesLoad = mydatatable.Rows(0).Item("pdfColumn") End If Else Exit Sub End If My.Computer.FileSystem.WriteAllBytes(filePdf, bytesLoad, False) System.Diagnostics.Process.Start(filePdf)
[ad_2]
コメント