Posts

Database First with ASP.NET MVC using EF

Image
Using MVC, Entity Framework, and ASP.NET Scaffolding, you can create a web application that provides an interface to an existing database. This tutorial series shows you how to automatically generate code that enables users to display, edit, create, and delete data that resides in a database table. The generated code corresponds to the columns in the database table. This part of the series focuses on using ASP.NET Scaffolding to generate the controllers and views. Add scaffold You are ready to generate code that will provide standard data operations for the model classes. You add the code by adding a scaffold item. There are many options for the type of scaffolding you can add; in this tutorial, the scaffold will include a controller and views that correspond to the Student and Enrollment models you created in the previous section. Database First Approach of Entity Framework In Database First approach, we need to have existing database and need to create business model ...

Control Structures examples

Module Module1     Sub Main()         'Dim a As Integer         'Dim b As Integer         'a = 10         'b = 20         'If (a > b) Then         '    Console.Write(" a is big number")         'Else         '    Console.Write(" b is big number")         'End If         '' While Loop         'Dim number As Integer         'number = 1         'While number <= 100         '    number = number + 1         '    Console.WriteLine("Number is{0}", number)         'End While         '' DO While Loop         'Dim number As Long         'numb...

Visual Basic 6 (VB6) Operators

Operators in Visual Basic Arithmetical Operators Operators Description Example Result + Add 5+5 10 - Substract 10-5 5 / Divide 25/5 5 \ Integer Division 20\3 6 * Multiply 5*4 20 ^ Exponent (power of) 3^3 27 Mod Remainder of division 20 Mod 6 2 & String concatenation "George"&" "&"Bush" "George Bush" Relational Operators Operators Description Example Result > Greater than 10>8 True < Less than 10<8 False >= Greater than or equal to 20>=10 True <= Less than or equal to 10<=20 True <> Not Equal to 5<>4 True = Equal to 5=7 False Logical Operators Operators Description OR Operation will be true if either of the operands is true AND Operation will be true only if both the operands are true

VB 6.0 - Working with Variables

Lesson 6 : Working with Variables 6.1 Assigning Values to Variables After declaring various variables using the Dim statements, we can assign values to those variables. The syntax of an assignment is Variable=Expression The variable can be a declared variable or a control property value. The expression could be a mathematical expression, a number, a string, a Boolean value (true or false) and more. The following are some examples variable assignment: firstNumber=100 secondNumber=firstNumber-99 userName="John Lyan" userpass.Text = password Label1.Visible = True Command1.Visible = false Label4.Caption = textbox1.Text ThirdNumber = Val(usernum1.Text) X = (3.14159 / 180) * A 6.2 Operators in Visual Basic To compute inputs from users and to generate results, we need to use various mathematical operators. In Visual Basic, except for + and -, the symbols for the operators are different from normal mathematical operators, as shown in Table 6.1. Table 6....

visual basic 6.0 - Managing VB Data

5. Managing VB Data Data types in Visual Basic 6 By default Visual Basic variables are of variant data types. The variant data type can store numeric, date/time or string data. When a variable is declared, a data type is supplied for it that determines the kind of data they can store. The fundamental data types in Visual Basic including variant are integer, long, single, double, string, currency, byte and boolean. Visual Basic supports a vast array of data types. Each data type has limits to the kind of information and the minimum and maximum values it can hold. In addition, some types can interchange with some other types. A list of Visual Basic's simple data types are given below. 1. Numeric Byte Store integer values in the range of 0 - 255 Integer Store integer values in the range of (-32,768) - (+ 32,767) Long Store integer values in the range of (- 2,147,483,468) - (+ 2,147,483,468) Single Store floating point value in the range of (-3.4x10-38) - (+ 3.4x1038) ...

Control Structures In Visual Basic 6.0

Control Structures In Visual Basic 6.0 Control Statements are used to control the flow of program's execution. Visual Basic supports control structures such as if... Then, if...Then ...Else, Select...Case, and Loop structures such as Do While...Loop, While...Wend, For...Next etc method. If...Then selection structure The If...Then selection structure performs an indicated action only when the condition is True; otherwise the action is skipped. Syntax of the  If...Then  selection If <condition> Then statement End If e.g.: If average>75 Then txtGrade.Text = "A" End If If...Then...Else selection structure The  If...Then...Else  selection structure allows the programmer to specify that a different action is to be performed when the condition is True than when the condition is False. Syntax of the  If...Then...Else  selection If <condition > Then statements Else statements End If e.g.: If average>50 Then txtGrade.Text = "P...