wonder_gal
Active member
- Joined
- Jun 5, 2006
- Messages
- 34
- Programming Experience
- 1-3
Hi, I received this error "No default member found for type 'Guid'." when I execute my program.
[/COLOR]
The highlighted line is the statement where the error occured at. I've
tested my SQL statements, it really contains a single record.
Can someone please kindly explain to me why am I getting this error here? Thanks alot.
VB.NET:
db = New SqlConnection(GetConnectionString())
db.Open()
Dim strSQL As String
strSQL = "SELECT GUID FROM MyLog WHERE MyID = '" & strID & "'"
strGUIDTracker = GetSingleData(strSQL)
..................
Function GetSingleData(ByVal sqlText As String) As String
Dim sd As String
Dim oConn As SqlConnection
oConn = New SqlConnection(GetConnectionString())
Dim strSQLCmd As SqlCommand = New SqlCommand(sqlText, oConn)
strSQLCmd.Connection.Open()
[B]sd = strSQLCmd.ExecuteScalar(System.Data.CommandBehavior.CloseConnection)[/B]
Return sd
End Function
[FONT=verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif][/FONT]
[COLOR=Black]
The highlighted line is the statement where the error occured at. I've
tested my SQL statements, it really contains a single record.
Can someone please kindly explain to me why am I getting this error here? Thanks alot.