I tried to use Activex Control But I get error that "
I Tried Below Code :
AxAcroPDF a = new AxAcroPDF();
axAcroPDF1.CreateControl();
a.LoadFile(Application.StartupPath + "\\Reports\\");
a.Show();
axAcroPDF1.CreateControl();
a.LoadFile(Application.StartupPath + "\\Reports\\");
a.Show();
I Got Error-
How to fix it error that Sysytem.windows.form AxHost.InvalidActiveXStateException " was through
If There Is any other option Then plz tel me.
Boris TukaricPosted Mar 8, 2016, 12:50 AM
Lisa WhitePosted Mar 7, 2016, 8:28 PM
Boris TukaricPosted Mar 7, 2016, 4:31 AM
Dipankar BiswasPosted Aug 4, 2014, 5:56 AM
your ans:
Open new project>
you need
1 TextBox
1 Button
then go toolbox>
Rightclick>
Choose Item>
then you will show this dialog box
select >Adobe PDF Reader
>OK
Like this...
>>>code
Result:...
Thanks
Dipankar Biswas
Dipika WaniPosted Aug 4, 2014, 3:01 AM
Dipankar BiswasPosted Aug 4, 2014, 1:59 AM
store this path into database like this
upload path..
like this:
Private Sub btn_brs_mat_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_brs_mat.Click
OpenFileDialog1.ShowDialog()
file = OpenFileDialog1.FileNames
txt_up_math_qus.Text = file(0)
'ComboBox2.Text = System.IO.Path.GetFileName(OpenFileDialog1.FileName)
End Sub
Inserted code:
If Not conn.State = ConnectionState.Open Then
conn.Open()
End If
cmd.Connection = conn
cmd.CommandText = "insert into Qus_upload_tbl(Subject_1,Subject_2,Subject_3,Subject_4,Subject_5,Date_Time)" & _
" Values('" & Me.txt_up_math_qus.Text & "','" & Me.txt_up_Reasoning_qus.Text & "','" & Me.txt_up_english_qus.Text & "','" & Me.txt_up_banking_qus.Text & "','" & _
Me.txt_up_computer_qus.Text & "','" & Me.txt_date.Text & "') "
cmd.ExecuteNonQuery()
'refrash data
RefreshData()
'close
conn.Close()
Show: Code
Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick
Dim i As Integer
i = DataGridView1.CurrentRow.Index
'Me.AxAcroPDF1.src = DataGridView1.Item(0, i).Value
If Me.DataGridView1.CurrentCell.ColumnIndex = 1 Then
Me.AxAcroPDF1.src = DataGridView1.Item(1, i).Value
End If
If Me.DataGridView1.CurrentCell.ColumnIndex = 2 Then
Me.AxAcroPDF1.src = DataGridView1.Item(2, i).Value
End If
If Me.DataGridView1.CurrentCell.ColumnIndex = 3 Then
Me.AxAcroPDF1.src = DataGridView1.Item(3, i).Value
End If
If Me.DataGridView1.CurrentCell.ColumnIndex = 4 Then
Me.AxAcroPDF1.src = DataGridView1.Item(4, i).Value
End If
If Me.DataGridView1.CurrentCell.ColumnIndex = 5 Then
Me.AxAcroPDF1.src = DataGridView1.Item(5, i).Value
End If
End Sub
its a simple ,but are u know how to show data from database????
if you know.. then its simple..