Are you sure that the database is in the project folder ? Maybe you have him linked remote to your project and when you want to publish it needs to be in the project folder?
blonkie
Posts
-
Publishing a vb.net application with an access database. -
Datagrid doesn't import all my .csv data !!I have an datagrid who is filled automaticly by an .csv file
Private Sub frmCsv_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim file As String = "steelandt.csv" Dim pad As String = "C:\" Dim dataset As New DataSet Try Dim bestand As System.IO.File If bestand.Exists(pad & file) Then Dim ConStr As String = _ "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _ pad & ";Extended Properties=""Text;HDR=Yes;FMT=Delimited\""" Dim conn As New OleDb.OleDbConnection(ConStr) Dim databaseAdapter As New OleDb.OleDbDataAdapter("Select [PO],[Item],[Due Date],[Item Description] from " & _ file + " WHERE PO>0 order by PO ASC", conn) databaseAdapter.Fill(dataset) End If Catch ex As Exception MessageBox.Show(ex.ToString) End Try DataGrid.DataSource = dataset.Tables(0)
Now as you can see I import just 4 columns (PO, Item,Due Date and Item description) When I run the program everything works except : It doesn't load the item and due date colum.... and to make it worse, it imports just a few values of the column item How come ?? -
Filter your datagrid through text in a combobox/textboxThanks for your help but still got an error :
Syntax error: Missing operand before '=' operator.
Btw how do you search for a value who is in a datagrid who is dynamic created. I mean how can you bind a dataset to the datagrid, and not the datagrid to the dataset. Thanks -
Filter your datagrid through text in a combobox/textboxYo, I have an datagrid where I want to filter my data I got. The filter I want to use is the text inside an combobox or textbox (it doesn't matter) This is the code I already have Private Sub cmbPO_textChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmbPO.SelectedValueChanged Me.TblLijstBindingSource.Position = Me.cmbPO.SelectedIndex End Sub Where: cmbPO = combobox tblLijstBindingSource = binding source This doesn't works like I want it, I want to see just the record I've insert in the combobox. But if this is to hard to do, it may just jump to that record. Thanks (Plz keep in VB.NET and do not throw code of C# or such a languages :->)