Staff
Good night, based on the code below am the following issues:
1) The opening screen of the database login, password to verify the claims that must be done?
2) And how should I do to refresh when the user presses, he update the report?
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim frm As New Form2
frm.Show()
End Sub
End Class
Public Class Form2
Private Sub crptempresas_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles crptempresas.Load
Dim dbstrconexao As String = "User ID=system;Password=fernanda;Data Source=ORCL;"
Dim dbcnnconexao As New OracleConnection
Dim dbcmdconexao As New OracleCommand
Dim dbdstconexao As New DataSet
Dim telarpt As New relempresascrp
dbcnnconexao.ConnectionString = dbstrconexao
Try
dbcnnconexao.Open()
Catch ex As Exception
MessageBox.Show(ex.Message, " Erro 1 ", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
Try
dbcmdconexao.Connection = dbcnnconexao
With dbcmdconexao
.CommandText = "BUSCAPORCEP"
.CommandType = CommandType.StoredProcedure
.Parameters.Add("CEP_ID", OracleType.NVarChar, 8).Value = Form1.TextBox1.Text.ToString
.Parameters(0).Direction = ParameterDirection.Input
.Parameters.Add("EMPRESAS_C", OracleType.Cursor)
.Parameters(1).Direction = ParameterDirection.Output
End With
Try
Dim dbadpconexao As New OracleDataAdapter(dbcmdconexao)
dbadpconexao.Fill(dbdstconexao)
telarpt.SetDataSource(dbdstconexao.Tables(0))
crptempresas.ReportSource = telarpt
Catch ex As Exception
MessageBox.Show(ex.Message, " Erro 2 ", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
Catch ex As Exception
Console.WriteLine(ex.Message)
End Try
dbcmdconexao.Dispose()
dbcnnconexao.Close()
dbcnnconexao.Dispose()
End Sub
End Class