Posts

Showing posts from November 25, 2011

Author

Ahmed Samir

Evry1falls is my online name

Visual Basic 2010 Math Functions

Image
Microsoft Visual Basic 2010 Math Functions Math and String Functions In addition to performing simple arithmetic and string operations with the arithmetic and string operators, Visual Basic programs can take advantage of several built-in mathematical functions and string functions to perform useful processing that, otherwise, could require highly complex original code. Mathematical Functions Popular mathematical functions are summarized in the following table. Note that certain functions do not require the Math. prefix. FunctionUseMath.Abs()Returns the absolute value.
Math.Abs(-10) returns 10.Math.Ceiling()Returns an integer that is greater than or equal to a number.
Math.Ceiling(5.333) returns 6.Fix()Returns the integer portion of a number.
Fix(5.3333) returns 5.Math.Floor()Returns an integer that is less than or equal to a number.
Fix(5.3333) returns 5.Int()Returns the integer portion of a number.
Int(5.3333) returns 5.Math.Max()Returns the larger of two numbers.
Math.Max(5,7) returns 7.Ma…

VB.Net SqlServer DateTime Insertion

Dealing with Date/Time in VB.Net and SQLServerIt's been a nightmare since i decided to insert DateTime value into Sql Server 2000 DataBase Table Field Type as SmallDateTime.It took me 3 days and nights trying to work it around.I've did everything i know and everything other told me to do.Finally, i figured it out. Look .... Say, you have a Vb.Net 2005 Project with a form contains a DateTimePicker Control called (Q3) and Button Called (B3) Text Property as (Insert), and you have Sql Server 2000 DataBase called (Market) with Table Called (Purchase) includes a Field called (EXdt) Type as (SmallDateTime) Length (4), and you want to update it using Ado.Net Online Mode. 1) Calling The Ado.Net for Sql Server DataBase Imports System.Data.SqlClient 2) Assigning your variables Dim CN As New SqlClient.SqlConnection Dim cPur As New SqlClient.SqlCommand Dim CntRs As Integer Dim SqlStr As String 3) Connecting your DataBase 'Market' - Form_Load Event

If CN.State = ConnectionState.Open Then CN.C…

Comment Via facebook