你好我是oracle和vb.net的新手。我爲這個應用程序使用vb.net。 我如何將功能的結果從GetMaterial
和GetDescription
傳遞到功能GetDate
? 我該怎麼辦?通過vb.net參考
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
什麼是ListBox1和bdp1參數?你願意詳細說明它的目的嗎? – Edper
我要顯示的項目是通過函數GetMaterial在某些代碼中按功能進行搜索GetDate – Husna5207
您是否想從「abc」表中獲取記錄,並且用戶是否有該選項通過設備,lpt和設備還是tran_dttm?或者這3個函數會按順序執行? – Edper