Jump to content
Xtreme .Net Talk

Recommended Posts

  • *Experts*
Posted

As far as the SQL code goes, in all the databases I've worked with you must have the FROM before the WHERE clause. If the alias is for the column, you need to move that, too. See this:

Change:
SELECT SUM(nec_amo) where nec_type = 'Food' As total from nec
To:
SELECT SUM(nec_amo) As total from nec where nec_type = 'Food'

 

As far as the .NET code, that's harder to tell. There are lots of assumptions to make - for example, is daNamePhone declared to be a DataAdapter or some derived type?

 

I hope this is sample code as I'm not sure how the name daNamePhone, which implies something about a name and a phone, relates to the query which appears to be the sum of something based on a food. :)

 

-ner

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...