[ brankec @ 21.02.2010. 12:55 ] @
Pozdrav. Sta nije u redu sa sledecim kodom, odnosno kako da se povezem sa northwind bazom a da mi nejavlja sledece greske: -Could not find installable ISAM -Cannot start your application. The workgroup information file is missing or opened exclusively by another user Code: 'Imports Data and Oledb namespaces ... Imports System.Data Imports System.Data.OleDb Public Class Form1 Dim objConnection As New OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0; DatSource=d:\Northwind.accdb; Jet OLEDB:System Database=system.mdw;") Dim objDataAdapter As New OleDbDataAdapter() Dim objDataSet As New DataSet() Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load objDataAdapter.SelectCommand = New OleDbCommand objDataAdapter.SelectCommand.Connection = objConnection objDataAdapter.SelectCommand.CommandText = "Select * From employees" objDataAdapter.SelectCommand.CommandType = CommandType.Text 'Open database connection ... objConnection.Open() 'Fill dataset object with data objDataAdapter.Fill(objDataSet, "Employees") 'Close database connection ... objConnection.Close() 'Set the DatGridView properties to bind data DataGridView1.AutoGenerateColumns = True DataGridView1.DataSource = objDataSet DataGridView1.DataMember = "Employees" 'Clean up objDataAdapter = Nothing objConnection = Nothing End Sub End Class |