Search VB 2010

Saturday, January 11, 2014

Visual Basic Freelance Requirements Document, Event Planning Document and Use Case Definition

Visual Basic Freelance Job - Understanding a client needs
Visual Basic Freelance Job - Understanding a client needs

Writing Requirements Document

 is a *.Pdf, *.Doc, *.Docs, *.Xml file describes what the your client needs from you "An Application" including but not limited to (Application Title, Purpose, Algorithms procedures and conditions, Notes and restrictions, Comments) these were the most famous requirements and your job as a programmer is to study well these points and design your applications according to it. Another way is to write it for your client if required, sometimes clients need to understand what you've done as a programmer, maybe they will hire some else in the future when you are not available.

This is different from VB .Net Documentations you won't be needing codes or anything, everything depends one the client's request or who ever requests it from you, as a programmer asked to provide this document, honesty is a must, you need to provide the client with everything, starting your logic to deploying methods and you shall accept to do it or not, it is controversial subject.

In the other hand 90% or Requirements Docs are provided by the client or requested by the contractor (Programmer) to ensure that his work (Application) will meet the client's demands to the fullest or at least almost the fullest.

The Requirements Doc. always/must be provided before the application's beginning by the client's to the programmer or along with the application by the programmer to the client.

Writing Event Planning Document 

is the same as the Requirements Doc. format file. It describes what is going on the application's interface UI, specifically describes what happens (The event) when the client's user will click on something on your form or the form_load event itself.
For example, if you have a button in your applicaiotn you will provide its name and the events that are bound to it (Click, DBLClick,. .... etc) and what happens when the client's perform an event of those above, most Planning Events Docs are tables design.

It is provided when requested and as the Requirements Doc. it is a controversial point of view between the prgrammer and the client, you may or you may not provide it if requested.

The VB .Net Event Planning Doc. always/must be provided if agreed by your side as a programmer (contractor), you will describe each and every control's event triggers in your application to the client.

The VB .Net Event Planning Doc. always provided to the client along with application or after, and may be designed and logically configuered by the programmer before writing the codes or designing the UI (User Interface), it should give a full understanding description to the methods used in desgining the User Interface and events related to each control.

Writing Use Case Definition 

is the same as the Requirements Doc. and the Event Planning Doc.'s format file. It describes the logic of/in the application you provide as a programmer to the client if requested. But this time it is a 50\50 chances, means it could be requested by the client or by you and also it should give you as a programmer the mean to reach the client's ideas about the application.

The Use Case Definition if requested by the programmer, means that the programmer is seeking the best image in the client's head and he wants to fully satisfies his client. If requested by the client means that the client already knows what he is seeking he is not just looking for a programmer, no! he is looking for a programmer to do this as he has in mind, maybe he already saw something and wants the exact same thing.

The Use Case Definition is more like terms to the programmer but also relieves him from over coding events that are not really needed ofcourse if asked by the client's side.

All of the 3 Documents ( Use Case Definition, equirements Doc and Event Planning Doc.) depends on the contract between you and the client. I will show you how to do it in a small application project using VB .Net 2010 as if provided\requested by a client soon.4

Here are some online Visual Basic lessons and courses :

Sunday, December 15, 2013

Visual Basic Compare Two Treeviews and return differences

Visual Basic 2010 - Compare Two Strings and return differences and matches

vb2010 compare strings and return differences
VB2010 Compare Strings in Collections

Collections as an Alternative to Arrays

Visual Studio 2010
Although collections are most often used for working with the Object Data Type, you can use a collection to work with any data type. In some circumstances, it can be more efficient to store items in a collection than in an array.



If you need to change the size of an array, you must use the ReDim Statement (Visual Basic). When you do this, Visual Basic creates a new array and releases the previous array for disposal. This takes execution time. Therefore, if the number of items you are working with changes frequently, or you cannot predict the maximum number of items you need, you might obtain better performance using a collection.

A collection, which does not have to create a new object or copy existing elements, can handle resizing in less execution time than an array, which has to use ReDim. But if the size does not change, or changes only rarely, an array is likely to be more efficient. As always, performance is highly dependent on the individual application. It is often worth your time to try both an array and a collection.

This Example

How to compare two Treeviews in VB2010
How to return the differences between two Treeviews

Solution

- Create Visual Basic 2010 Windows Application Project
- On Form1, place two tree views and two textboxes and one button

Visual Basic Online Course
Visual Basic 2010 Compare Strings from Treeview
How does it work ?
- Store the Treeview1 [TRV1] nodes into Textbox, and the same with Treeview2 [TRV2]
- How many strings [Lines] in each Textbox

  • We want to find where both Textboxes is different and where both Textboxes is match to one another. For example, differences are :
- TRV1 has an extra string [Southern American]
- TRV2 node string [Africa] is different from TRV2 node string [African]

Steps to accomplish this task :





Download example from Mediafire
Extended work :
You can easily extract any Database tables, columns Schema into a treeview control, and you can also using this example compare two tables or two columns in a Database using this example as well.

You can use ListViews or ComboBoxes or ListBoxes instead of the Treeview control, I used the treeview control because it's always tricky to work with. Using other controls that store strings in Collection format would be so easy, even much easier than using Treeviews.

Another Treeview Examples

Expand and Collapse two treeviews at the same time according to one another even if they both don't have the same nodes names. Expand TreeView1[TRV1] node when TreeView2 [TRV2] node is expanded or collapsed.

TreeView Example : Change the node font

TreeView Example : Add a photo (icon) to the TreeView
1) Add ImageList from the ToolBox
2) Add 2 photos to the ImageList1 [From properties, Collection], for example :
- Photo1.Png (Index by default is Zero 0), this will be the Parent icon
- Photo2.Png (Index by default is One 1), this will be the first child icon
3) Code to display image/Icon in the Tree View :


Here are some online Visual Basic lessons and courses :

Saturday, November 02, 2013

VB 2010 Advantage Database Example

Sybase Advantage Database With Visual Basic 2010

Update Sybase Advantage Database using XML file from Visual Basic 2010 [Client-Server] Idea.
Update Sybase Advantage Database using XML file from Visual Basic 2010 [Client-Server] Idea.
1. Create New VB2010 Windows Application Project
2. Path to Project (I.e. D:\MySyBase\)
3. Path to Database (I.e. D:\MySyBase\Bin\Debug)
4. Sybase Advantage Database (MyDB.add)
5. Sybase Advantage Database Username : AdsSys - Password : ahmed
6. Sybase Advantage Database Table (I.e. MyInfo.adt)
We will create a personal Info application, so the table structure will be like that :
Sybase Advantage Database
Visual Basic 2010 - Sybase Advantage Database
Note : All other fields will vary in [Size] only but all fields are [cicharacter] Data Type.

Visual Basic Form Deign :
Visual Basic 2010
Visual Basic Online Courses
Note : I have made TextBoxes with Naming convenient (I.e NameTxt, EmailTxt, MobileTxt .... etc). Also I've placed 1 DataGridView and some Buttons. I also have 1 Module [Module1].

SaveBtn : Save new record to the Advantage Database
SearchBtn : Search for records using by Sname
EditBtn : After search, edits the record
DeleteBtn : After search, deletes the record
CancelBtn : Reset the form and the DataGridView
ExitBtn : Exits the application

In order to use Sybase Advantage Database with Visual Basic 2010 and just like any other Database, you must call the References to the Database :
Visual Basic 2010 - Add Reference to Sybase Advantage Database

The Codes
Module1

Form1
Sub ClearAll()
Private Sub Form_Load()
Private Sub ExitBtn_Click()
Private Sub SaveBtn_Click()
Private Sub SearchBtn_Click()

Private Sub CancelBtn_Click()
Private Sub EditBtn_Click()
Private Sub DeleteBtn_Click()

Note : You will need 2 Pictures PNG [On : Off] to refer to the Database Status, path [..Bin/Debug].

Another Lesson : How to Remote Database using XML :

1) Create an XML file in path [.\bin\Debug\] Folder and call it [XmlFile.xml]
2) Open [XmlFile.xml] with NotePad.exe and paste the following code into it :

3) Save the Xml file.
4) Open our VB 2010 Project and add a ToolStrip to the Form1, Dock = Buttom
ToolStrip VB 2010 Xml Database Update
ToolStrip VB 2010 Xml Database Update
5) How does it work "The Main Idea" : When you want to Alter structure or Edit the Advantage Database of your Advantage Database "DB.Add" on a Client's "User's" computer you will need to do something like what I did, easy and guaranteed. Find a Server and send SQL Statements to the Xml File and when the user checks for update [Check For Update] button, the application will open the XmlFile.xml and execute the Sql-Statement within, simply like that. When you use Version Number along with the update, it makes the Update process so easy to be tracked, so we will need to create and extra Database Table in the Advantage Database and call it [DB_Version].
6) DB_Version table structure :
Update Advantage Database [MyDB.Add] using XML and Visual Basic 2010
Update Advantage Database [MyDB.Add] using XML and Visual Basic 2010
Note : UpdateDT column is Date DataType.
7) Now each time you send updates to XML file, the user Checks for update and choose the XML file from Open Dialog Box and it compares the Date and Version of the Update, if New then it executes the Sql Statement line, if not, then it gives message [MsgTxt.Text] You're Up-To-Date.
8) Download Example from MediaFire.com [Testing.ZIP]

AdsConnection GetSchema tip :

How to retrieve Advantage Data Dictionary Schema in VB 2010.
VB 2010 GetSchema - Retrieve Tables, Columns From Ads Data Dictionary (AdsConnection)

Advantage DataTypes conversion in VB 2010

Type

Length

Available in DBF Table

VB 2010 Value

Character
1 to 65530
Yes
4
CICharacter
1 to 65530
No
20
Date
4
Yes
3
Logical
1
Yes
1
Memo
9
Yes
5
Double
8
VFP, Extended
10
Integer
4
VFP, Extended
11
Numeric
2 to 32
Yes
2
Image
9
Extended
7
Binary
9
Extended
6
ShortInteger
2
No
12
Time
4
No
13
TimeStamp
8
No
14
AutoIncrement
4
No
15
Raw
1 to 65530
No
16
CurDouble
8
No
17
Money
8
No
18
ModTime
8
No
22
RowVersion
8
No
21

Best Use, For example :
When you try to Retrieve Advantage Data Dictionary Table Structure you will get column names, and you will may need to retrieve Data Types [Field_Type], Advantage Data Arc. provides System.Columns Field_Type column within the System.Columns Table that return values like [Character], now when you do that in Visual Basic 2010 or any Visual Basic .Net version, you will not get [Character] but you will get [4] instead and you will want to convert it into [Character] name, you can do that using a function or a Select Case expression in VB 2010.
So, in order to retrieve Field_Type or DataType of a certain column in Advantage Database, you may use this code:

Some Exceptions and Errors noticed :

Error : 
Table doesn't appear in the Data Dictionary [ARC.exe] but though it appears in the Data Dictionary Folder.
Description :
When you try to create a free Table [ADT Table] using Sql Statement from VB 2010 like this. The result will be a free Table but not included in the Data Dictionary, but you will only see it in the Folder contains the Database.
Cause :
The User Id section in the connectionString is Empty, but if you tried to create another table with the same name you will get an Error specifying that ISAM found a table with the same name "Table already exists" though it doesn't appear in the Data Dictionary.
Solution :
Provider a User ID or a User Id and Password if possible in the connectionString Whether you are using OleDBConnection or AdsConnection to work with this Data Dictionary.

Here are some online Visual Basic lessons and courses :

Visual Basic Courses - Share