.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

SQL Round function dosen't act like Math.Round in VB.Net

Posted By:      Posted Date: September 24, 2010    Points: 0   Category :ASP.Net

I'm trying to calculate a customer tax.

Select 100 * Round(25296 /100 ,1) --returns 25200

 however Math.Round in Visual Basic, return 25300.

 Result = 100 * Math.Round(25296 / 100) ' returns 25300

I really nead any appropriate function to fix it.

Plese help soon.

View Complete Post

More Related Resource Links

round function in vb.net related to system.math

when i finding the value to round some decimal or double number below problem i faced system.math.round(12.50)        ans: 12 system.math.round(12.51)        ans: 13 the same problem also in floor function .........these problems in framework 3.5 and framework 4.0 also

Please advise on ROUND function


Not my original db, data or procedure as I have been tasked with developing an updated infosys (to a .NET app and SQLServer db).  Anyway, the original app/db has a rounding specification that is a bit strange to me and need some input on how I should proceed.  The original system architects decided they'd perform a round down on a particular field (int) which is ultimately used in a fee calculation.

Not a big deal because I could just issue a ROUND(theField, -2) --- But I found a problem.  At first glance it seemed that they wanted to round to the 10th:

3143 would round to 3100 with ROUND(3143, -2)

But if I come across a value such as 4075 this would then round to 4100 with ROUND(4075, -2)  WHEN THEY WANT THIS TO BE 4000.  That is, to arrive at 4000, then I'd need to issue a different ROUND(4075, -3)

Does this make sense? 

How should I approach this? 

 Is this a proceedure/logic probelm or am I looking at this with too limited vision in what needs to be done (SQL-wise)?


Thanks for your input,




James Crandall ~ http://javitechnologies.com Spatial Database Solutions

Round off time to the nearest minute

How would you round this up to the nearest minute? There isn't a built in function to do this so you have to use a little bit of maths to get there. There are 60 seconds in a minute. We already have 38 seconds on the clock. So we need to add on 60 - 38 = 22 more seconds.

Net Matters: Round-Robin Access To The ThreadPool


Stephen Toub shows you how to add round-robin scheduling support on top of the ThreadPool for more granular processing control.

Stephen Toub

MSDN Magazine January 2009

Utility Spotlight: 12 Steps To Faster Web Pages With Visual Round Trip Analyzer


Download Visual Round-trip Analyzer (VRTA) to uncover the root of your Web page loading problems and identify these 12 common ailments.

Jim Pierson

MSDN Magazine November 2008

decimal value validation and round off by javascript

The article decimal value validation and round off by javascript was added by hiral.hapani on Wednesday, June 02, 2010.

Hi All, I have createdone javascript by which you canvalidate a decimal value of any textbox for which you want. By thisjavascriptwecan bind user to enter only digits in textbox. and when he will enter any decimal value javascript will do round off it

Round in sql

Hi, How can i round  56.1234 to 56.12, when i try with round method in sql gives 56.1200 value i need only 2 decimal places ThanksVineeth

Give image round corners

Hello, I would just like to know if anyone can give me some advice on how to take a jpeg image and make the corners rounded at runtime using gdi+ and aspnet. Thanks in advance Wesley

How to make asp:menu tabs with round top corners


I am using asp:menu control to display horizontal menu.


I need to display tabs with rounded top corners.


Any idea how can I do that? 

Round off Decimal to 2 places in jQuery


Hi everyone,

How come the following code does not work:



var t_o_t_a_l = parseFloat(total.toString()).toFixed(2);



Round Slider control


Is there a way to customize a slider to be round - basically I want a user to be able to turn a dial like control - I figured a slider would be best since I need a percentage value? Any suggestion/ideas would be helpful on how to go about doing this?


Whether Date & Math function supported in WCF Data service



Whether Data(day,year,hour,minute,month,second) and Math functions(double round, decimal round, double floor, decimal floor, double ceiling, decimal ceiling) are supported in WCF data service using ODATA.

Thank You Benita Blas

Round Gridview footer template textbox value based on this JavaScript



This is my aspx javascript to get total in gridview footer template.. its working fine

The problem is : some time it show footer value is 6.9999999999

I need 6.99 as a result how to achieve this.

Aspx page:-

<script type="text/JavaScript">
function updateControls(elementId)
 var parentElementRef = document.getElementById(elementId);
 var elementRefArray = parentElementRef.getElementsByTagName('INPUT');
 var textBoxTotals = 0;

 for (var i=0; i<elementRefArray.length; i++)
  var elementRef = elementRefArray[i];

  if ( (elementRef.type == 'text') && (elementRef.gridTextBoxType == 'calcTextBox') )
   var textBoxAmount = parseFloat(elementRef.value);
   if ( isNaN(textBoxAmount) == true )
    textBoxAmount = 0;

   textBoxTotals += textBoxAmount;

 if ( isNaN(textBoxTotals) == true ) 
  textBoxTotals = 0;

 for (var i=0; i<elementRefArray.length; i++)
  var elementRef = elementRefArray[i];

  if ( (elementRef.type == 'text') && (elementRef.gridTextBoxType == 'totalsTextBox') )
   elementRef.value = textBoxTotals;
// -->


protected void Gridview1_RowDataBound(object sender, Grid

jquery round corner plugin doesn't work for me


 i've try http://jquery.malsup.com/corner/,but doesn't work for me ,i mean the parent color and transparency are preserver,the corners are blue colored.

Can you help with this please?

Thank You!

Content page control passes as argument to javascript function


Here is the content page:


<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="JavaDynamicCopyValue.aspx.cs" Inherits="JavaDynamicCopyValue" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
 <script type="text/javascript" >
 function copyValue(input, output )
   ouput.value = input.value;
   return true;
 <asp:TextBox ID="txt1" runat="server" onchange="copyValue(this,document.getElementById('<%=txt2.ClientID%>'))"></asp:TextBox>
    <br />
    <br />
    <asp:TextBox ID="txt2" runat="server"></asp:TextBox>


I got a javascript run time error says output is undefined. if I view source of the page, the txt1 markup became:

<input name="ctl00$ContentPlaceHol

connection to SQL Server files (*.mdf) require SQL server express 2005 to function properly.


I dont have the SQL EXPRESS installed instead I have SQL Standard Edition.

 I have two SQL Server instances installed.

 1- UserLT (this is sql 2000)
2- UserLT\SQL2005 (this is SQL 2005 named instance)

But when i try to add a database to my VS website project I get the following error:

Connection to SQL Server files (*.mdf) require SQL server express 2005 to function properly. please verify the installation of the component or download from the URL: go.microsoft.com/fwlink/?linkId=4925

I went in Tools>Opetions>DataBase tools>Data Connection>Sql Server Instance Name (blank for default)

and changed the "SQLEXPRESS" to "USERLT\SQL2005".

But I still get the same error message. Any ideas how i can resolve this issue?

Public Shared function doubt????

I am using VB.net/ASP.NET and SQL Server 2000 for a web application.

For populating the dropdowns, I wrote a Public Shared function LoadDDL(), in which I pass the dataset and dropdown name to set.

I have my doubts that this function will produce unexpected results for concurrent users. And will mix the results among sessions because it is a Shared function.

I am confused here. Is it the right way to go?

Please advice. Thanks in advance.


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend