Visual Basic .Net to Synchronize data from Remote Database Server

0 comments

Posted on 6th December 2011 by Kenneth in Visual Basic .Net

, ,

VB.NetOccasionally Connected Data (OCS) to synchronize data from remote database server. This downloads data from the server to the .sdf file. Next, make data changes in the server data grid, and then click the save button.ClickSynchronizeagain to download your changes to the client. Get full source code here


Visual Basic .Net on How to Use Print Preview, Print Setup and Page Setup

0 comments

Posted on 5th December 2011 by reyman in Visual Basic .Net

How to use the print preview, call print setup and page setup in Visual Basic .Net. The PrintPreviewDialog is associated with the PrintDocument as the preview isrendered, the PrintPage event is triggered. This event is passed a graphics context where it “draws” the page. Get the complete project


One-to-Many or Master-Detail Data entry in Visual Basic .Net

0 comments

Posted on 4th December 2011 by Kenneth in Visual Basic .Net

, ,

Visual Basic .Net sample project on how to create a One-to-Many (Master-Detail) Data entry form using the Data Sources Window and the Windows Forms designer in Visual Studio. This project connect the database Order as the master or parent then retrieve the order details as the child. Get the source code here


 

How to Connect Database in Visual Basic .Net

0 comments

Posted on 3rd December 2011 by Admin in Visual Basic .Net

,

Sample project on Visual Basic .Net in windows forms on how connect to an existing database and how to define how data is retrieved and updated using the data sources window and the dataset designer in Visual Studio. Download Project


Read Data from Oracle Database using Visual Basic .Net 2010

0 comments

Posted on 1st December 2011 by Admin in Visual Basic .Net |Visual Basic 2010

, ,

Sample code on how to access or retrieve data from Oracle database using visual basic .net 2010. Please add to reference the ODP.NET DLL to your visual studio reference in order to gain access to your oracle database server.

 

 

 

 


 

‘Sample Code Below

Imports Oracle.DataAccess.Client ‘ Visual Basic ODP.NET Oracle managed provider

Public Class frmdepartment

Private Sub frmdepartment_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim oradb As String = “Data Source=(DESCRIPTION=(ADDRESS_LIST=” _
+ “(ADDRESS=(PROTOCOL=TCP)(HOST=ORASRVR)(PORT=1521)))” _
+ “(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=ORCL)));” _
+ “User Id=hr;Password=hr;”

Dim conn As New OracleConnection(oradb) ‘ Visual Basic
conn.Open()

Dim cmd As New OracleCommand
cmd.Connection = conn
cmd.CommandText = “select department_id, department_name, location_id from departments” ‘ VB
cmd.CommandType = CommandType.Text

Dim dr As OracleDataReader = cmd.ExecuteReader()
While dr.Read()
ListBox1.Items.Add(“The ” + dr.Item(“department_name”) + _
” department is in ” + dr.Item(“location_id”).ToString())
End While

dr.Dispose()
cmd.Dispose()
conn.Dispose()
End Sub

End Class