Click here to Skip to main content
15,900,258 members
Home / Discussions / Database
   

Database

 
GeneralRe: Newbie GROUP BY question Pin
Colin Angus Mackay4-May-05 11:57
Colin Angus Mackay4-May-05 11:57 
GeneralRe: Newbie GROUP BY question Pin
moredip4-May-05 12:11
moredip4-May-05 12:11 
GeneralRe: Newbie GROUP BY question Pin
Colin Angus Mackay4-May-05 12:13
Colin Angus Mackay4-May-05 12:13 
GeneralAverage formula with SQL table Pin
Joey Picerno4-May-05 10:20
Joey Picerno4-May-05 10:20 
GeneralRe: Average formula with SQL table Pin
Colin Angus Mackay4-May-05 11:42
Colin Angus Mackay4-May-05 11:42 
GeneralRe: Average formula with SQL table Pin
Joey Picerno4-May-05 15:33
Joey Picerno4-May-05 15:33 
GeneralRe: Average formula with SQL table Pin
Joey Picerno4-May-05 15:45
Joey Picerno4-May-05 15:45 
GeneralRe: Average formula with SQL table Pin
Colin Angus Mackay4-May-05 19:33
Colin Angus Mackay4-May-05 19:33 
You need to also tell the command about the connection. At the moment the command doesn't know what connection to use. Use:
cmd = New SqlCommand("SELECT AVG(Attendance) FROM tblAttendance", conn)


Also, the next problem you are going to have is this line:
str = cmd.ExecuteReader().ToString() 
That line will not return the result that you want. You should use the following instead:
str = cmd.ExecuteScalar().ToString();


Does this help?




My: Blog | Photos | Next SQL Presentation
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More


GeneralRe: Average formula with SQL table Pin
Joey Picerno5-May-05 3:51
Joey Picerno5-May-05 3:51 
GeneraltactDatagrid with VB.net and SQL Pin
gingesh4-May-05 8:35
gingesh4-May-05 8:35 
GeneralRe: tactDatagrid with VB.net and SQL Pin
keith maddox4-May-05 10:31
keith maddox4-May-05 10:31 
GeneralBulk Copy Tables from .net to sql Pin
Mtognetti4-May-05 4:51
Mtognetti4-May-05 4:51 
GeneralRe: Bulk Copy Tables from .net to sql Pin
MBGeorge4-May-05 20:45
MBGeorge4-May-05 20:45 
GeneralOracleHelper for testing Pin
Nizar Abdeljaoued4-May-05 4:17
Nizar Abdeljaoued4-May-05 4:17 
GeneralDumb Q: C++, a DB and regional settings Pin
CherezZaboro4-May-05 3:50
CherezZaboro4-May-05 3:50 
GeneralRe: Dumb Q: C++, a DB and regional settings Pin
Colin Angus Mackay4-May-05 4:14
Colin Angus Mackay4-May-05 4:14 
GeneralCreate table Pin
vuthaianh3-May-05 18:11
vuthaianh3-May-05 18:11 
GeneralRe: Create table Pin
Christian Graus3-May-05 18:25
protectorChristian Graus3-May-05 18:25 
GeneralRe: Create table Pin
Yulianto.3-May-05 18:30
Yulianto.3-May-05 18:30 
GeneralJoined Subquery in Access 2002 Pin
Larsenal3-May-05 17:40
Larsenal3-May-05 17:40 
GeneralRe: Joined Subquery in Access 2002 Pin
zheke4-May-05 17:43
susszheke4-May-05 17:43 
GeneralRe: Joined Subquery in Access 2002 Pin
Larsenal4-May-05 18:32
Larsenal4-May-05 18:32 
Questionwhat you suggest Pin
Anonymous3-May-05 10:34
Anonymous3-May-05 10:34 
AnswerRe: what you suggest Pin
Yulianto.3-May-05 17:53
Yulianto.3-May-05 17:53 
AnswerRe: what you suggest Pin
Colin Angus Mackay3-May-05 22:40
Colin Angus Mackay3-May-05 22:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.