Data Controls :: Calculation In Database And Gridview In VB Code

Oct 5, 2012

I have a web page in asp.net+vb code+sql database. in an table named course_intake i want to count i tried some and it works correct but i am not able to add more clouse to it

1. if date1 (field) not equal to date2 (field) then att pd as 1 else 2

2. (OY is a field)  if OY Ends is lesser than Jun then Deg Dt as 1 Jul+ OY end year (example if OY is 5 Jun 2012 then deg dt will be 1 Jul 12 else 1 Dec 12)

3. Count from COURSE_INTAKE where OY LIKE 'YO-' WHERE ENTRY_COURSE= ENTRY_COURSE 

4. Count from COURSE_INTAKE where OY LIKE 'TAKEN YO-' WHERE ENTRY_COURSE= ENTRY_COURSE

5. Count from COURSE_INTAKE where OY LIKE 'DONE' WHERE ENTRY_COURSE= ENTRY_COURSE

My code is as under

select ENTRY_course,COUNT(*) as Str,convert (varchar, DTsen,6) as [DTSEN],convert (varchar, DTCOM,6) as [DTCOM],
dbo.getBTechBECount(ENTRY_course) as 'BTECH',batch,dbo.getMedCount(ENTRY_course) as 'MED',convert (varchar,
DTCOM+396,6) as [AVL for OY], str-btech AS [STR AVL]
FROM COURSE_INTAKE group by ENTRY_course,DTCOM,dtsen,batch, str-btech ORDER BY dtcom

View 1 Replies


Similar Messages:

Data Controls :: GridView Calculation With OnChange

Oct 9, 2012

I have kept four column in gridview with dynamically added row...

E.g.

work type       rate     noofworker     amt

Groundwork    10            100        1000
Earthwork     20            100          2000

                                     Total        3000

 OnChange event to fire the calculation...

View 1 Replies

Data Controls :: Export GridView With Calculation In Footer To Excel

Feb 11, 2014

I am looking at the following article [URL] .... its converting a gridview to excel. On my gridview I have a running total on the footer, and i do know to to change the code or add code to add this to my excel document...

View 1 Replies

Data Controls :: Gridview Footer Total Calculation Not Working In Master Page

Nov 21, 2012

this is my gridview  footer calculation script, this script is working good if the aspx page is independent , when i use the same script with my asp.net master page content page that script is not working  this is my script 

what changes i have to do for apply this script to be work in my master page content page in asp.net

function GrossTotal()
{
$("[id*=GridView1]input[type=text][id*=txtCalc]").keyup(function(e) {
var price = $(this).closest('tr').find("input[type=text][id*=txtCalcPrice]").val();
var quantity = $(e.target).closest('tr').find("input[type=text][id*=txtCalcQuantity]").val();
var total = parseInt(price) * parseInt(quantity);
$(e.target).closest('tr').find("[id*=lblGrossTotal]").text(total);
});
}

View 1 Replies

Forms Data Controls :: Gridview Row_databound Calculation Error - Input String In Wrong Format?

Dec 7, 2010

I have a gridview in which i have itemtemplates and label controls having data from sql server.

I have two fields say quantity and units and in third field i want their product. I m trying in rowdatabound event like this-

[Code]....

Here my third field is netvalue.

It is throwing error-

Input string in wrong format.

How can i achieve this?

View 5 Replies

Forms Data Controls :: Calculation On RadioList Inside GridView - How To Retrieve The List Button Clicked Value

Jan 19, 2010

Here is my page:

[Code]....

It basically is 4 questions with each answer assigned a value.

What I would like to do is when the button is clicked the selected values are retrieved and calculated to give a total.

That total is then compared against some common totals and the next value is shown.

So is the total is 8= Very Good, 6= Very Bad, 4= Terrible etc.

The two labels Result and Truth would sho the numerical result and the truth according to the scale.

I am at a loss on how to retrieve the list button clicked value, how to add them up and referance that to the Truth result.

its complicated (to me its "bang head against wall" difficult.

View 17 Replies

Forms Data Controls :: Calculation On Textbox In Gridview Row - Display Total Of All Three Columns In Total Column?

Apr 7, 2010

i have one grid which have 5 columns 1 for subject,2,3,4 for marks which have textbox to insert obtained marks,and last column have one lable to display total of (2+3+4),now i want total value on textbox event,when user enter any value to any column of textbox i need to display total of all three columns in total column.

View 2 Replies

AJAX :: JavaScript Code For Age Calculation Using CalendarExtendar

Aug 22, 2013

How can i use same javascript code for age calculation from two different Ajax CalemdarExtenar?

View 1 Replies

DataSource Controls :: Correct Calculation For Avg If One Table Has No Data?

Mar 24, 2010

I currently have 3 tables and return an average value for the OverallRating Column on each to get a CombinedOverall, but what if one of the tables does not have data for a particular customer? if I divide by 3 the answer will not be the same, and I could get an answer that is over the max I want (5.0)

[Code]....

It will be possible that the Customer will not have any data in one of the tables.

How do I get around this?

View 10 Replies

Data Controls :: Age Calculation Based On Date Of Birth

Apr 27, 2016

I have 3 dropdownlist for date, month, year. When I select DOB from dropdownlist, the age should be calculated automatically and display in textbox. What can i do?

View 1 Replies

Forms Data Controls :: Decimal Place Missing After Calculation

May 11, 2010

In a formview I need to present a new value calucalted by dividing one field value by another. I need to present the result to one decimal place. The code I am using is the following, however it presents the resulting value rounded up or down to the nearest whole value:

<asp:label id=lblTotal text='<%# Convert.ToInt32(Eval("Value1")) / Convert.ToInt32(Eval("value2")) %>' runat="server"></asp:label>

I did try and insert refernces to {0:N1} but this just threw asp.net errors. Any advise on how I can guarantee that the value calculated is presented to one decimal place?

View 4 Replies

Forms Data Controls :: Footer Calculation Of Template Field?

Dec 1, 2010

I'm not sure how to do this, but I did read a lot of post and searched for it.

Protected Function GetTotal(ByVal DonTotalQty As Decimal, ByVal DonValue As Decimal)

View 5 Replies

Forms Data Controls :: Period Calculation From Dates For DetailsView?

Jan 16, 2010

I have two coloumns in a table to store Registered and Closed dates.

I want to calculate the period and to show in labels templated in detailsView.

Period should be like this:

72 Hrs and 58 minutes

View 9 Replies

Forms Data Controls :: Trying To Do A Calculation On GridView2 And Using Clientside Javascript?

Oct 10, 2010

Why am I getting this error? I'm trying to do a calculation on my GridView2 and I'm using clientside javascript. I need to add the onkeyup attribute. How do I do this?

Code Behind:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
CType(GridView2.FindControl("TextBox13"), TextBox).Attributes.Add("onkeyup", "calculateSubTotal")
End Sub

View 5 Replies

Forms Data Controls :: Edited GridForm Can Reflect A Calculation Change?

Mar 11, 2010

I am using a grid form to diplay data... the insert form is completely a separate form. In the insert form a text box called "FormPercentageTextBox" is getting a calculated result using javavascript based on some field ( field1,field2) values (val1, val2).

the problem i have is: when i edit the form and i want to update any value..i want the new calculation result showing on the edited "FormPercentageTextBox" field. I need to have this calculation reflected/

View 2 Replies

Web Forms :: How To Do Calculation Automatically Without Using Button In GridView

Sep 21, 2012

I need to do calculation of different no as shown in fig..right now i am doing addition in the normal way...adding all the values of the textboxes and thenn showig the result in the last textbox..what i want is whenever i change any value in the any textboxes it should automatically reflect the changes in the final calculation(final textbox) without using calculate button.

Below is my .aspx code

<asp:Panel ID="Panel2" runat="server" Height="387px" Width="83%">
<table style="width:108%; height: 390px;">
<tr>
<td>
<asp:Panel ID="Panel1" runat="server" Width="718px">
<table style="width:100%;">

[Code] .....

View 1 Replies

Forms Data Controls :: The Total Amount Show The Correct Calculation Result, But The String Format Dont Work?

Feb 27, 2010

my query is like this " select product_id, product_price, purchase_amout from purcases"

and on my formview i tried to add a "total purchase"

i tried using <asp:Label ID="total_purchase" runat="server" Text='<%# string.format(cint(eval("product_price")*eval("purchase_amout")),"{ Rp 0:###,###,###,###,###}")%>'>

the total amount show the correct calculation result, but the string format dont work.... so it display 20000 instead of Rp 20,000

btw. "Rp" is the currency symbol in my country... i dont use {0:c} coz the server user US currency

View 4 Replies

Forms Data Controls :: Gridview Inside Another Gridview Both Sorting - Using 3.5 Visual Studio 2008 C# Code Behind

Apr 16, 2010

I have the gridview inside another gridview, i want to sort that both gridviews, I don't know how to achieve using asp.net 3.5 visual studio 2008 c# code behind. Following are my aspx page,

<div
id="divclm"
runat="server">
<asp:GridView
ID="claimgrid"
runat="server"
AutoGenerateColumns="False" AllowSorting="True"
Width="100%"
AllowPaging="True"
CssClass="gareahead"
EmptyDataText="No Records To Display"
OnRowDataBound="claimgrid_RowDataBound"
OnRowCreated="claimgrid_RowCreated"
GridLines="Both"
OnPageIndexChanging="claimgrid_PageIndexChanging"
OnSorting="claimgrid_Sorting"
CaptionAlign="Right">
<Columns>
<asp:HyperLinkField
Text="<img id='upimg' src='Styles/Images/appschg.gif'/>"
ItemStyle-Width="10px">
<ItemStyle
Width="10px"
/>
</asp:HyperLinkField>
<asp:BoundField
DataField="name"
HeaderText="Name"
SortExpression="name">
<HeaderStyle
HorizontalAlign="Center"
/>
<ItemStyle
HorizontalAlign="Left"
/>
</asp:BoundField>
<asp:BoundField
DataField="code"
HeaderText="Code"
SortExpression="code">
<HeaderStyle
HorizontalAlign="Center"
/>
<ItemStyle
HorizontalAlign="Left"
/>
</asp:BoundField>
<asp:TemplateField>
<ItemTemplate>
</td></tr>
<tr>
<td
colspan="6"><div
id="<%#Eval("code") %>"
style="display:none;position:relative">
<asp:GridView
ID="Gdclmline1"
runat="server"
AllowPaging="True"
AllowSorting="True"
AutoGenerateColumns="False"
OnSorting="Gdclmline1_Sorting" BorderColor="Green"
BorderStyle="Solid"
BorderWidth="1px"
OnRowDataBound="Gdclmline1_RowDataBound"
OnRowEditing="Gdclmline1_RowEditing" Font-Names="Verdana"
Font-Size="8pt"
Font-Strikeout="False"
OnSelectedIndexChanging="Gdclmline1_SelectedIndexChanging"
OnRowUpdating="Gdclmline1_RowUpdating" PageSize="1000"
RowStyle-Wrap="false"
Width="100%"
CssClass="gareahead"
EmptyDataText="No Records To Display"
GridLines="Both">
<PagerSettings
Mode="NextPreviousFirstLast"
NextPageText="Next"
Position="Top"
PreviousPageText="Prev"
/>
<Columns>
<asp:TemplateField
HeaderText="phone"
SortExpression="phone">
<HeaderStyle
HorizontalAlign="Center"
/>
<ItemStyle
HorizontalAlign="Left"
/>
<ItemTemplate>
<asp:Label
ID="lblphone"
runat="server"
Text='<%#Bind("phone") %>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField
HeaderText="address1"
SortExpression="address2">
<HeaderStyle
HorizontalAlign="Center"
/>
<ItemStyle
HorizontalAlign="Left"
/>
<ItemTemplate>
<asp:Label
ID="lbladdress1
runat="server"
Text='<%#Bind("address1") %>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle
CssClass="gr"
Height="100px"
HorizontalAlign="Left"
Wrap="true"/>
<SelectedRowStyle
CssClass="gr"
/> <PagerStyle
CssClass="gareahead"
HorizontalAlign="Left"
Wrap="False"
/> <HeaderStyle
CssClass="ghead"
ForeColor="White"
Wrap="true"
/> </asp:GridView>
</div>
</td>
</tr>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<PagerSettings
Mode="NextPreviousFirstLast"
NextPageText="Next"
Position="Top"
PreviousPageText="Prev"
/>
<HeaderStyle
HorizontalAlign="Center"
VerticalAlign="Middle"
CssClass="ghead"
ForeColor="White"
/>
<RowStyle
CssClass="gr"
/>
<SelectedRowStyle
CssClass="gs"
/>
</asp:GridView>
</div>

that aspx page contains gridview that contain one more gridview inside in it.Now i want to sort out both the grid i.e)claimgrid and Gdclmline1 i want code in c#.

View 3 Replies

SQL Server :: Inserting Data After Calculation Using Stored Procedure?

Sep 15, 2010

my requirement is like i want to insert data to table after caliculation like table name salaryhike columns salaryinput,20%hike, 25%hike and 30%hike salaryinput column details to be input by the user and hike is to be caliculated and inserted with 20%hike, 25%hike and 30%hike are columns of same table.

View 4 Replies

Forms Data Controls :: How To Bind Grid View By Code With SQL Server Database

Dec 17, 2010

I want to bind a grid view by code not by wizard.

View 2 Replies

Forms Data Controls :: Gridview Recalculate, Then Repopulate Gridview Without Going Back To Database?

Mar 26, 2010

I want to make sure I go about this in an efficient manner. I have a gridview. On the gridview, I have some columns that are read only values . These values go through calculations based on values in a database. The stored procedure takes information in the database, does some simply calculations (this value * that value / another value type of stuff) then returns a recordset as a datasource for the grid.

Other columns on the gridview have values the users can enter data. I want to be able to provide a recalculate button that will run calculations based on the entered values which will change the readonly values and then repopulate the gridview's read only values without going back to the database. This recalculate button is not the save to the database button. The save to the database button will take the values in the user entered columns and save them to the database. Then, the next time the grid is called, the page calls to the database and loads the grid.

So, what I'm looking to do is allows for recalculations on a gridview, a gridview with about 24 columns and about 1000 rows. My first thought is to create a class that reads the gridview and then applies the business rules, then updates the gridview some how. Or, maybe have a dataset table thats i read the value from the user inputs, then apply business rules and then bind the gridview to the dataset table. Do any of you have thoughts here, maybe have done something like this?

View 9 Replies

Data Controls :: Ignore Empty GridView Cells When Inserting GridView Row To Database

Feb 25, 2016

With reference to the following link: [URL] .....

I want to save data to a different table. My save is working fine but the challenge is that it saves empty cells as well.I will like to save only QTyDelivered cell with value. Any empty QTyDelivered cell should be ignored (which means the row of QTyDelivered cell that is empty will not be saved) .How can i achieve this?

View 1 Replies

Forms Data Controls :: How To Get The Textbox Values To Gridview And Gridview To Database

Jul 19, 2010

how to get the values text box values to gridview..

if i enter any text in text box those values should display in gridview.

after entering of 2 or 3 records, i will click on save then all the values of grid should insert in to DAta Base.

i dont want to get the values form Database to Gridview.

how to retrive the values form Database to Gridview.

i just want to display the values which are there in Textbox...

View 3 Replies

DataSource Controls :: Month And Year Calculation In Stored Procedure?

Jun 18, 2010

I have a problem described below

Set @StartMonth = Aug
Set @EndMonth = Jan
Set @StartYear = 2009
Set @EndYear = 2010

I need to insert records into one new table based on the above informations
Month name should go from StartMonth to EndMonth and Year also should insert like below

MonthName Year
Aug 2009
Sep 2009
Oct 2009
Nov 2009
Dec 2009
Jan 2010

2) when I pass again

Set @StartMonth = Dec
Set @EndMonth = Feb
Set @StartYear = 2009
Set @EndYear = 2010

It should check for the records already in the database and should not insert the duplicate record. Based on the above case it should insert only one record

MonthName Year
Feb 2010

3) I need to also calculate number of days in the month except sat and sunday ..

Like Jan2010 we have 21 days except Saturday and Sunday

Is there any logic through which we calculate the number of days.?

View 5 Replies

Forms Data Controls :: Delete, Edit, Select Items Is In Grid View I Have To Do In C# Code It Will Reflect To Database Also?

May 20, 2010

I want delete, edit, select items is in grid view i have to do in c# code it will reflect to database also

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved