I am getting this error trying to sum a column. The column was
originally imported as text. I am attempting to convert it and then sum
it. I get this error on the compute method. I need a way to do this if
there is an easy or better method please help.
//Create a string to represent our SQL query
string SelectCommand6 ="select How_Many_Media from
Pilots Where App_Recd = 'Y' and How_Many_Media = 'Y'";
//Create our SqlDataAdapter - required to fill a
DataSet
SqlDataAdapter myDataAdapter6 = new
SqlDataAdapter(SelectCommand6, myConnection);
//Fill the DataSet and name the newly created
DataTable "Pilots"
myDataAdapter6.Fill(myDataSet6, "Pilots");
DataTable myTable;
myTable = myDataSet6.Tables["Pilots"];
// Declare an object variable.
TotalHowManyMedia =
myTable.Compute("Sum(Convert.ToInt32('How_Many_Media'))").ToString();
Get this error on this line: Error: No overload for method 'Compute'
takes '1' arguments
[Non-text portions of this message have been removed]
------------------------ Yahoo! Groups Sponsor --------------------~-->
<font face=arial size=-1><a
href="http://us.ard.yahoo.com/SIG=12h3dubok/M=362131.6882499.7825260.1510227/D=groups/S=1705007709:TM/Y=YAHOO/EXP=1122871528/A=2889191/R=0/SIG=10r90krvo/*http://www.thebeehive.org
">Get Bzzzy! (real tools to help you find a job) Welcome to the Sweet Life
- brought to you by One Economy</a>.</font>
--------------------------------------------------------------------~->
|