You are Unregistered, please register to gain Full access.    
SEO consult

Go Back   Webmaster Forums & SEO Internet Marketing Resources > Web Developing & Designing > Programming


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-27-2008, 07:13 AM
anand1's Avatar
Member
 
Join Date: Feb 2008
Posts: 77
iTrader: (0)
Friends: (0)
anand1 is on a distinguished road
Send a message via Yahoo to anand1
Default Linking Database wit VB.NET

How to link our database created on Microsoft Access with VB.NET applications. I m finding difficult to liknmy database. I m using Visual Studio 2005.
Reply With Quote

  #2 (permalink)  
Old 01-12-2010, 06:27 AM
Junior Member
Points: 16, Level: 1 Points: 16, Level: 1 Points: 16, Level: 1
Level up: 31% Level up: 31% Level up: 31%
Activity: 2% Activity: 2% Activity: 2%
 
Join Date: Dec 2009
Posts: 8
iTrader: (0)
Friends: (0)
evaann is on a distinguished road
Default Linking Database wit VB.NET

Hi,
This code is gonna connect to the Access database and load data into datagrid:

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles MyBase.Load

Dim ConnString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Database Name.mdb"
Dim SQLString As String = "SELECT * FROM TableName"
Dim OleDBConn1 As System.Data.OleDb.OleDbConnection = New System.Data.OleDb.OleDbConnection(ConnString)
Dim DataSet1 As New DataSet()
Dim OleDbDataAdapter1 As System.Data.OleDb.OleDbDataAdapter = New System.Data.OleDb.OleDbDataAdapter(SQLString, OleDBConn1)
OleDBConn1.Open()
OleDbDataAdapter1.Fill(DataSet1, "TableName")
DataGridView1.DataSource = DataSet1.Tables("TableName")


thanks


___________

Optimize internet connection
Reply With Quote

Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 03:18 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78