| | |
Sql Query
Please support our VB.NET advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
![]() |
•
•
Join Date: Apr 2004
Posts: 11
Reputation:
Solved Threads: 0
Hi All
I have a select statement:
Select PERMISSION_BUTTON_ID from ALC_SECURITY_PERMISSION where ROLE_ID = 1
Now I want to store / retrieve the values of the field that I am querying without using dataset. Is this possible? If yes how can I do this?
Is it possible that I declare a variable Array and store the output.
I have a select statement:
Select PERMISSION_BUTTON_ID from ALC_SECURITY_PERMISSION where ROLE_ID = 1
Now I want to store / retrieve the values of the field that I am querying without using dataset. Is this possible? If yes how can I do this?
Is it possible that I declare a variable Array and store the output.
Well, if it's only one value that your going to be returned, you can use the .ExecuteScalar, which returns an Object (the first row, first column of your query).
-Ryan Hoffman
.NET Specialist / Webmaster, Extended64.com.
Please do not email or PM me with support questions. Please direct them to the forums instead.
.NET Specialist / Webmaster, Extended64.com.
Please do not email or PM me with support questions. Please direct them to the forums instead.
•
•
Join Date: Jun 2008
Posts: 23
Reputation:
Solved Threads: 0
You can retrieve data from database without using dataset .
cnn.Open()
cmd = New SqlCommand(sql, cnn)
Dim count As Int32 = Convert.ToInt32(cmd.ExecuteScalar())
cmd.Dispose()
cnn.Close()
http://vb.net-informations.com/ado.n...sqlcommand.htm
bruce
cnn.Open()
cmd = New SqlCommand(sql, cnn)
Dim count As Int32 = Convert.ToInt32(cmd.ExecuteScalar())
cmd.Dispose()
cnn.Close()
http://vb.net-informations.com/ado.n...sqlcommand.htm
bruce
![]() |
Similar Threads
- sql query problem with MS Access and C# (C#)
- Urgent Help with SQL Query (MySQL)
- C# VS 2005 - SQL Query Parameters to an ODBC DataSource (C#)
- sql query updating problem (Visual Basic 4 / 5 / 6)
- Javascript array from sql query (JSP)
- Please help me out with MySQL query (MySQL)
- PHP/SQL query help (PHP)
- Retreiving variables from a sql query into a form (PHP)
Other Threads in the VB.NET Forum
- Previous Thread: OOLEDB Connection(vb.net & Access)
- Next Thread: linking two combo boxes
| Thread Tools | Search this Thread |
"crystal .net .net2005 30minutes 2008 access add application arithmetic array assignment basic beginner box button buttons click code combo component connectionstring convert cpu cuesent data database databasesearch datagrid datagridview datetimepicker design designer dissertation dissertations dissertationthesis dosconsolevb.net editvb.net exists firewall folder forms html image images isnumericfuntioncall listview math mobile module mssqlbackend mysql navigate number opacity open peertopeervideostreaming picturebox1 picturebox2 port print printpreview problemwithinstallation project record regex reports" reuse right-to-left savedialog serial settings socket sqldatbase sqlserver storedprocedure string temp textbox timer txttoxmlconverter updown useraccounts usercontol usercontrol vb vb.net vb.netcode vb.nettoolboxvisualbasic2008sidebar vbnet view vista visual visualbasic visualbasic.net visualstudio visualstudio.net web wpf wrapingcode xml





