[dba-Tech] VS.NET equivalent of single-row form

Bobby Heid bheid at sc.rr.com
Sun Mar 9 17:21:44 CDT 2008


Arthur,

Comments in-line.

Bobby

-----Original Message-----
From: dba-tech-bounces at databaseadvisors.com
[mailto:dba-tech-bounces at databaseadvisors.com] On Behalf Of Arthur Fuller
Sent: Sunday, March 09, 2008 9:53 AM
To: Discussion of Hardware and Software issues
Subject: Re: [dba-Tech] VS.NET equivalent of single-row form

<snip>

>Anyway, I'm way ahead of myself here. I just need to open the Solution form
>on the right solution (identified by ProblemID), and to detect before I
open
>the form whether there is a solution -- a simple SELECT COUNT(*) but I'm
not
>sure how to code that and obtain the result in a variable for inspection so
>I can act accordingly.

Look at the ExecuteScalar method on the Database object you are using.  This
method returns a scalar value from a stored procedure.  The ExecuteNonQuery
method calls the sproc, but does not expect a return value.  You can get
still get values back from the sproc if you used OUT parameters.  If you
want to return a recordset, you use the ExecuteReader method and then access
the individual rows of the dataset returned via a DataReader object.

I have used the MS Data Access Block, which to me, helps simply the data
access in a mostly back-end agnostic way.

>One more question: can I mix languages in a single module? e.g. write one
>method in C# and another in VB and a third in Python? Not that I'd want to,
>necessarily, it's more a theory question.

Yes, if they are in different assemblies.  I think, but am not sure that
they would have to be in different projects.  But, you can have multiple
projects under one solution.

>TIA,
>Arthur






More information about the dba-Tech mailing list