Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
|
ADO.NET For discussion about ADO.NET.  Topics such as question regarding the System.Data namespace are appropriate.  Questions specific to a particular application should be posted in a forum specific to the application .
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ADO.NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 10th, 2004, 01:07 PM
Registered User
 
Join Date: Mar 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Newbie who needs help with DataSet object!!!

I am having problems with the following code.

        Dim strConnection As String = ConfigurationSettings.AppSettings("OSF")
        Dim objConnection As New SqlClient.SqlConnection(strConnection)



        objConnection.Open()
        Dim strSQL As String = "SELECT SisterContact.ReligiousName FROM SisterContact INNER JOIN DeathNotice ON SisterContact.SisterUID = DeathNotice.SisterID"
        Dim objAdapter As New SqlClient.SqlDataAdapter(strSQL, objConnection)
        Dim objDataSet As New DataSet()
        objAdapter.Fill(objDataSet, "dtDeathNotice")
        lstDeathNotices.DataSource = objDataSet.Tables("dtDeathNotice")
        lstDeathNotices.DataBind()
        objConnection.Close()

In lblDeathNotices all that is appearing is System.Data.DataReader as the text...when what I want to appear is the data from the objDataSet.

Any Ideas?

Thanks in advance


 
Old March 10th, 2004, 08:25 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Typically, when you are going to bind a dataset to a control, you bind it to a repeating control like a Repeater, DataList or DataGrid. A label only will show a text value for a single item, it doesn't know how to bind multiple things.

You are trying to bind multiple rows correct? From you query I would expect multiple rows to be returned. Take a look at the repeater control. It will provide you with a very simple repeatable control you can use for simple repeating text output.

Peter
------------------------------------------------------
Work smarter, not harder.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting a untyped dataset to a typed dataset daphnean Visual Studio 2005 0 July 13th, 2006 01:16 AM
Ajax newbie with Object Required error bubberz BOOK: Professional Ajax ISBN: 978-0-471-77778-6 1 July 6th, 2006 11:52 AM
Can we use same Dataset Object? gaurav_jain2403 VS.NET 2002/2003 6 February 3rd, 2006 01:49 AM
Re: SQL Server dataset to ACCESS dataset dazzer ADO.NET 0 March 22nd, 2004 05:28 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.