DataSource Controls :: Calculate The Slope Of A Dataset?
May 19, 2010
I have a certain report I want to make where I want to calculate the slope of a dataset(turnover column) following the formula:
SumXY-MeanY*SumX / SumXX-MeanX*SumX
In order to do that the X-range has to be an integer from 1 to the last datarow. In my report I get this exact number with the rownumber(nothing) formula. But it seems I can't calculate with it in the expression for the slope because it gives errors:
how do i copy required row in dataset to a new dataset. i have bind a xml into a dataset and i need to display say row 3 to 5 only so i do a for loop but i have encounter problem when trying to copy the rows to a new dataset.
do i have to write the xml to datatable and bind it to dataset and from there copy over ?
I have a table that contain the votes(publicVotes) against each contestant. Now what i am trying to do is to calculate the percentage of votes each contestant recieved according to the column SchedularID. how i can get it done and would it be easy to user store procedure or view?
I have problem like to count the repeated chars from a string using sql server.Also i have used functions in sql server thats working fine.But i want the solution using a sql query...
[i have a column like ID,name,Secure_name],here 1 ,'kamal','welcome'.so findout 'e' howmany times repeated in a column secure_name.....
I need financial year in system date.actually i calculate financial year like below in VB code. [Code].... i just like the same in sql server query.for example suppose my query like"select*from admission where std_code=1 and fnyr in (select finy in system date)"<---i need here.
We have a demand system where customer can demand the quantity they want for a particular deal.
For each demand they submit, a new record is added to the DealDemandRequest table with the CustomerID, DealID, Quantity
I want to be able to to calculate the total quantity demanded by a particular customer. Current I query the DealDemandRequest table for all the records by a particular customer and then do a sum of the Quanity column.
However, we are expecting this table to be over 1 million record and it is reallly really slow right now.. Any better ways?
my code is calculate to current rowafter update quantity but other rows don't affect and not calculate i need to calculate all rows i think i need to use for loops but i dont know how to do it
I am trying to calculate the total amount of shopping cart by multiplying the quantity with the product price and then sum up the sub results.I am doing this but it does not make the multiplication.
[Code]....
decimal? TotalAmount = (from shopCart in dc.KP_ShoppingCarts
I had just started with Visual Studio 2008 + VB.net. I've now designed my tables, and basic gridview functions properly.Now I'm faced with the problem of having to calculate a value based on 2 - 3 columns/data in the gridview, display the result in an existing column in the same gridview, and saving the calculated value in the datasource.I had initially created the "Total" column as a textbox displaying a manually calculated amount that is saved in the datasource. Now, I want to change the field to auto-calculate based on 2 other columns.
In myapp, I can create two datasets: [dstServer1] and [dstServer2]. They are coming from two tables which are in two different SQL server: [Order1] (in server1) and [Order2] (in server2). These two tables have the same data structure. How to code to compare two dataset and then insert difference into another table without using linked server?
I have a problem, I need to get a date from an SQL database using a dataset.xsd.
To do that, I have created a query in the TableAdapter called GetDataByFecha:
SELECT fecha FROM T_Tickets WHERE(fecha = @fecha)
in C# I do this:
DateTime T_fecha;
T_fecha = Convert.ToDateTime(ticketsAdapter.GetDataByFecha(fechaTicket)); but, when I compile it I get this error: cannot convert a 'T_TicketsDataTable' object to 'System.IConvertible' type.
I have dataset which is called at page load event. Also every time i clicked on refresh it will call refresh function where it store updated values from database.
Now I want only updated fields row and want to store into datatable or another dataset.
I dont want to cmp each and every iteration of the dataset. I used Getchanges() of dataset but not working.
string studentno = "select regno from stu_ref where batch='" + dropbatch.SelectedItem.ToString() + "'"; SqlDataAdapter dastudent = new SqlDataAdapter(studentno, cn1); DataSet dsstudent = new DataSet();[code]....
form the above coding i will get all values form the table stu_ref of regno of student now i need to get the first and the last regno from the table