C
Christian Westerlund
Hi!
When i fill a dataset with data from a text-file I sometimes get this
error:
E_UNEXPECTED (0x8000FFFF)
No more information is specified. When I search the Internet for
information regarding this message I almost get no results back.
When I use a text-file where one of the columns has over 260 chars I get
the error more often. I can always fill the grid the first time, the
second time I try to fill it I usually get the error. Then I have to
restart the application.
I would really appreciate if someone hade any information to tell about
this issue.
I use Jet.OLEDB to read from the text-file.
The .NET version is: v1.1.4322
The SQL-command is:
SELECT * FROM outar.txt
This is my fill function:
Private Function FillGrid() As DataSet
Dim con As New
OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\Utveckling\Test\ADOSpeedTest\WindowsApplication1\bin;Extended
Properties=""text;HDR=Yes""")
Dim cmd As New OleDbCommand(TextBox1.Text, con)
Dim adapter As New OleDbDataAdapter(cmd)
Dim ds As New DataSet
Dim start As Long = DateTime.Now.Ticks
Try
con.Open()
ds = New DataSet
adapter.Fill(ds)
Dim sto As Long = DateTime.Now.Ticks
Label1.Text = String.Format("{0} {1}", (sto - start) *
Math.Pow(10, -4), "ms")
Catch e As OleDbException
MsgBox(e.Message)
Finally
con.Close()
con.Dispose()
cmd.Dispose()
adapter.Dispose()
End Try
Return ds
End Function
I call it from this code:
Dim dss As DataSet = FillGrid()
If dss.Tables.Count > 0 Then
DataGrid1.DataSource = dss.Tables(0)
End If
/Christian
When i fill a dataset with data from a text-file I sometimes get this
error:
E_UNEXPECTED (0x8000FFFF)
No more information is specified. When I search the Internet for
information regarding this message I almost get no results back.
When I use a text-file where one of the columns has over 260 chars I get
the error more often. I can always fill the grid the first time, the
second time I try to fill it I usually get the error. Then I have to
restart the application.
I would really appreciate if someone hade any information to tell about
this issue.
I use Jet.OLEDB to read from the text-file.
The .NET version is: v1.1.4322
The SQL-command is:
SELECT * FROM outar.txt
This is my fill function:
Private Function FillGrid() As DataSet
Dim con As New
OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\Utveckling\Test\ADOSpeedTest\WindowsApplication1\bin;Extended
Properties=""text;HDR=Yes""")
Dim cmd As New OleDbCommand(TextBox1.Text, con)
Dim adapter As New OleDbDataAdapter(cmd)
Dim ds As New DataSet
Dim start As Long = DateTime.Now.Ticks
Try
con.Open()
ds = New DataSet
adapter.Fill(ds)
Dim sto As Long = DateTime.Now.Ticks
Label1.Text = String.Format("{0} {1}", (sto - start) *
Math.Pow(10, -4), "ms")
Catch e As OleDbException
MsgBox(e.Message)
Finally
con.Close()
con.Dispose()
cmd.Dispose()
adapter.Dispose()
End Try
Return ds
End Function
I call it from this code:
Dim dss As DataSet = FillGrid()
If dss.Tables.Count > 0 Then
DataGrid1.DataSource = dss.Tables(0)
End If
/Christian