| | |
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 .net2008 2008 access add advanced application array assignment basic beginner box browser button buttons center click code combo convert cpu cuesent data database datagrid datagridview datetimepicker designer dissertation dissertations dissertationtopic dosconsolevb.net eclipse editvb.net employees excel exists firewall forms html images isnumericfuntioncall listview map math memory mobile module msaccess mssqlbackend mysql navigate net number opacity open pan pdf picturebox picturebox2 port position print printpreview record regex reuse right-to-left save search serial settings socket sorting sqldatbase sqlserver storedprocedure temp textbox timer transparency txttoxmlconverter upload useraccounts usercontol vb vb.net vb.nettoolboxvisualbasic2008sidebar vba vbnet vista visual visualbasic visualbasic.net visualstudio.net web wpf wrapingcode xml





