01.
Private
Sub
Button4_Click(sender
As
Object
, e
As
EventArgs)
Handles
Button4.Click
02.
Try
03.
If
objConn.State = ConnectionState.Closed
Then
04.
ConDB()
05.
Else
06.
End
If
07.
08.
strSQL =
"SELECT * FROM bb_report WHERE rpt_id=1;"
09.
With
objCmd
10.
.Connection = objConn
11.
.CommandText = strSQL
12.
.CommandType = CommandType.Text
13.
End
With
14.
Dim
myData
As
MySqlDataReader
15.
myData = objCmd.ExecuteReader
16.
myData.Read()
17.
18.
Dim
rfile
As
Byte
() = myData(
"rpt_file"
)
19.
File.WriteAllBytes(
"D:\rfileCR.rpt"
, rfile)
20.
21.
System.Diagnostics.Process.Start(
"D:\rfileCR.rpt"
)
22.
Catch
ex
As
Exception
23.
MessageBox.Show(ex.Message.ToString)
24.
End
Try
25.
End
Sub