473,761 Members | 5,848 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem Getting Data From DataSet

I have retrieved data from a database using a SELECT statement that includes
an INNER JOIN. The data seems to be retrieved to the DataSet OK, but I am
having trouble getting the data from the DataSet. The code I am using is as
follows:
Private Sub btnDownloadDB_C lick(ByVal sender As System.Object, ByVal e As
System.Web.UI.I mageClickEventA rgs) Handles btnDownloadDB.C lick
Dim papdatabase As New DataSet
Dim cmdSelect As New System.Data.Ole Db.OleDbCommand ("SELECT
members.organiz ation,membernam es.fname,member names.lname,mem bers.address1,m embers.address2 ,members.city,m embers.state,me mbers.zip,membe rs.phone,member s.email,members .fax,members.we bsite
FROM members INNER JOIN membernames ON
members.memberi d=membernames.m emberid", New
OleDb.OleDbConn ection("PROVIDE R=Microsoft.Jet .OLEDB.4.0;DATA SOURCE=" &
Server.MapPath( "/papresenters.md b")))
Dim dataadapterSele ct As New System.Data.Ole Db.OleDbDataAda pter
dataadapterSele ct.SelectComman d = cmdSelect
dataadapterSele ct.Fill(papdata base)

Response.ClearC ontent()
Response.Conten tType = "text/plain"
Response.AddHea der("content-disposition",
"attachment;fil ename=members.t xt")
Const TAB As String = Chr(9)
Response.Write( "ORGANIZATI ON" & TAB & "FNAME LNAME" & TAB & "ADDRESS1" &
TAB & "ADDRESS2" & TAB & "CITY" & TAB & "STATE" & TAB & "ZIP" & TAB &
"PHONE" & TAB & "EMAIL" & TAB & "FAX" & TAB & "WEBSITE")
For Each member As System.Data.Dat aRow In papdatabase.Tab les(0).Rows
Response.Write( ControlChars.Ne wLine & CStr(member("or ganization")) &
TAB & CStr(member("fn ame")) & " " & CStr(member("ln ame")) & TAB &
CStr(member("ad dress1")) & TAB & CStr(member("ad dress2")) & TAB &
CStr(member("ci ty")) & TAB & CStr(member("st ate")) & TAB &
CStr(member("zi p")) & TAB & CStr(member("ph one")) & TAB &
CStr(member("em ail")) & TAB & CStr(member("fa x")) & TAB &
CStr(member("we bsite")))
Next
Response.End()
End Sub
This gives me the following error:
Server Error in '/' Application.
--------------------------------------------------------------------------------

Runtime Error
Description: An application error occurred on the server. The current custom
error settings for this application prevent the details of the application
error from being viewed remotely (for security reasons). It could, however,
be viewed by browsers running on the local server machine.

Details: To enable the details of this specific error message to be viewable
on remote machines, please create a <customErrors > tag within a "web.config "
configuration file located in the root directory of the current web
application. This <customErrors > tag should then have its "mode" attribute
set to "Off".

<!-- Web.Config Configuration File -->

<configuratio n>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>

Notes: The current error page you are seeing can be replaced by a custom
error page by modifying the "defaultRedirec t" attribute of the application's
<customErrors > configuration tag to point to a custom error page URL.

<!-- Web.Config Configuration File -->

<configuratio n>
<system.web>
<customErrors mode="RemoteOnl y" defaultRedirect ="mycustompage. htm"/>
</system.web>
</configuration>

Based on the tests I managed to do, the problem seems to be in the For Each
loop near the end, when I comment out this loop everything goes fine. What
am I doing wrong? Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/
Nov 19 '05 #1
1 1413
You should enable debugging on that page (or set debug mode to RemoteOnly,
log into the box, & hit the page). That will show you the exact line & error
string, which should quickly show you exactly what the issue is.

--
Benjamin Strackany
http://www.developmentnow.com
"Nathan Sokalski" <nj********@hot mail.com> wrote in message
news:OA******** ******@TK2MSFTN GP10.phx.gbl...
I have retrieved data from a database using a SELECT statement that includes an INNER JOIN. The data seems to be retrieved to the DataSet OK, but I am
having trouble getting the data from the DataSet. The code I am using is as follows:
Private Sub btnDownloadDB_C lick(ByVal sender As System.Object, ByVal e As
System.Web.UI.I mageClickEventA rgs) Handles btnDownloadDB.C lick
Dim papdatabase As New DataSet
Dim cmdSelect As New System.Data.Ole Db.OleDbCommand ("SELECT
members.organiz ation,membernam es.fname,member names.lname,mem bers.address1,m e
mbers.address2, members.city,me mbers.state,mem bers.zip,member s.phone,members .
email,members.f ax,members.webs ite FROM members INNER JOIN membernames ON
members.memberi d=membernames.m emberid", New
OleDb.OleDbConn ection("PROVIDE R=Microsoft.Jet .OLEDB.4.0;DATA SOURCE=" &
Server.MapPath( "/papresenters.md b")))
Dim dataadapterSele ct As New System.Data.Ole Db.OleDbDataAda pter
dataadapterSele ct.SelectComman d = cmdSelect
dataadapterSele ct.Fill(papdata base)

Response.ClearC ontent()
Response.Conten tType = "text/plain"
Response.AddHea der("content-disposition",
"attachment;fil ename=members.t xt")
Const TAB As String = Chr(9)
Response.Write( "ORGANIZATI ON" & TAB & "FNAME LNAME" & TAB & "ADDRESS1" & TAB & "ADDRESS2" & TAB & "CITY" & TAB & "STATE" & TAB & "ZIP" & TAB &
"PHONE" & TAB & "EMAIL" & TAB & "FAX" & TAB & "WEBSITE")
For Each member As System.Data.Dat aRow In papdatabase.Tab les(0).Rows
Response.Write( ControlChars.Ne wLine & CStr(member("or ganization")) & TAB & CStr(member("fn ame")) & " " & CStr(member("ln ame")) & TAB &
CStr(member("ad dress1")) & TAB & CStr(member("ad dress2")) & TAB &
CStr(member("ci ty")) & TAB & CStr(member("st ate")) & TAB &
CStr(member("zi p")) & TAB & CStr(member("ph one")) & TAB &
CStr(member("em ail")) & TAB & CStr(member("fa x")) & TAB &
CStr(member("we bsite")))
Next
Response.End()
End Sub
This gives me the following error:
Server Error in '/' Application.
-------------------------------------------------------------------------- ------
Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application
error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors > tag within a "web.config " configuration file located in the root directory of the current web
application. This <customErrors > tag should then have its "mode" attribute
set to "Off".

<!-- Web.Config Configuration File -->

<configuratio n>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>

Notes: The current error page you are seeing can be replaced by a custom
error page by modifying the "defaultRedirec t" attribute of the application's <customErrors > configuration tag to point to a custom error page URL.

<!-- Web.Config Configuration File -->

<configuratio n>
<system.web>
<customErrors mode="RemoteOnl y" defaultRedirect ="mycustompage. htm"/> </system.web>
</configuration>

Based on the tests I managed to do, the problem seems to be in the For Each loop near the end, when I comment out this loop everything goes fine. What
am I doing wrong? Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

Nov 19 '05 #2

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

Similar topics

14
2262
by: Venkat Chellam | last post by:
I have a peculiar problem. I have a simple web application which loads some data from the oracle table and display in the datagrid in the webpage and datagrid has page enabled which shows 10 rows at a page.I have a search criteria to search the records based on the data range i give This is what i have done, in the !IsPostBack section. I am setting up the oracle connection, creating dataset object, datadapter and i aslo load the data...
8
2916
by: I am Sam | last post by:
Hi everyone, This problem is making me old. I don't want to get any older. I have a multi-nested repeater control as follows: <asp:Repeater ID="clubRep1" Runat="server"> <HeaderTemplate><table> </HeaderTemplate> <ItemTemplate>
1
1539
by: Eustice Scrubb | last post by:
I'm trying to use the Insert.aspx Quickstart and I'm getting a NULL pointer exception. Any help? <code> <script language="VB" runat="server"> Dim myConnection As SqlConnection Sub Page_Load(Src As Object, e As EventArgs) ' Create a connection to the SQL Server myConnection = New SqlConnection("Data Source=SERVER;" _
14
2131
by: Lars Netzel | last post by:
A little background: I use three Datagrids that are in a child parent relation. I Use Negative Autoincrement on the the DataTables and that's workning nice. My problem is when I Update these grid and write to the database and I set the new Primary Keys and related Fields to the new asigned atuonumbers in the Access.
1
1040
by: Nathan Sokalski | last post by:
I have retrieved data from a database using a SELECT statement that includes an INNER JOIN. The data seems to be retrieved to the DataSet OK, but I am having trouble getting the data from the DataSet. The code I am using is as follows: Private Sub btnDownloadDB_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles btnDownloadDB.Click Dim papdatabase As New DataSet Dim cmdSelect As New...
7
3469
by: Dabbler | last post by:
I'm using an ObjectDataSource with a stored procedure and am getting the following error when trying to update (ExecuteNonQuery): System.Data.SqlClient.SqlException: Procedure or Function 'UpdateRegistrant' expects parameter '@EMail', which was not supplied. The field value was null in the database and not changed in the FormView so is null going back into the stored procedure. I'm stumped and would greatly appreciate any suggestions.
2
2596
by: Carl Heller | last post by:
Working in VS2003, .Net 1.1 I'm working on a project where I compare data between two databases. This is a lengthy process, and very data intensive, so I decided to create a class, and thread out the work. The order of work is as follows: 1. Retrieve the data from primary data source 2. Update UI with retrieved data - this is accomplished by passing a dataset as an event parameter
6
3800
by: Suresh | last post by:
Hi All, I am fetching a dataset from the database under some condition. After this I create a data table. Traverse in the original dataset & add each row to created data table as it is through LoadDataRow method. After adding the row I just update 4-5 columns out of 20 columns in the row. After entire looping I fire the AcceptChanges method on data table. After this I am trying to update this data back to database in two ways - 1) Merge...
2
1646
by: Jeff | last post by:
Hey ..NET 2.0 I'm developing an application which will perform some webservice calls and I believe having those calls in a separate thread may help the app run smoother No user are waiting for the result of these webservice calls, Each night this code calls some webservices, which return a result I need to store in
0
9336
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10111
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9902
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9765
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8770
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7327
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5215
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
3446
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2738
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.