Create Crystal Report from VB 2008 Using ADO.Net Connecting with MS-Access

This article consists of video clips that guide you to create Crystal Report for Visual Basic 2008 using ADO.Net data source and Microsoft Access Database.

Read More…

INSERT, DELETE, UPDATE AND SELECT Data in MS-Access with VB 2008

This article shows you how to write Visual Basic code using ADO.Net to manipulate data with Microsoft Access 2003 format. From this article you will know how to:

  • Use DataGridView control to get data from database
  • Use ADO.Net to Insert, Delete, Update, and Select data in MS-Access Database
  • Use SQL Statement for Inserting, Deleting, Modifying, and Selecting Data

 



Read More…

How to Show OpenWith Dialog Box in Visual Basic 2008?

How to show Open With dialog in Visual Basic .Net 2008? Please click here for more detail!

How to Save Image into Table in Microsoft Access Using VB 2008

Please follow the instruction below:

  • Step 1: Create Database in Microsoft Access
    • Database: data.mdb
    • Create Table: tblstudent(stdid: Number, name: text, photo: OLE Object)
  • Step 2: Create Visual Basic 2008 Project
    • Create and Save Project in Visual Basic 2008
    • Put the database file (data.mdb) in the project execution folder (\bin\debug\)
    • Create Form named: frmStudent (view as the following image)

Read More…

How to Connect from VB.Net to Access 2007?

Dim Cnn As New OleDb.OleDbConnection(“Provider=Microsoft.ACE.OLEDB.12.0; “ & _
“Data Source=C:\data.accdb; Persist Security Info=False;”)

Cnn.Open()

‘…………………..Retrieve data, or manipulate data here using DataAdapter, Command, etc.

Cnn.Close()

Before using the above code, please download and install AccessDatabaseEngine first.
Here is the link you can download:
http://www.microsoft.com/downloads/details.aspx?familyid=7554f536-8c28-4598-9b72-ef94e038c891&displaylang=en

Pseudocode for Binary Search Method in Sorting List (for VB2008)

Declare search_value As String
Declare n As Integer

Input n
Declare list(1 to n) As String
Input search_value

Declare i As Integer
For i=0 to n-1 Increased by 1
     Input list(i)
End For

Declare start_index As Integer
Declare end_index As Integer
Declare mid_index As Integer
Declare found_index As Integer
Set start_index=1
Set end_index=n

Set found_index = -1

Do
     mid_index = (Round Down) (start_index+end_index)/2
     If end_index<=start_index Then
          If search_value = list(mid_index) Then
               found_index = mid_index
          End If
          
Exit Do
      Else
          If search_value = list(mid_index) Then
               found_index = mid_index
               Exit Do
           Else If search_value < list(mid_index) Then
                end_index = mid_index – 1
           Else
                start_index = mid_index + 1
           End If
     End If
End Do Loop

If found_index = -1 Then
     Display “Search not found!”
End If

Output found_index

(Reference: http://www.krookroo.com/programming-languages/ms-visual-basic-20052008/94-it-vb9-10.html)

Pseudocode for N-Variable System Linear Equation (for VB2008)

   

  • Identify Output
    x1, x2, x3, ………, xn
     
  • Determine Input
    b1, b2, b3, ………, bn
    a11, a12, a13, ………., a1n
    a21, a22, a23, ………., a2n
    ………………
    an1, an2, an3, ………., ann
     
  • Determine Process
    Declare n as Integer
    Input value of n
    Declare a(1 to n,1 to n), b(1 to n), DetD, DetDx(1 to n), x(1 to n) As Double
    Declare temp(1 to n) As Double
    Declare i, j As Integer
     
    For i=1 to n increased by 1
       For j=1 to n increased by 1
          input value of a(i, j)
       End For
       input value of b(i)
    End for
     
    DetD = CalculateDet (n, a)
    …………………………………………………………………………………………..

អានលម្អិតខាងក្រោម
http://www.krookroo.com/programming-languages/ms-visual-basic-20052008/92-it-vb9-9.html

Export Data from VB 2008 to Excel

Dim ExcelApp As Object, ExcelBook As Object
Dim
ExcelSheet As
Object
Dim
i As
Integer
Dim
j As Integer

‘create object of excel

ExcelApp = CreateObject(“Excel.Application”)
ExcelBook = ExcelApp.WorkBooks.Add
ExcelSheet = ExcelBook.WorkSheets(1)

With ExcelSheet
    For i = 1 To Me.DataGridView1.RowCount
         .cells(i, 1) =
Me.DataGridView1.Rows(i – 1).Cells(“id”).Value
        
For j = 1 To DataGridView1.Columns.Count – 1
              .cells(i, j + 1) = DataGridView1.Rows(i – 1).Cells(j).Value
        
Next
    Next
End
With

Download Source Code and See More

VB.Net 2008 OleDb Connect to MS-Access with Password

Dim con As New OleDb.OleDbConnection
con.ConnectionString = “Provider=Microsoft.Jet.OLEDB.4.0; Data Source=” & _
                                 Application.StartupPath & “\dbstudent.mdb;” & _
                                 “Jet OLEDB:Database Password=12345″

con.Open()
‘———————-
Dim da As New OleDb.OleDbDataAdapter(“SELECT * FROM tblstudent”, con)
‘———-

con.Close()
con.Dispose()

http://www.krookroo.com/programming-languages/ms-visual-basic-20052008/87-it-vb9-8.html

Using Khmer Unicode and Save Image to SQL Server in VB 2008

 ‘Please attach the database to your SQL Server 2000 Database first.

Public pubCnn As New OleDb.OleDbConnection
Public strCnn As String = “Provider=SQLOLEDB.1; Data Source=.; ” & _
                                    
” Initial Catalog=SCHOOLSTAT; User ID=sa; Password=;”

—————————————–

អានព័ត៌មានលម្អិតនៅក្រោមនេះ
http://www.krookroo.com/programming-languages/ms-visual-basic-20052008/84-it-vb8-7.html

 

Follow

Get every new post delivered to your Inbox.