473,396 Members | 1,918 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Nested Repeater Control

Hello All,

I am new to this so I apologize if this question has been asked before. I am working on nesting two data repeaters. The parent repeater displays Categories, and the child repeater displays the projects for each category as thumbnails.

I am having a hard time binding the data of the child repeater. When I compile, it says: "The column prefix 'Project' does not match with a table name or alias name used in the query"

Here is the code:

Dim MyQuery As New System.Text.StringBuilder
MyQuery.AppendLine("SELECT CategoryName ")
MyQuery.AppendLine("FROM Category ")
MyQuery.AppendLine("WHERE (Enabled = 1) ")

Using MyCommand As New SqlCommand(MyQuery.ToString, MyConnection)

Dim MyDataSet As New DataSet
Dim MyDataAdapter As New SqlDataAdapter(MyCommand)
MyDataAdapter.Fill(MyDataSet, "CategoryName")

End Using

Dim MyQuery2 As New System.Text.StringBuilder
MyQuery2.AppendLine("SELECT Project.*, Category.Id ")
MyQuery2.AppendLine("FROM Project, Category ")
MyQuery2.AppendLine("LEFT OUTER JOIN ProjectCategories AS ProjectID ON Project.Id = ProjectID.ProjectId ")
MyQuery2.AppendLine("LEFT OUTER JOIN ProjectCategories AS CategoryID ON Category.Id = CategoryID.CategoryId ")
MyQuery2.AppendLine("WHERE (Project.Enabled = 1) ")

Using MyCommand2 As New SqlCommand(MyQuery2.ToString, MyConnection)

Dim MyDataSet As New DataSet
Dim MyDataAdapter As New SqlDataAdapter(MyCommand2)
MyDataAdapter.Fill(MyDataSet, "ProjectThumbnailURL")

'Dim MyDataView As New DataView(MyDataSet.Table("CategoryName"))


MyDataSet.Relations.Add("MyRelation", MyDataSet.Tables("Category").Columns("Id"), MyDataSet.Tables("Project").Columns("Id"))

rptCategories.DataSource = MyDataSet
rptCategories.DataBind()
End Using
End Using (for con)

Thanks all for your help!
Apr 25 '07 #1
1 1211
TRScheel
638 Expert 512MB
Not knowing how your database is set up, I would suggest removing the Project.* and replacing it with just *. Seems like its having an issue with that prefix
Apr 25 '07 #2

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

Similar topics

1
by: Maziar Aflatoun | last post by:
Hi, I have tried setting up a nested repeater control and it works fine. But when I do 3 level nested repeater it fails. Does anyone know a site or have an example of a three level nestest...
3
by: sorCrer | last post by:
Hi All, Posted after extensive searching! I have a nested repeater control as follows: (Simplified ;-)) <table> <asp:repeater id=parent onItemDataBound=createChild> <tr><td>Level...
1
by: humbleFunGuy | last post by:
What does nested controls mean in .Net? Any help is appreciated. Thanks, fanzi
4
by: =?Utf-8?B?SmFtZXMgR2V1cnRz?= | last post by:
On my page, I have one repeater that contains a literal control and a nested repeater. The nested repeater contains a literal control. Both repeaters are databound with only one object (string). ...
0
by: Adam Knight | last post by:
Hi All, I have a repeater control nested inside another repeater control. The nested (child) repeater control, is bound to an object data source. My problem is, i need to send a data item...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
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...
0
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...
0
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,...

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.