您好,我是 oracle 和 vb.net 的新手。我正在为这个应用程序使用 vb.net。我将如何将函数的结果从函数传递GetMaterial
到GetDescription
函数GetDate
?我应该怎么办 ?
Private Function GetMaterial(ByVal strMaterial As String) As DataSet
Dim connectionString As String = "Data Source = ***; User ID = *****; Password = ***;"
Dim sqlConnection As OracleClient.OracleConnection = New OracleClient.OracleConnection(connectionString)
Dim queryString As String = "select * from abc where device = 'xyz' "
Dim sqlCommand As OracleClient.OracleCommand = New OracleClient.OracleCommand(queryString, sqlConnection)
sqlCommand.CommandTimeout = 0
Dim dataAdapter As OracleClient.OracleDataAdapter = New OracleClient.OracleDataAdapter(sqlCommand)
Dim dataSet As DataSet = New DataSet
dataAdapter.Fill(dataSet)
Return dataSet
End Function
Private Function GetDescription(ByVal strMaterial As String, ByVal ListBox1 As String) As DataSet
Dim connectionString As String = "Data Source = ***; User ID = ***; Password = ***;"
Dim sqlConnection As OracleClient.OracleConnection = New OracleClient.OracleConnection(connectionString)
Dim queryString As String = "select * from abc where lpt = '" & ListBox1 & "' and device = '" & strMaterial & "'"
Dim sqlCommand As OracleClient.OracleCommand = New OracleClient.OracleCommand(queryString, sqlConnection)
sqlCommand.CommandTimeout = 0
Dim dataAdapter As OracleClient.OracleDataAdapter = New OracleClient.OracleDataAdapter(sqlCommand)
Dim dataSet As DataSet = New DataSet
dataAdapter.Fill(dataSet)
Return dataSet
End Function
Private Function GetDate(ByVal strMaterial As String, ByVal ListBox1 As String, ByVal bdp1 As String) As DataSet
Dim connectionString As String = "Data Source = ***; User ID = ***; Password = ***;"
Dim sqlConnection As OracleClient.OracleConnection = New OracleClient.OracleConnection(connectionString)
Dim queryString As String = "select * from abc where tran_dttm <= to_date('1/31/2012','MM-DD-YYYY') and tran_dttm > to_date('1/30/2012','MM-DD-YYYY')"
Dim sqlCommand As OracleClient.OracleCommand = New OracleClient.OracleCommand(queryString, sqlConnection)
sqlCommand.CommandTimeout = 0
Dim dataAdapter As OracleClient.OracleDataAdapter = New OracleClient.OracleDataAdapter(sqlCommand)
Dim dataSet As DataSet = New DataSet
dataAdapter.Fill(dataSet)
Return dataSet
End Function