Does anybody know how to call a sql with a compute clause in C#? I got internal error 30016. my Database is sybase 12.5.4.
A:
without more info, your best bet is to wrap it in a stored procedure, and just call that from C#
KM
2009-07-28 13:55:15
A:
the stored procedure does not for me because the sql is dynamic sql. But I don't know why ADO.NET does not support this.
Southsouth
2009-07-28 14:00:45
This is not an answer, just extra information. However, you should edit your question and include this there...
KM
2009-07-28 14:28:08
A:
I don't see the reason why you couldn't just inline the SQL.
SqlCommand cmd = connection.CreateCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = "SELECT SalesPersonID, CustomerID, OrderDate, SubTotal, TotalDue " +
"FROM Sales.SalesOrderHeader " +
"ORDER BY SalesPersonID, OrderDate " +
"COMPUTE SUM(SubTotal), SUM(TotalDue) BY SalesPersonID";
A:
I did the same way, but When call Adaper.Fill() I got internal error 30016
Southsouth
2009-07-28 14:26:16