Sum Total in ADO.Net?

S

Sam

Questions?
----------
Sum Amount into GrandTotal
==========================
- How do I perform total for amount?
- Do I need to perform While Do to sum all record of amount?


Data / Record > 15MB
====================
- I notice that I could use large data / record load one time. Second time
will result dns error or prompt for username and password. Why?
- Any solution for load large data / record via ADo.Net and ASP.Net?


Coding
------
Dim connectionString As String = "server='SQLSVR'; user id='SQL';
password='SQL'; Database='ERP'"
Dim sqlConnection As System.Data.SqlClient.SqlConnection = New
System.Data.SqlClient.SqlConnection(connectionString)
Dim queryString As String = "Select GLDOC, GLDCT, gldate, GLEXA, GLEXR,
account_num, amount from FY2003"
Dim sqlCommand As System.Data.SqlClient.SqlCommand = New
System.Data.SqlClient.SqlCommand(queryString, sqlConnection)

sqlConnection.Open

Dim dataReader As System.Data.SqlClient.SqlDataReader =
sqlCommand.ExecuteReader(System.Data.CommandBehavior.CloseConnection)

Rpt_GL_DataGrid.DataSource = dataReader
Rpt_GL_DataGrid.DataBind()

sqlConnection.Close
 
M

Miha Markic [MVP C#]

Sam said:
Questions?
----------
Sum Amount into GrandTotal
==========================
- How do I perform total for amount?
- Do I need to perform While Do to sum all record of amount?

If you have data in DataTable you could use its Compute method.
Data / Record > 15MB
====================
- I notice that I could use large data / record load one time. Second time
will result dns error or prompt for username and password. Why?
- Any solution for load large data / record via ADo.Net and ASP.Net?

Try closing the reader after DataBind.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top