473,386 Members | 1,846 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,386 software developers and data experts.

entity framework doesn't work as a datasource?

I have the following code and can't quite figure out why it doesn't work. in
the first section, I am trying to take the data from a entity framework
function import and use it inside a repeater.

<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>
<% #Bind("Title") %>
</ItemTemplate>
</asp:Repeater>

In this section of code, I have the code that creates the entity context and
(I think) runs the function GetAllNews and binds it to the repeater control.
This doesn't seem to work for some reason.

Dim NewsContext As New eternityrecordsonlineEntities()
Repeater1.DataSource = NewsContext.GetAllNews()

I get this error from vs2008 when I am in the markup of the page:
Error 1 'If', 'ElseIf', 'Else', 'End If', 'Const', or 'Region' expected.
C:\Documents and Settings\Andy\My Documents\Visual Studio
2008\Projects\Test\Test\Test\Default.aspx Test

Any idea why this is?

Nov 8 '08 #1
1 3818
Ok. Fixed my own problem. the # was in the wrong spot.
"Andy B" <a_*****@sbcglobal.netwrote in message
news:%2******************@TK2MSFTNGP02.phx.gbl...
>I have the following code and can't quite figure out why it doesn't work.
in the first section, I am trying to take the data from a entity framework
function import and use it inside a repeater.

<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>
<% #Bind("Title") %>
</ItemTemplate>
</asp:Repeater>

In this section of code, I have the code that creates the entity context
and (I think) runs the function GetAllNews and binds it to the repeater
control. This doesn't seem to work for some reason.

Dim NewsContext As New eternityrecordsonlineEntities()
Repeater1.DataSource = NewsContext.GetAllNews()

I get this error from vs2008 when I am in the markup of the page:
Error 1 'If', 'ElseIf', 'Else', 'End If', 'Const', or 'Region' expected.
C:\Documents and Settings\Andy\My Documents\Visual Studio
2008\Projects\Test\Test\Test\Default.aspx Test

Any idea why this is?

Nov 8 '08 #2

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

Similar topics

11
by: Douglas Reith | last post by:
Hi There, Can someone please tell me why the XML spec states that an attribute value with an external entity is forbidden? Or point me to the appropriate document? Or better still, perhaps you...
4
by: Erwin Gabler | last post by:
Trying to validate a document with a reference to a DTD ("PUBLIC" identifier): <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE systems-description PUBLIC "-//foo/nono" ""> .... The DTD uses...
1
by: Harold Howe | last post by:
When .NET loads an app.config at runtime (myapp.exe.config), will it honor an entity declaration? Based on what I am seeing, the answer is no, but I think, or hope, that I am doing something wrong....
1
by: rengaraj | last post by:
JBoss version:4.0.4 Hibernate version:3.2 Database:Oracle10g Hi. I am facing an entity mapping problem. I have an Oracle stored function which takes as a parameter an Oracle array and returns a...
66
by: Jon Skeet [C# MVP] | last post by:
I'm sure the net will be buzzing with this news fairly soon, but just in case anyone hasn't seen it yet: Microsoft are going to make the source code for the .NET framework (parts of it,...
0
by: Andy B | last post by:
I wanted to try out the ado.net entity framework model and see how it was different from linq to sql entities. I put a page in a web application project, added an ado.net entity model and told it...
9
by: Cirene | last post by:
I'm about to begin a brand new, big, ASP.NET project (using 3.5 .net fw), VS 2008. I'm using MySQL as the backend (customer request.) I have absolutely no experience with LINQ and/or the Entity...
1
by: markla | last post by:
Hi, I have an Entity data model built in Entity Framework, which sources data primarily from an MS SQL 2008 database, and sources some static (data dictionary) values from code-based objects. I...
0
by: zman77 | last post by:
Hi. My solution (working in VS 2008) has a C# console app, and a C# web service. The service has an entity data model. It has numerous stored procedures. For one of the stored procs, which just...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
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...

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.