leeds2000
asked on
A easy function question
Ok, i know, i never remember HOW to place a function inside a button or similiar
How do i "call" this function inside a button?
How do i "call" this function inside a button?
Public Function finnOrdrenr() As Integer
Dim forbindelse As New System.Data.OracleClient.OracleConnection
forbindelse.ConnectionString = "user id=****;password=***;data source=*****"
forbindelse.Open()
Dim kommando As New System.Data.OracleClient.OracleCommand("select ordrner from", forbindelse)
Dim dataleser As OracleClient.OracleDataReader
dataleser = kommando.ExecuteReader()
Dim onr As Integer
While dataleser.Read()
onr = dataleser.GetInt32(0)
End While
dataleser.Close()
forbindelse.Close()
Return onr
End Function
ASKER
Uhm, will this return the number i get inside the variable "onr" then?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
msgbox (finnOrdrenr())
or just write
finnOrdrenr()