Click here to Skip to main content
16,004,882 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: VB6 to VB.Net COM Interface Help Pin
sashaw23-Mar-14 4:16
sashaw23-Mar-14 4:16 
AnswerRe: VB6 to VB.Net COM Interface Help Pin
Richard Deeming3-Mar-14 7:17
mveRichard Deeming3-Mar-14 7:17 
GeneralRe: VB6 to VB.Net COM Interface Help <<< SOLVED >>> Pin
sashaw23-Mar-14 11:01
sashaw23-Mar-14 11:01 
QuestionPlease help me,.? Pin
M.Aprianto2-Mar-14 5:42
M.Aprianto2-Mar-14 5:42 
AnswerRe: Please help me,.? Pin
Eddy Vluggen2-Mar-14 7:44
professionalEddy Vluggen2-Mar-14 7:44 
Questionhow to make session timeout to automatically logout? Pin
charles entsuah28-Feb-14 10:31
charles entsuah28-Feb-14 10:31 
AnswerRe: how to make session timeout to automatically logout? Pin
ZurdoDev28-Feb-14 10:58
professionalZurdoDev28-Feb-14 10:58 
Questionupload pdf , save pdf in to a table, and read it from a datagrid on double click Pin
waner michaud28-Feb-14 9:07
waner michaud28-Feb-14 9:07 
Hi everyone,
I need help with the following issues:

I have a SQL table namely

tddocument:

Fileid_PK int
Filename varchar(100)
Extension varchar(50)
Content_document varbinary(MAX)
PDF_doc image Checked
File_location varchar(100)
Case_reportID_FK int

A dataset : tdDocument_dataset

A Vb_form name (Save_PDF_Document)

I put all items from the table on the form as controls.

I put a browse button on the form. here is the code under the button:

Dim openfd As New System.Windows.Forms.OpenFileDialog
Dim ms As New IO.MemoryStream
openfd.InitialDirectory = "C:\"
openfd.Title = "Open a PDF file"
openfd.Filter = "PDF files|*.pdf"
openfd.ShowDialog()
File_locationTextBox.Text = openfd.FileName
Me.PDF_docPictureBox.ImageLocation = openfd.FileName

Save_button to save. Here is the code:

Try
Me.Case_reportID_FKLabel1.Text = Me.Case_reportID_PKLabel1.Text
' SavePDFtoSQL()
Me.Validate()
Me.Table_DocumentBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.Document_DataSet)
Catch ex As Exception
MsgBox(My.Settings.ERROR_msg, vbCritical, "Erreur")
End Try

When I look at the table record from SQL I see the PDF_doc with a <Binary Data> record. meaning something saved.

Now I Have a data grid view(View_DocumentDataGridView)

I double click on it to open another form namely (Frm_PDF_Viewer)so I read the PDF file associates with the grid as follow:

If frm Is Nothing Then
frm = New FrmPDF_Viewer()
frm.Text = "RAPPORT D'ENQUÊTE"
frm.ID = Int(Me.View_DocumentDataGridView.Item(0, IndexRows).Value)
frm.modification = 1
frm.access_level = Me.access_level
frm.User_ID = Me.User_ID
frm.Usergroup = Me.Usergroup
frm.ShowDialog()
End If

when the form FrmPDF_Viewer open under the load I have this:

Try

Me.Fileid_PKLabel1.Text = ID
Me.View_DocumentTableAdapter.FillByfileid_PK(Me.View_Document_DataSet.View_Document, Me.Fileid_PKLabel1.Text)
AxAcroPDF1.LoadFile(OpenFileDialog1.FileName("Me.File_locationLabel1.Text"))
AxAcroPDF1.Show()
Catch ex As Exception
MsgBox(My.Settings.ERROR_msg, vbCritical, "Erreur")
End Try


No luck...I tried so many different ways..

NOTE: what i want to accomplish to upload a pdf, save pdf into a table. showing the record a a grid..double click on the grid to open a form to show all the record including any images or pdf files.

I hope I am clear on this...

thanks for your help and assistance.
AnswerRe: upload pdf , save pdf in to a table, and read it from a datagrid on double click Pin
Eddy Vluggen2-Mar-14 7:52
professionalEddy Vluggen2-Mar-14 7:52 
QuestionThreading.Thread.Sleep(5000) causing my splash screen to not show values. Help appreciated. Pin
ChristGuard26-Feb-14 9:46
ChristGuard26-Feb-14 9:46 
AnswerRe: Threading.Thread.Sleep(5000) causing my splash screen to not show values. Help appreciated. Pin
Dave Kreskowiak26-Feb-14 11:17
mveDave Kreskowiak26-Feb-14 11:17 
GeneralRe: Threading.Thread.Sleep(5000) causing my splash screen to not show values. Help appreciated. Pin
ChristGuard26-Feb-14 12:00
ChristGuard26-Feb-14 12:00 
GeneralRe: Threading.Thread.Sleep(5000) causing my splash screen to not show values. Help appreciated. Pin
Dave Kreskowiak26-Feb-14 16:17
mveDave Kreskowiak26-Feb-14 16:17 
Questionreading html data using the vb script Pin
Member 1062036024-Feb-14 17:32
Member 1062036024-Feb-14 17:32 
AnswerRe: reading html data using the vb script Pin
Dave Kreskowiak24-Feb-14 17:38
mveDave Kreskowiak24-Feb-14 17:38 
GeneralRe: reading html data using the vb script Pin
Member 1062036024-Feb-14 17:40
Member 1062036024-Feb-14 17:40 
GeneralRe: reading html data using the vb script Pin
Member 1062036024-Feb-14 17:43
Member 1062036024-Feb-14 17:43 
GeneralRe: reading html data using the vb script Pin
Dave Kreskowiak24-Feb-14 17:46
mveDave Kreskowiak24-Feb-14 17:46 
QuestionRunning VB6 programs in Windows 7 Pin
Wycombe24-Feb-14 12:00
Wycombe24-Feb-14 12:00 
AnswerRe: Running VB6 programs in Windows 7 Pin
Dave Kreskowiak24-Feb-14 14:49
mveDave Kreskowiak24-Feb-14 14:49 
GeneralRe: Running VB6 programs in Windows 7 Pin
Wycombe25-Feb-14 5:01
Wycombe25-Feb-14 5:01 
GeneralRe: Running VB6 programs in Windows 7 Pin
Dave Kreskowiak25-Feb-14 6:47
mveDave Kreskowiak25-Feb-14 6:47 
AnswerRe: Running VB6 programs in Windows 7 Pin
MyOwnBoss7-Mar-14 13:02
MyOwnBoss7-Mar-14 13:02 
QuestionMulti Select List box to Word 2007 table Pin
Member 791951624-Feb-14 8:20
Member 791951624-Feb-14 8:20 
QuestionUpdating ComboBox after Insert or Delete with SQL 2008 Pin
Dan O'Riordan23-Feb-14 23:25
Dan O'Riordan23-Feb-14 23:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.