473,545 Members | 1,956 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Repost: Error message

I've got a program that collects info from an Access. I'm trying to use the
following select command to select all the information from the "Families"
table and store it in a dataset, plus join the Surname and FirstName fields
to create a new field, FamilyName:

selFamilies.Com mandText = "SELECT Families.*, Families.Surnam e + ', ' +
Families.FirstN ame AS FamilyName FROM Families ORDER BY Surname, FirstName"

This has been working perfectly a number of times until recently, and now
when I try to run the program, it stops on this line:

adpFamilies.Fil l(datSPARK, "Families")

and gives me this error message:

"An unhandled exception of type 'System.Invalid OperationExcept ion' occurred
in system.data.dll
Additional information: Invalid attempt to NextResult when reader is
closed."

I'm new to the whole database thing, and this message is Greek to me. If I
use this simple select command instead:

selFamilies.Com mandText = "SELECT * FROM Families ORDER BY Surname,
FirstName"

the program doesn't give me the error.

I would really appreciate any help anyone can give me.

Thanks
Carolyn
Nov 20 '05 #1
21 1798
Hi,

Try this.

selFamilies.Com mandText = "SELECT Families.*, (Families.Surna me + ', ' +
Families.FirstN ame) AS FamilyName FROM Families ORDER BY Surname, FirstName

Ken
-----------------
"Carolyn" <so*****@newsgr oups.microsoft. com> wrote in message
news:e%******** ********@TK2MSF TNGP11.phx.gbl. ..
I've got a program that collects info from an Access. I'm trying to use the following select command to select all the information from the "Families"
table and store it in a dataset, plus join the Surname and FirstName fields to create a new field, FamilyName:

selFamilies.Com mandText = "SELECT Families.*, Families.Surnam e + ', ' +
Families.FirstN ame AS FamilyName FROM Families ORDER BY Surname, FirstName"
This has been working perfectly a number of times until recently, and now
when I try to run the program, it stops on this line:

adpFamilies.Fil l(datSPARK, "Families")

and gives me this error message:

"An unhandled exception of type 'System.Invalid OperationExcept ion' occurred in system.data.dll
Additional information: Invalid attempt to NextResult when reader is
closed."

I'm new to the whole database thing, and this message is Greek to me. If I use this simple select command instead:

selFamilies.Com mandText = "SELECT * FROM Families ORDER BY Surname,
FirstName"

the program doesn't give me the error.

I would really appreciate any help anyone can give me.

Thanks
Carolyn

Nov 20 '05 #2
Hi,

Try this.

selFamilies.Com mandText = "SELECT Families.*, (Families.Surna me + ', ' +
Families.FirstN ame) AS FamilyName FROM Families ORDER BY Surname, FirstName

Ken
-----------------
"Carolyn" <so*****@newsgr oups.microsoft. com> wrote in message
news:e%******** ********@TK2MSF TNGP11.phx.gbl. ..
I've got a program that collects info from an Access. I'm trying to use the following select command to select all the information from the "Families"
table and store it in a dataset, plus join the Surname and FirstName fields to create a new field, FamilyName:

selFamilies.Com mandText = "SELECT Families.*, Families.Surnam e + ', ' +
Families.FirstN ame AS FamilyName FROM Families ORDER BY Surname, FirstName"
This has been working perfectly a number of times until recently, and now
when I try to run the program, it stops on this line:

adpFamilies.Fil l(datSPARK, "Families")

and gives me this error message:

"An unhandled exception of type 'System.Invalid OperationExcept ion' occurred in system.data.dll
Additional information: Invalid attempt to NextResult when reader is
closed."

I'm new to the whole database thing, and this message is Greek to me. If I use this simple select command instead:

selFamilies.Com mandText = "SELECT * FROM Families ORDER BY Surname,
FirstName"

the program doesn't give me the error.

I would really appreciate any help anyone can give me.

Thanks
Carolyn

Nov 20 '05 #3
Try this

Try

selFamilies.Com mandText ="SELECT Families.Surnam e, Families.Surnam e FROM
People ORDER BY Families.Surnam e, Families.Surnam e"

Catch ex as Exception

MessageBox.Show (ex.ToString())

End try

Hopefully this amended Commandtext will do the trick, if not at least you
will get an error message with a bit more detail.
Regards OHM
Nov 20 '05 #4
Try this

Try

selFamilies.Com mandText ="SELECT Families.Surnam e, Families.Surnam e FROM
People ORDER BY Families.Surnam e, Families.Surnam e"

Catch ex as Exception

MessageBox.Show (ex.ToString())

End try

Hopefully this amended Commandtext will do the trick, if not at least you
will get an error message with a bit more detail.
Regards OHM
Nov 20 '05 #5
Exchange people for Families.

Sorry OHM
One Handed Man wrote:
Try this

Try

selFamilies.Com mandText ="SELECT Families.Surnam e,
Families.Surnam e FROM People ORDER BY Families.Surnam e,
Families.Surnam e"

Catch ex as Exception

MessageBox.Show (ex.ToString())

End try

Hopefully this amended Commandtext will do the trick, if not at least
you will get an error message with a bit more detail.
Regards OHM

Nov 20 '05 #6
Exchange people for Families.

Sorry OHM
One Handed Man wrote:
Try this

Try

selFamilies.Com mandText ="SELECT Families.Surnam e,
Families.Surnam e FROM People ORDER BY Families.Surnam e,
Families.Surnam e"

Catch ex as Exception

MessageBox.Show (ex.ToString())

End try

Hopefully this amended Commandtext will do the trick, if not at least
you will get an error message with a bit more detail.
Regards OHM

Nov 20 '05 #7
> Try

selFamilies.Com mandText ="SELECT Families.Surnam e, Families.Surnam e FROM People ORDER BY Families.Surnam e, Families.Surnam e"

Catch ex as Exception

MessageBox.Show (ex.ToString())

End try

Hopefully this amended Commandtext will do the trick, if not at least you
will get an error message with a bit more detail.


Sorry, I don't understand what your select statement was supposed to
accomplish. If I use that statement, no errors are encountered--the adapter
is not having any trouble accessing the FirstName and Surname columns. But
I tried the Catch and got this "explanatio n":

System.InvalidO perationExcepti on: Invalid attempt to NextResult when reader
is closed.
at System.Data.Ole Db.OleDbDataRea der.NextResult( )
at System.Data.Com mon.DbDataAdapt er.FillNextResu lt(IDataReader dataReader)
at System.Data.Com mon.DbDataAdapt er.FillFromRead er(Object data, String
srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords,
DataColumn parentChapterCo lumn, Object parentChapterVa lue)
at System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, String srcTable,
IDataReader dataReader, Int32 startRecord, Int32 maxRecords)
at System.Data.Com mon.DbDataAdapt er.Fill(Object data, Int32 startRecord,
Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior
behavior)
at System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, Int32 startRecord,
Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior
behavior)
at System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, String srcTable)
at SPARK.frmFamily Info.GetFamilie s() in C:\Documents and Settings\Owner\ My
Documents\Visua l Studio Projects\SPARK\ Info Boxes\Family Information.vb: line
1511

Line 1511 is the statement "adpFamilies.Fi ll(datSPARK, "Families") "
Nov 20 '05 #8
> Try

selFamilies.Com mandText ="SELECT Families.Surnam e, Families.Surnam e FROM People ORDER BY Families.Surnam e, Families.Surnam e"

Catch ex as Exception

MessageBox.Show (ex.ToString())

End try

Hopefully this amended Commandtext will do the trick, if not at least you
will get an error message with a bit more detail.


Sorry, I don't understand what your select statement was supposed to
accomplish. If I use that statement, no errors are encountered--the adapter
is not having any trouble accessing the FirstName and Surname columns. But
I tried the Catch and got this "explanatio n":

System.InvalidO perationExcepti on: Invalid attempt to NextResult when reader
is closed.
at System.Data.Ole Db.OleDbDataRea der.NextResult( )
at System.Data.Com mon.DbDataAdapt er.FillNextResu lt(IDataReader dataReader)
at System.Data.Com mon.DbDataAdapt er.FillFromRead er(Object data, String
srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords,
DataColumn parentChapterCo lumn, Object parentChapterVa lue)
at System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, String srcTable,
IDataReader dataReader, Int32 startRecord, Int32 maxRecords)
at System.Data.Com mon.DbDataAdapt er.Fill(Object data, Int32 startRecord,
Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior
behavior)
at System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, Int32 startRecord,
Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior
behavior)
at System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, String srcTable)
at SPARK.frmFamily Info.GetFamilie s() in C:\Documents and Settings\Owner\ My
Documents\Visua l Studio Projects\SPARK\ Info Boxes\Family Information.vb: line
1511

Line 1511 is the statement "adpFamilies.Fi ll(datSPARK, "Families") "
Nov 20 '05 #9
> Try this.

selFamilies.Com mandText = "SELECT Families.*, (Families.Surna me + ', ' +
Families.FirstN ame) AS FamilyName FROM Families ORDER BY Surname, FirstName


This returns the same error message.
Nov 20 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2232
by: Programatix | last post by:
Hi, I'm working on a project which includes WebServices and Windows Form application. The Windows Form application will call the WebServices to retrieve data from database. The data will be returned as DataSet. Now, here's the problem. On .NET Framework 1.1, if any rows in the dataset returned contain errors (marked by calling the...
5
1740
by: Joe | last post by:
Please repost answer message did not make it last time Hello, Joe here, wanted to get the 411 on this article. I posted in the FrontPage forum but there is never an answer. So I have come here, where all my IIS problems have been solved (Thank YOU!!) I want to create a small utility web site with a logon page and a form connected to an...
1
1687
by: Yannick Turgeon | last post by:
Hello, This is a repost (see under the "dotted" line) from 2 days ago. Hope someone could help. Norton Antivirus 2003 is installed on this computer. Could it cause a problem? Another interesting thing is when I open a email with the DB attached (on the ME computer), the file is not "enabled" in the file list, it's grey. First time I see...
3
1846
by: Adam | last post by:
I've posted about this previously, but failed to receive a satisfactory response, so have included a code sample: I am trying to receive messages from an HTML viewer control in compact.net (c#), but cannot use message window as the control's parent window, as this is invisible and so the html is not viewable! I have a code sample showing...
1
3649
by: JoeS | last post by:
Is there anyway to share a single pch file between projects in VC 7.0? I have 300+ projects each of which creates its own pch. All projects include the exact same header files in the precompiled header. Its takes about 7 seconds to create the precompiled header for each project. That's 35 minutes spent creating precompiled headers for all...
0
2036
by: Doug | last post by:
This is a repost of an item that I still cannot resolve. I have 3 combo boxes. The first leads to the second to the third. When I have selected a value in the second box, the third box shows the available information based on the second combo box selection. But if I change my mind and select a different item in the second box, after the...
14
2810
by: Steve McLellan | last post by:
Hi, Sorry to repost, but this is becoming aggravating, and causing me a lot of wasted time. I've got a reasonably large mixed C++ project, and after a number of builds (but not a constant number) linking (and sometimes compiling) becomes immensely slow, and task manager shows that link.exe (or cl.exe) is barely using any processor time, but...
2
1858
by: Learning SQL Server | last post by:
Forgive the repost, but this is really troublesome and I hope SOMEONE can shed some light on it. I am trying to update a datarow via in-place editing from a dataset stored in session. When I try to write the new value into the selected row, I always get the following error : Column is read-only. in my UpdateCommand event I have:
0
1652
by: Ken Powers | last post by:
Hello everyone, Sorry about the repost, my second VB.NET App is done with the exception of this error. I'm getting a strange error when I try to bind a combo box to a Dataset. Here's my code! Private Sub Get_Data() Try Dim sqlcmd = New SqlCommand("Select * from Utility order by
1
2040
by: lecnac | last post by:
Sorry for the repost. I must have done something wrong when I tried to post my reply (I can't seem to find it). Anyway, I'd really appreciate any help that anyone could provide. My issue is quickly becoming more and more urgent. Thanks for the thoughts Bruce. However, we can't do #1 (we must use Integrated Windows Authentication). ...
0
7484
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7675
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7775
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5997
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5344
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4963
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3470
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3451
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
726
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.