| | |
Error Retrieving Single Data Using ExecuteScalar Method
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Apr 2007
Posts: 10
Reputation:
Solved Threads: 0
Hi, I receive this error "No default member found for type 'Guid'." when I run my application.
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.
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 FunctionThe 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.
•
•
Join Date: Jun 2008
Posts: 23
Reputation:
Solved Threads: 0
follow the url, it explain how to ExecuteScalar
http://vb.net-informations.com/ado.n...sqlcommand.htm
http://vb.net-informations.com/ado.n...sqlcommand.htm
![]() |
Similar Threads
- Get data from Access instead of Notepad (URGENT) (C#)
- data adapter update method won't work (VB.NET)
- ExecuteRedear vs ExecuteScalar (ASP.NET)
- Error trying to perform single word searches in address bar. (Viruses, Spyware and other Nasties)
- memory management in wndows 2000 (Windows NT / 2000 / XP)
- Error: uncaught exception: Permission denied to call method XMLHttpRequest.open (HTML and CSS)
- Login and retrieve user data from database (ASP.NET)
- retrieving "Data" from Listbox (VB.NET)
Other Threads in the VB.NET Forum
- Previous Thread: [HELP]RunPE
- Next Thread: [ask] data types
| Thread Tools | Search this Thread |
"crystal .net .net2005 2008 access add advanced application array assignment basic beginner box button buttons center click client code combo convert cpu data database datagrid datagridview designer dissertation dissertations dissertationthesis dosconsolevb.net editvb.net employees excel exists firewall forms html image images isnumericfuntioncall listview login map math memory mobile module msaccess mssqlbackend mysql navigate net number opacity pan picturebox picturebox2 port print printpreview record regex reports" reuse right-to-left save savedialog search serial socket sorting sql sqldatbase sqlserver storedprocedure string temp textbox timer txttoxmlconverter upload useraccounts usercontol usercontrol vb vb.net vb.nettoolboxvisualbasic2008sidebar vba vbnet vista visual visualbasic visualbasic.net visualstudio.net web winsock wpf wrapingcode xml





