aniskhan
Well-known member
I have the DB "imdb" in access having one field "path" text.
here i ADD the path(got it through opendialog) into the DB.
the problem..
path (from opendialog is alright) but when ADD in database it not the complete path (lost last characters)
i checked newRow("path") created ,but it has the complete path
anythg wrong in code..
here i ADD the path(got it through opendialog) into the DB.
VB.NET:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim currFldr As String
'copy the fullpath
If Me.OpenFileDialog1.ShowDialog = DialogResult.OK Then
currFldr = New DirectoryInfo(Me.OpenFileDialog1.FileName).ToString
End If
Me.OleDbConnection1.Open()
Me.DataSet11.Clear()
'Addnew path
Me.BindingContext(DataSet11, "imdb").AddNew()
Dim newRow As DataRow = DataSet11.imdb.NewRow
'copy new value in dataRow
newRow("path") = currFldr
Me.DataSet11.Tables("imdb").Rows.Add(newRow)
Me.OleDbDataAdapter1.Update(DataSet11)
Me.OleDbConnection1.Close()
End Sub
the problem..
path (from opendialog is alright) but when ADD in database it not the complete path (lost last characters)
i checked newRow("path") created ,but it has the complete path
VB.NET:
Label1.Text = newRow("path")
anythg wrong in code..