943,917 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Unsolved
  • Views: 21325
  • VB.NET RSS
Apr 28th, 2004
0

Sql Query

Expand Post »
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.
Similar Threads
Reputation Points: 7
Solved Threads: 0
Newbie Poster
Tellie is offline Offline
11 posts
since Apr 2004
Apr 29th, 2004
0

Re: Sql Query

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).
Moderator
Reputation Points: 322
Solved Threads: 28
The C# Man, Myth, Legend
Tekmaven is offline Offline
914 posts
since Feb 2002
Nov 12th, 2008
0

Re: Sql Query

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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
bruce2424 is offline Offline
23 posts
since Jun 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in VB.NET Forum Timeline: OOLEDB Connection(vb.net & Access)
Next Thread in VB.NET Forum Timeline: linking two combo boxes





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC