Click here to Skip to main content
15,886,919 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Issue with "Windows Form App" Disappearing in VB.NET 2022 Pin
Victor Nijegorodov27-Aug-23 0:05
Victor Nijegorodov27-Aug-23 0:05 
GeneralRe: Issue with "Windows Form App" Disappearing in VB.NET 2022 Pin
ionline4u27-Aug-23 0:35
ionline4u27-Aug-23 0:35 
GeneralRe: Issue with "Windows Form App" Disappearing in VB.NET 2022 Pin
Dave Kreskowiak27-Aug-23 4:56
mveDave Kreskowiak27-Aug-23 4:56 
GeneralRe: Issue with "Windows Form App" Disappearing in VB.NET 2022 Pin
Richard MacCutchan27-Aug-23 6:28
mveRichard MacCutchan27-Aug-23 6:28 
AnswerRe: Issue with "Windows Form App" Disappearing in VB.NET 2022 Pin
Richard MacCutchan27-Aug-23 1:29
mveRichard MacCutchan27-Aug-23 1:29 
QuestionPrinterSettings.CanDuplex appears to not be working Pin
lewist5721-Aug-23 5:27
lewist5721-Aug-23 5:27 
AnswerRe: PrinterSettings.CanDuplex appears to not be working Pin
Gerry Schmitz22-Aug-23 7:48
mveGerry Schmitz22-Aug-23 7:48 
QuestionConvert/Read SQL Image field into pdf Pin
Benniit19-Jul-23 9:07
Benniit19-Jul-23 9:07 
Please I am using VB.net 2019 and Sql 2016 and I have the below codes which inserts the pdf into the database successfully. But retrieving it becomes a problem for me and that is not the case for an image. I want to convert and retrieve this line of code into pdf "Me.Pdf1.Image=Image.fromStream(ms)" which gives an exception because it is not an image but pdf in the database. Please help me. Thank

VB
OpenFileDialog1.ShowDialog()         

txtPdfPath.Text = OpenFileDialog1.FileName'PDf file uploaded here

'Code to insert Pdf file and after connection has been established

Dim ms1 As New MemoryStream

frmBPA1.Pic1.Image.Save(ms1, frmBPA1.Pic1.Image.RawFormat)     

SqlQuery = "Insert into BPA1 (Pdf1)Values(@Pdf1)"

com.Parameters.AddWithValue("@Pdf1", ms1.ToArray)

com.CommandText = SqlQuery             

com.CommandType = CommandType.Text

SQLCon.Open()

com.ExecuteNonQuery()                     

SQLCon.Close()

'Code to retrieve the pdf file

Dim strQuery As String = "Select df1 from BPA1" 

SQLCon1.Open()                     

comFile = New SqlCommand(strQuery, SQLCon1)                     
comFile.Parameters.AddWithValue("@ReceiptNo", Me.txtReceiptNo.Text.Trim) 
daFile = New SqlDataAdapter(comFile) 
daFile.Fill(taFile)                     
If taFile.Rows(0).Item("Pic1") IsNot DBNull.Value Then                      
Dim img() As Byte   
img = taFile.Rows(0).Item("Pdf1")                         
Dim ms As New MemoryStream(img)                         
If img.Length <> "0" Then                         
Me.Pic1.Image = Image.FromStream(ms)                         
' Me.txtPdfPath.Text = File.FromStream(ms)                                      
End If

AnswerRe: Convert/Read SQL Image field into pdf Pin
Richard MacCutchan19-Jul-23 22:18
mveRichard MacCutchan19-Jul-23 22:18 
GeneralRe: Convert/Read SQL Image field into pdf Pin
Benniit20-Jul-23 4:22
Benniit20-Jul-23 4:22 
GeneralRe: Convert/Read SQL Image field into pdf Pin
Richard MacCutchan20-Jul-23 4:32
mveRichard MacCutchan20-Jul-23 4:32 
AnswerRe: Convert/Read SQL Image field into pdf Pin
jschell22-Aug-23 6:56
jschell22-Aug-23 6:56 
GeneralScanner Device Pin
Mateo Francisco18-Jul-23 20:50
Mateo Francisco18-Jul-23 20:50 
AnswerRe: Scanner Device Pin
Ralf Meier18-Jul-23 21:15
mveRalf Meier18-Jul-23 21:15 
GeneralRe: Scanner Device Pin
Victor Nijegorodov19-Jul-23 2:04
Victor Nijegorodov19-Jul-23 2:04 
QuestionAll digits in string after W Pin
Dennis B. Muth6-Jul-23 19:41
Dennis B. Muth6-Jul-23 19:41 
AnswerRe: All digits in string after W Pin
Richard MacCutchan6-Jul-23 22:01
mveRichard MacCutchan6-Jul-23 22:01 
AnswerRe: All digits in string after W Pin
Richard Deeming6-Jul-23 22:01
mveRichard Deeming6-Jul-23 22:01 
GeneralRe: All digits in string after W Pin
jschell7-Jul-23 11:49
jschell7-Jul-23 11:49 
GeneralRe: All digits in string after W Pin
Richard Deeming9-Jul-23 21:16
mveRichard Deeming9-Jul-23 21:16 
GeneralRe: All digits in string after W Pin
jschell10-Jul-23 3:34
jschell10-Jul-23 3:34 
QuestionCURL POST request in VB.NET (json) Pin
Member 118569042-Jul-23 20:02
Member 118569042-Jul-23 20:02 
AnswerRe: CURL POST request in VB.NET (json) Pin
Andre Oosthuizen3-Jul-23 0:38
mveAndre Oosthuizen3-Jul-23 0:38 
GeneralRe: CURL POST request in VB.NET (json) Pin
Member 118569043-Jul-23 22:37
Member 118569043-Jul-23 22:37 
GeneralRe: CURL POST request in VB.NET (json) Pin
Andre Oosthuizen3-Jul-23 23:22
mveAndre Oosthuizen3-Jul-23 23:22 

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.