Showing posts from November, 2011


Ahmed Samir

Evry1falls is my online name

Visual Basic 2010 Math Functions

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…

Visual Basic Online Courses DataGridView Add Edit Delete

VB .NET DataGridView Add Edit Delete Manipulate DataGridView from Visual Basic 2010 with SQL ServerNote : if you dunno how to work SqlServer With VB.Net : You need to see this then this Logic Using DataGridView Control In VB.Net to Add New - Edit - Delete from/to Sql Server Database or MS-Access or any other Database type. You will find in the end of the lessons the project to download along with source code .  Design 1) Create a new Visual Basic project (Windows Application) name it as (MyDg1) and save it to your hard drive.
2) Place a DataGridView Control on the Form1.
3) Create Sql Server Database file, name it (MyDB)
4) Create Table, name it (Kinds) with just one record, name it (Kinds)
5) Rename the DataGridView Control's name From (DataGridView1) to (DG1)
6) Save/Build the project .
7) Now you have : A project such as this one in the 3 photos (from inside VB.Net and from Outside)

- What do we want to do ?!!!!

we want to update the database (MyDB) Table (Kinds) Record (Kind)…

Visual Basic Online Course - SQL Server

فى الموضوع السابق قمنا بربط الـ Visual Basic .Net مع قاعدة بيانات من نوع MS Sql Server 2000 و قمنا بعمل مشروع Project باسم (SqlServer2000) عبارة عن Form تحتوى على Name - BirthDate - Age و الان سنقوم ببرمجة المفاتيح الموجوده على Form و هى (New - Save - Edit - Delete - Search - Exit) و هى تعتبر مفاتيح رئيسية فى جميع المشروعات و يبقى المفتاح (Print) و سنقوم (ان شاء الله) ببرمجته فى موضوع لاحق لانه مرتبط بالتقارير Crystal Reports . أولا : المفتاح New
و وظيفته تفريغ الخانات الموجوده على الـ Form لتهيئتها لاستقبال قيم جديده . Code :
ثم فى الحدث Click للمفتاح New نضع اسم الاجراء

قم بتجربة المفتاح و املأ الادوات على الـ Form و لاحظ ..
ثانيا : المفتاح Save و وظيفته حفظ القيم المدخلة فى الادوات فى جدول Basic قاعدة البيانات Info Code :  
قم بكتابة البيانات على الفورم فى جميع الخانات و اضغط على حفظ و لاحظ .

ايضا سنقوم بعمل معادلة لحساب السن تلقائيا بمجرد تغيير تاريخ الميلاد كالتالى .  قم بتكرار حفظ جديد و لاحظ عند تسجيل تاريخ الميلاد يظهر السن تلقائيا و اضغط على Save و لاحظ ... عند فتح جدول قاعد…

Comment Via facebook