Re: Using MS SQL Function in VB.Net 2003

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi Nick,

Thanks for the reply, but my question was exactly what you assume I already
know... I'm new to Visual Basic coding, and though I have a number of books
and resources at hand, often times a simple problem like this eludes me.

What I'm looking for is a snippet or example of code showing how to execute
a SQL command in a class, then store the output in a variable. In this
instance I am using a function which returns a single integer, but you're
correct in staying the same snippet would work with any SQL statement which
only returned one value. This is the missing piece I need... I don't know
how to do this, and any assistance from you or anyone else would be much
appriciated.

Thanks again, and take care --

Alex

"Nick Chan" <zzzxtreme@xxxxxxxxx> wrote in message
news:1189566214.910908.315550@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi alex, i do not know the 'expert' way
i call the function using "SELECT dbo.RetrieveGroupID(44)"
im sure u know the way to retrieve Selects

On Sep 12, 6:32 am, "Alex" <sama...@xxxxxxxxx> wrote:
Hi...

I'm rather new to VB.Net, so please forgive the elementary question. I'm
trying to use an MS SQL 2005 Function from within my VB.Net 2003 code,
and
as simple as might be, I'm unable to find any snippet of code that shows
me
how to do this.

The function is this 'RetrieveGroupID(@UserID)' and if for example
someone
uses 'RetrieveGroupID(44)' it will return the GroupID for User Number 44.

This application is using web forms, and the UserID is stored in the
session, so I have this already. My problem is I'm not sure how to
actually
run the Function then store the output as a variable.

Can someone point me to examples or a how-to showing this?

Thanks --

Alex




.



Relevant Pages

  • Re: Problems with querying date field
    ... >> If you want to put a database somewhere for safekeeping, ... database - SQL isn't about persistence, ... says nothing about the physical storage media to be used. ... store data on a tape, or a disk, or a CD, or a file, or any physical ...
    (microsoft.public.sqlserver.programming)
  • Re: Should I place a Domain controller in each of the 40 stores?
    ... They should be able to do that, one common way is to use a SQL account in an mixed SQL authentication enviroment where the Apps use a dedicated local SQL account to connect to the DB, but again the app may work differently. ... Also note that although it is possible, it's NOT recommended to cluster for example a SQL server that is also a DC. ... We plan to place a SQL server in each store as part of a new POS ... implementation and also migrate to XP Embedded for the POS terminals. ...
    (microsoft.public.windows.server.active_directory)
  • Re: Need Aggregate Query Help!!!
    ... else than what I am suggesting. ... I was using Access SQL with JET backend. ... (SELECT EmpName, Store, SUM(Qty) ... GROUP BY EmpName, Store) as B ...
    (microsoft.public.access.queries)
  • Re: Ken or Doug? -- another SQL syntax stumper
    ... If I recall from our other thread, you're building an SQL in code right? ... this snippet is part of the text string that you're building? ... > WITH OWNERACCESS OPTION; ... >> and stuff from just a snippet. ...
    (microsoft.public.access.formscoding)
  • Re: Problem with PR_ENTRY_ID and uniqueness
    ... have to define a huge column width for SQL column. ... two pieces and store each independently. ... intend to save more than one Exchange Server Store ... One last thing about Exchange Re-Using EntryIDs. ...
    (microsoft.public.win32.programmer.messaging)