By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,552 Members | 893 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,552 IT Pros & Developers. It's quick & easy.

System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)

P: 2
I have tried everything I can to get beyond this error which shows below as ‘<<<<< error here. It is trying to fill a dataset from a data adapter. If I change the SELECT statement to just ‘SELECT * FROM xTable’ I get the correct number of records in each table. But anytime I try with a more complex statement I get the error message shown below which indicates System.Data.Common.DbDataAdapter.Fill(DataSet dataSet. I’ve completely erased all data and entered a new set of test data so I know there is no problem with relationships. Each table has primary key which is foreign key in other table.
IS there something wrong with the Imports section: Imports System

Imports System.Data
Imports System.Data.OleDb
Imports System.Data.SqlClient

Imports System.Drawing
Imports System.Windows.Forms
Imports System.Guid

Imports Infragistics.Win
Imports Infragistics.Win.UltraWinToolTip

Imports Janus.Windows.GridEX

Did I miss an data update for Visual Studio?

Expand|Select|Wrap|Line Numbers
  1. Private Function LoadgriPrices() As Boolean
  2.          Try
  3.             gblConn = New OleDbConnection(QponConnStr)
  4.             Dim dagexLoad As New OleDbDataAdapter
  5.             Dim dsgexLoad As New DataSet
  6.             Dim recCount As Integer 'Tracks the number of records in the dataset dsgexLoad
  8.             Dim mySelectQuery As String = "SELECT i.ItemsID, c.Category,  s.SubCategory, " _
  9.                 & "i.Maker, i.ItemName, i.Measure, i.Size " _
  10.                 & "FROM (Categories AS c INNER JOIN SubCategory AS s ON c.CategoriesID=s.CategoriesID) " _
  11.                 & "INNER JOIN Items AS i ON s.SubCategoryID=i.SubCategoryID;"
  13.             Dim myConnection As New OleDbConnection(QponConnStr)
  14.             Dim myCommand As New OleDbCommand(mySelectQuery, myConnection)
  15.             myConnection.Open()
  16.             dagexLoad.SelectCommand = myCommand
  17.             dagexLoad.Fill(dsgexLoad) ‘<<<<< error here
  19.             If Not dsgexLoad.Tables(0).Rows.Count > 0 Then
Immediate window error message:
{"IErrorInfo.GetDescription failed with E_FAIL(0x80004005)."}
System.Data.OleDb.OleDbException: {"IErrorInfo.GetDescription failed with E_FAIL(0x80004005)."}
Data: {System.Collections.ListDictionaryInternal}
HelpLink: Nothing
InnerException: Nothing
Message: "IErrorInfo.GetDescription failed with E_FAIL(0x80004005)."
Source: "System.Data"
StackTrace: " at System.Data.OleDb.OleDbCommand.ExecuteCommandTextE rrorHandling(OleDbHResult hr) at System.Data.OleDb.OleDbCommand.ExecuteCommandTextF orSingleResult(tagDBPARAMS dbParams, Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteCommandText( Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteCommand(Comm andBehavior behavior, Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteReaderIntern al(CommandBehavior behavior, String method) at System.Data.OleDb.OleDbCommand.ExecuteReader(Comma ndBehavior behavior) at System.Data.OleDb.OleDbCommand.System.Data.IDbComm and.ExecuteReader(CommandBehavior behavior) at System.Data.Common.DbDataAdapter.FillInternal(Data Set dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behav
ior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) at QPon.Pricing.LoadgriPrices() in C:\QPon\QPon\QPon\Pricing.vb:line 129"
TargetSite: {System.Reflection.RuntimeMethodInfo}

Sorry for the length of the post but this has been bugging me for a long time as the same code seems towork perfectly well in a Access 2000 database with VB.Net programming. Any direction as WHAT I seem to be missing would be helped. Happen to send a demo attachement if desired.
May 14 '12 #1
Share this Question
Share on Google+
2 Replies

Expert Mod 100+
P: 465
Try this, Size is a reserved word in SQL, try changing
Expand|Select|Wrap|Line Numbers
  1. i.Size
Expand|Select|Wrap|Line Numbers
  1. i.[Size]
to see if that solves your issue
May 14 '12 #2

P: 2
Thank you had no idea that was the problem. In other istances I have gotten error messages that something was a reserved word, but I guess because it was inside the "SELECT statement" VB.Net did not highlight it. Suprised that Access 2007 didn't flag it. But thanks very much.
May 14 '12 #3

Post your reply

Sign in to post your reply or Sign up for a free account.