Created
August 28, 2012 23:39
-
-
Save cloudflying/3505358 to your computer and use it in GitHub Desktop.
grab a single value from sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Using conn As New SqlConnection(connectionString) | |
Using cmd As New SqlCommand | |
With cmd | |
.Connection = conn | |
.CommandText = "SELECT value FROM table;" | |
.Connection.Open() | |
Dim var as string = .ExecuteScalar() | |
.Connection.Close() | |
End With | |
End Using | |
End Using |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment