I have a GUID (varchar(50,notnull) in sql) That I am returning from SQL via ExecuteScalar() in VB I am storing that value in a string (max of 2gb) in VB I then run a select where GUID = Stored GUID
When i run the program it looks like it trucates the GUID Sample {3F2504E0-4F89-11D3-9A0C-0305E82C3301}
Sampele Error The floating point value '3F2504E0' is out of the range of the computer representation (8bytes)
Is my executeScalar truncating this info?
Code:
Dim sqlquery As String
Dim ConnectionString As String
If cmboxDatabaseName.Text <> "" Then
ConnectionString = "Server=" + ServerName + "\" + InstanceName + "; Database=" + Control + "; User Id=" + UserId + ";Password=" + Password + ";"
sqlquery = "Select top 1 GUID from dbo.Databases with(Nolock) where dbName = '" + cmboxDatabaseName.Text + "'"
'Connect
Using conn As SqlConnection = New SqlConnection(ConnectionString)
conn.Open()
Using comm As SqlCommand = New SqlCommand(sqlquery, conn)
Hosted_GUID = comm.ExecuteScalar()
conn.Close()
End Using 'comm
conn.Close()
End Using 'conn