Looking for the best way to use ExecuteScalar()
问题 This code works. It's based on some code I found on the internet. Can you tell me if the coding is the best way to get a scalar value and if there is a better way can you show coding samples? Dim objParentNameFound As Object TextBoxParentsName.Text = "" If TextBoxParentID.Text <> "" Then ' Display the parent's name using the parent ID. ' Dim strSqlStatement As String = "Select FatherName " & _ "From Parents " & _ "Where ID = @SearchValue" ' Set up the sql command and lookup the parent. '