-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfetch.vb
30 lines (29 loc) · 1021 Bytes
/
fetch.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Imports System.Data.SqlClient
Public Class Fetch
Dim mastercon As New appInfo
Dim mycon As String = mastercon.sqlCon
Dim db As String = mastercon.database
Dim con As New SqlConnection
Public Function getIdPloio(ByVal onomaPloio As String) As String
Try
Dim reader As SqlDataReader
con.ConnectionString = mycon
Dim userlog_cmd As New SqlCommand("select * from " & db & ".ploio where onomaPloioy='" & onomaPloio & "'", con)
con.Open()
' ***EKTELESH QUERY ARXH
reader = userlog_cmd.ExecuteReader()
If reader.Read Then
Return reader.Item("idPloio")
Exit Function
End If
reader.Close()
con.Close()
Catch ex As Exception
con.Close()
MsgBox("fetch--getIdPloio-1-" & ex.Message)
Finally
con.Close()
End Try
Return "NON"
End Function
End Class