473,725 Members | 2,173 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

binding datalist to dataset with two datatables

I built a dataset with two datatables and added the relation. The example in
the help text for datatable class seemed sufficient. Binding a datalist
using the dataset for datasource and the parent datatable name as the
datamember does not work for me.

Columns from the child (or second) datatable in the dataset are not found.

Using vb.net for code-behind. The binding statement for a control looks
like this:
Text='<%# DataBinder.Eval (Container.Data Item, "CallTypeCo de") %>'

I can see in debug that there are two tables in the dataset and the row
counts are correct.

What have I missed?

Thanks, Alex

Nov 19 '05 #1
2 4420
Did you remember to do a Page.DataBind() in the Page_Load Event ?
"Alex S Moore" <Al********@dis cussions.micros oft.com> wrote in message
news:FE******** *************** ***********@mic rosoft.com...
I built a dataset with two datatables and added the relation. The example
in
the help text for datatable class seemed sufficient. Binding a datalist
using the dataset for datasource and the parent datatable name as the
datamember does not work for me.

Columns from the child (or second) datatable in the dataset are not found.

Using vb.net for code-behind. The binding statement for a control looks
like this:
Text='<%# DataBinder.Eval (Container.Data Item, "CallTypeCo de") %>'

I can see in debug that there are two tables in the dataset and the row
counts are correct.

What have I missed?

Thanks, Alex

Nov 19 '05 #2


"Mr Newbie" wrote:
Did you remember to do a Page.DataBind() in the Page_Load Event ?


I have never used that, so I will look into it.

Thanks, Alex

Nov 19 '05 #3

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

Similar topics

3
1457
by: neverstill | last post by:
So I thought I had a solution to my problem using DataRelations with the DataSet. I need to display hierarchical data. I have a DataList nested into another DataList. My datasource is a DataSet with 2 tables and a couple of DataRelations. I thought that I could catch the items as they were bouind in ItemDataBound(), then from there get the ChildRows() and bind that to the nested DataList. Problem is, when I get the DataItem from...
0
1393
by: lc | last post by:
At design-time, a datalist is hooked up to a dataset and it would work as expected at run-time. Then I added code for paging (with) PagedDataSet but the paging wouldn't work until I removed design-time datalist binding. I tried to remove the binding in code but it doesn't help either: DataList1.DataMember = ""; DataList1.DataSource = null; MyAdapter.Fill( OriginalDataSet.Tables );
0
926
by: lc | last post by:
I know this is the 3rd post, sorry about this. This may be a lame question but it drives me nuts. At design-time, a datalist is hooked up to a dataset and it would work as expected at run-time. Then I added code for paging (with) PagedDataSet but the paging wouldn't work until I removed design-time datalist binding. I tried to remove the binding in code but it doesn't help either:
1
1337
by: Laura K | last post by:
Can someone tell me where I went wrong. This is my code for binding data to a datalist. <script language="vb"> Sub Page_Load(Src As Object, e As EventArgs) Dim Con As New SqlConnection("server=(PathToDataBase)"; & "database=name;User ID=UID;Password=password") Dim myCommand As New SqlDataAdapter myCommand= ("select distinct strSubCategory from tblProducts", con)
3
2049
by: bbernieb | last post by:
Hi, All, Is it possible to access a variable inside of a data binding, without the variable being out of scope? (Note: On the DataBinder line, I get an error message that says "Name 'i' is not declared". The data bind is for a DataList.)
2
3623
by: Andrew Robinson | last post by:
Is there any way to accomplish two way data binding in a Details View with a DataSet or DataTable as the DataSource. All I want is to get an updated DataSet or DataTable back from the DetailsView and then handle my updating manually. -Andrew
0
2079
by: | last post by:
I have a question about spawning and displaying subordinate list controls within a list control. I'm also interested in feedback about the design of my search application. Lots of code is at the end of this message, but I will start with an overview of the problem. I've made a content management solution for my work with a decently structured relational database system. The CMS stores articles. The CMS also stores related items --...
9
10919
by: =?Utf-8?B?RGljaw==?= | last post by:
I have a function that creates a DataSet, populates its many DataTables and then returns the DataSet. I want to bind separate controls to each of the DataSet's DataTables, e.g. a separate GridView for each DataTable. As far as I can tell, the ObjectDataSource only binds to the DefaultView of the DataSet's first DataTable. I'd like to know how to bind to the other DataTables or, if this is not possible, what alternative technique is...
8
3433
by: TimVtoo | last post by:
Hi all and thanks for looking. I need to make the move from ASP to ASP.NET, and as my sister has aked me to knock up a website for her, I thought this could be a nice starter project to help me learn. The site displays thumnails of images she will upload. Each file needs some information stored in a database about it. In classic asp I would have created a list of images and realated info within a database and driven the site from this....
0
8752
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
9401
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...
0
9257
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9176
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
9113
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...
1
6702
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
4784
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2635
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2157
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.