How to create a boot-able USB in Windows


Windows is my favourite OS since the Windows 7 edition. Usually we install most of OS from CD/DVD ROM. What about an USB or an SSD? You can do install Windows 7/8 from a boot able USB/Pen drive, but simply copying all CD contents to USB doesn’t work at all.

There are many programs which can reincarnate USB into bootable USB. But I suggest do it like an expert with some simple command.

First Step

Connect your device to a Windows installed system/PC also connect the USB want to use with a primary slot. We need at least 8 GB for installation purpose. 
We are going to format the USB, make sure all the necessary data is backup from the storage device. 

Preparing the USB with command prompt

Launch the command prompt with Admin privileges( Run -cmd and press enter) and  type c:/windows/system32 and issue the DISKPART command.  Now you have two command window.
Now list all disk partition with DISK LIST and identify your partition number, go to my computer and check volume size if had a confusion. The size will be 7534 MB for the 8 GB USB and I have disk with no 1.
Select the partition by issuing select disk [Disk #] command here it is SELECT DISK 1  for my computer, it may vary depending on the hard disks of PC you are using.
Now clean the disk. Issue CLEAN  command and make a new partition using CREATE PARTITION PRIMARY and make new partition active with ACTIVE command

Second Step

Need to format the newly created partition with the format command. FORMAT FS=NTFS QUICK. It will take some time to finish the process. Have a tea …. lol
Now we need two commands which let you go to the finalize step , ACTIVE and EXIT command (you will be automatically exit from the diskpart utility), don’t exit the command prompt.

Final Step

Go to your My computer and load the Windows installation DVD  and not the drive letter of DVD and US , suppose I have letter  ‘E’ for DVD and F  for USB.
Now the command prompt look like C:/Windows/System32>, OK ? lets make the bootable records follow these steps (issue following commands)
  1. E: CD BOOT and repeat CD BOOT until the prompt changed to E:/BOOT> (‘E’ stands for DVD Drive)
  2. Lets update USB Drive ‘F’ with BOOTMGR with compatible Bootcode, issue the BOOTSECT.EXE/NT60 F:(USB Drive).
If everything goes right( You will get the message ‘Bootcode was successfully updated on all targeted volumes’) , it will be OK for copying complete Windows (7/8/8.1)DVD content to the USB.

How to Boot 

Choose  your BIOS feature to make your USB device booting device, the setting may vary depending on the different BIOS. Now you know how to install Windows for USB.

Connect the USB to a computer and restart , boot with USB…

Thank you for reading.

How to add new fields to Access table in VB6


Let me show how to add a new field into an existing access database Table using Visual Basic 6.0.Using the tableDef and Filed object you can create new fields from within the code . 

Firstly, you need to create Database and Recordset object, make sure the DAO access object library is enabled/added to the project.

Create the UpdateTableField Sub

Sub UpdateTableField(tb As String, new_fld As String)Dim CHECK As Boolean
CHECK = False
Dim tbl As TableDef
Dim fld As Field
Dim strName As String
Set tbl = DB.TableDefs(tb)
  For Each fld In tbl.Fields
    If fld.Name = new_fld Then
      CHECK = True
    End If
  Next
If CHECK = False Then
   Set RS = Nothing
   With tbl
   Set fld = .CreateField(new_fld, dbText)
   fld.DefaultValue = “”
   .Fields.Append fld
  MsgBox “new Field Created !, check table”
  End With
Else
  MsgBox “Field already exist !”End If

The ‘TableDefs’ method will fetch the table schema from the database which hold the field information and then fire the checking for table field. dbText hold the default data type. 

Use the sub

Dim DB As Database
Dim RS As Recordset
Private Sub Command1_Click()
Call UpdateTableField(“Table1”, “RoomID2”)
End Sub
Private Sub Form_Initialize()
Set DB = OpenDatabase(“F:\Manoj\Code\DB-AUTO-FIELD-ACCES\db3.mdb”)
End Sub

A new field “RoomID2” will be created in the ‘Table1‘ Table.
Download the Source Code

How to connect Access Database in MS VB.net 2013


Here is how you can connect and build a Access data base application in Visual Basic.Net. First we need a connection string and Data Adapter or a command object for executing SQL statements. We can execute SQL commands using either the Adapter or the OLEDB command object.

In ADO.net there are plenty of class which make connecting database smooth as silk. Lets do it

Create connection string  

    Public Company As OleDb.OleDbConnection

Now we can configure the connection string.
        Company = New OleDb.OleDbConnection
        Company.ConnectionString = “Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\.Net Project\Accounting Pack\AccountingPack.accdb”

We are ready to interact with any table in AccountingPack database

Interacting with table

As far as we got everything is right and need to add, retrieve,update and delete rows to the table in the data base. The CURD operation can be made possible with a command object.

 Company.open()
  Dim cmd As OleDbCommand = New OleDbCommand(“select * from product_registration”, Company)

The first argument is the SQL query statement which fetch all columns from the table and the second is the connection string. Before executing this we also need to open the concoction.
To print the rows we need another object called  OleDbDataReader which help us to fetch row from command object and it works with following code

 Dim reader As OleDbDataReader = _
        cmd.ExecuteReader(CommandBehavior.CloseConnection)
        Do While reader.Read
            Console.WriteLine(reader.GetString(0))
        Loop
        reader.Close()
        Company.Close()

Insert statement

All other SQL statements can be made possible with the OleDbCommand object. 

Company.Open()
        Dim s As String = TextBox1.Text
        Dim cmd1 As OleDbCommand = New OleDbCommand(“insert into  product_registration (pruduct_name) values(‘” & s & “‘)”, Company)
        cmd1.ExecuteScalar()
        Company.Close()
Saving record is possible with ExecuteScalar method and it will execute the insert statement.

OleDbData Adapter – DataSet, DataView.

OleDbDataAdapter class is the interface between database engine and visual basic, it is the bridge between backend and frontend. This class brings the concept like dataSet and DataView.  We will discuss all these concepts 

Dataset

DataSet represents the offline/ local view of the database tables, that means no data connection necessary for accessing the fetched Dataset collection. 
DataSet object can fill with Fill Method of Adapter as follows
Dim adapter As OleDbDataAdapter = New OleDbDataAdapter(“select * from product_Registration“, Company)       
 Dim dataset As DataSet = New DataSet()       
adapter.Fill(dataset, “table1”)       
DataGridView1.DataSource = dataset
DataGridView1.DataMember = “product_Registration


The dataset can be used to fill DataGrid view too.

DataView

DataView object as the name indicate provides the table view. It can be useful when interact with the table rows.

 Dim dv As DataView
        dv = New DataView(dataset.Tables(“product_Registration”))
        adapter.Fill(dataset, “table1”)
        Dim c As Integer
        c = 0
        Do While c < dv.Count
            Console.WriteLine(dv(c).Item(0).ToString)
            c = c + 1
        Loop
   

I think you got the topic

VB.Net tutorial: How to add all columns to of table into Listview in VB.Net


How to add all column names into a listview Column header in VB.Net, here is my complete tutorial for you

Add new fields to Access table using VB6


Let me show how to add a new field into an existing access database using Visual Basic 6.0.Using the tableDef and Filed object you can create new fields. Firstly, you need to create Database and Recordset object, mke sure the DAO access object library. Continue reading Add new fields to Access table using VB6