K
Keith R
I'm working on an windows application (vb.net express, SQL express) where I
want to store a path and filename (separately) in a database, then be able
to click on a row in the DataGridView to have the app load the file. In
order to populate the source table in the first place, I have a button that
recursively searches directories to find files of the appropriate type, and
put that data into the table. Unfortunately, it isn't quite working.
Relevant pieces of code are below; the error I'm getting is:
"C:\Documents and Settings\Owner\Desktop\VB test video files"
In the database explorer tab, table definition: Clip_filepath is
varchar(500)
I refreshed and saved everything, and even restarted VB.net and still no
love.
Here is the relevant code; any help would be greatly appreciated. I'll post
separately if I can't figure it out once my table is populated, but my next
step will be to figure out how to avoid adding a row (in the code below) if
the local_ID is already in the database.
Thanks!
Keith
.....
ApexPath = folderDialog.SelectedPath
If Len(ApexPath) > 0 Then
For Each FileFound As String In Directory.GetFiles(ApexPath, "*.avi")
'***FILEINFO CLASS***
Dim fi As FileInfo = New FileInfo(FileFound)
Dim dt_fi As Date = fi.CreationTime
Dim sz_fi As Long = fi.Length
Dim ConvertedFileDate As String
Dim ConvertedFileTime As String
newMasterRow.Clip_Text_Description = ""
newMasterRow.Clip_FilePath = Path.GetDirectoryName(FileFound)
newMasterRow.Clip_FileName = Path.GetFileName(FileFound)
newMasterRow.Clip_Length = sz_fi
'populate MonkeyMain.Local_ID
ConvertedFileDate = Convert.ToString(Format(dt_fi, "yyyyMMdd"))
ConvertedFileTime = Convert.ToString(Format(dt_fi, "HHmmss"))
newMasterRow.Local_ID = ConvertedFileDate & ConvertedFileTime & "_" &
Convert.ToString(sz_fi)
'this is where I get the error
Me.MonkeyMasterTableDataSet.MonkeyMain.Rows.Add(newMasterRow)
Thanks for any assistance!
Keith
want to store a path and filename (separately) in a database, then be able
to click on a row in the DataGridView to have the app load the file. In
order to populate the source table in the first place, I have a button that
recursively searches directories to find files of the appropriate type, and
put that data into the table. Unfortunately, it isn't quite working.
Relevant pieces of code are below; the error I'm getting is:
The actual filepath value when the error occurs (the first file it finds)=Cannot set column 'Clip_FilePath'. The value violates the MaxLength limit
of this column.
"C:\Documents and Settings\Owner\Desktop\VB test video files"
In the database explorer tab, table definition: Clip_filepath is
varchar(500)
I refreshed and saved everything, and even restarted VB.net and still no
love.
Here is the relevant code; any help would be greatly appreciated. I'll post
separately if I can't figure it out once my table is populated, but my next
step will be to figure out how to avoid adding a row (in the code below) if
the local_ID is already in the database.
Thanks!
Keith
.....
ApexPath = folderDialog.SelectedPath
If Len(ApexPath) > 0 Then
For Each FileFound As String In Directory.GetFiles(ApexPath, "*.avi")
'***FILEINFO CLASS***
Dim fi As FileInfo = New FileInfo(FileFound)
Dim dt_fi As Date = fi.CreationTime
Dim sz_fi As Long = fi.Length
Dim ConvertedFileDate As String
Dim ConvertedFileTime As String
newMasterRow.Clip_Text_Description = ""
newMasterRow.Clip_FilePath = Path.GetDirectoryName(FileFound)
newMasterRow.Clip_FileName = Path.GetFileName(FileFound)
newMasterRow.Clip_Length = sz_fi
'populate MonkeyMain.Local_ID
ConvertedFileDate = Convert.ToString(Format(dt_fi, "yyyyMMdd"))
ConvertedFileTime = Convert.ToString(Format(dt_fi, "HHmmss"))
newMasterRow.Local_ID = ConvertedFileDate & ConvertedFileTime & "_" &
Convert.ToString(sz_fi)
'this is where I get the error
Me.MonkeyMasterTableDataSet.MonkeyMain.Rows.Add(newMasterRow)
Thanks for any assistance!
Keith