.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month

Home >> Forum >> VB.Net >> Post New QuestionBookmark and Share Subscribe to Forum

How to Show Oracle Table Contents in Datagrid view in Vb.net

Posted By: Sushil     Posted Date: February 10, 2010    Points:2   Category :VB.Net
How to Show Oracle Table Contents in Datagrid view in Vb.net with

Author: Sagar Pardeshi             
Posted Date: February 10, 2010     Points: 5   

Imports System.Data
Imports System.Data.OleDb
' some code here
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
' create a connection string
Dim connString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=datasource name"
Dim myConnection As OleDbConnection = New OleDbConnection
myConnection.ConnectionString = connString
' create a data adapter
Dim da As OleDbDataAdapter = New OleDbDataAdapter("Select * from Customers", myConnection)
' create a new dataset
Dim ds As DataSet = New DataSet
' fill dataset
da.Fill(ds, "Customers")
' write dataset contents to an xml file by calling WriteXml method
' Attach DataSet to DataGrid
DataGrid1.DataSource = ds.table("Customers")
End Sub
End Class

Author: Lalij Mer             
Posted Date: February 10, 2010     Points: 5   

show this link


Please Check my answer if you help....
Thank You...

Author: krishnavenikaladi             
Posted Date: February 20, 2010     Points: 5   

Imports System.Data
Imports System.Data.OracleClient

add the above references.

In form Load
Dim cn as new OracleConnection("user id=scott;password=tiger;data source=)
Dim da as new OracleDataAdapter("select * from dept",cn)
Dim ds as new DataSet()

Post Reply

You must Sign In To post reply
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend