User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the VB.NET section within the Software Development category of DaniWeb, a massive community of 391,133 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,171 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our VB.NET advertiser:
Views: 2000 | Replies: 0
Reply
Join Date: Apr 2007
Posts: 10
Reputation: wonder_gal is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
wonder_gal wonder_gal is offline Offline
Newbie Poster

Error Retrieving Single Data Using ExecuteScalar Method

  #1  
Apr 12th, 2007
Hi, I receive this error "No default member found for type 'Guid'." when I run my application.

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()
        sd = strSQLCmd.ExecuteScalar(System.Data.CommandBehavior.CloseConnection)
        Return sd
    End Function

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.
AddThis Social Bookmark Button
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb VB.NET Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the VB.NET Forum

All times are GMT -4. The time now is 6:29 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC