J
Jamie Sutherland
Hi,
My page has a repeater control on it which puls data from my sql db. the
query string I have has several fields of the same name but from different
tables(shown below). On my aspx page I have the following:
<asp:Repeater id="rprActiveOp" runat="server">
<ItemTemplate>
<%# DataBinder.Eval(Container, "DataItem.title") & " " &
DataBinder.Eval(Container, "DataItem.firstname") & " " &
DataBinder.Eval(Container, "DataItem.lastname")%>
<br>
<%# databinder.Eval(Container, "DataItem.College_Name") %>
</ItemTemplate>
</repeater>
How do I use the other fields with the same name but from the different
tables?
Dim strsql As String = "SELECT tbl_user_opps.opp_id, tbl_user_opps.Status,
tbl_User_Details.Title, tbl_User_Details.Firstname,
tbl_User_Details.Lastname, " & _
"tbl_colleges.College_Name, tbl_colleges.Address1,
tbl_colleges.Address2, tbl_colleges.Town, tbl_colleges.County,
tbl_colleges.PostalCode, " & _
"tbl_colleges.Telephone, tbl_colleges.Website, tbl_colleges.Title,
tbl_colleges.Firstname, tbl_colleges.lastname, tbl_colleges.JobTitle, " & _
"tbl_opportunities.Opp_Name FROM tbl_colleges INNER JOIN
tbl_User_Details ON tbl_colleges.College_Id = tbl_User_Details.College_Id
INNER JOIN " & _
"tbl_opportunities INNER JOIN tbl_user_opps ON
tbl_opportunities.opp_id = tbl_user_opps.opp_id ON tbl_User_Details.Username
= tbl_user_opps.Username " & _
"WHERE (tbl_user_opps.opp_id ='15') AND (tbl_user_opps.Status =
'Approved')"
Dim cmd As New SqlCommand(strsql, conn)
Try
conn.Open()
rprActiveOp.DataSource = cmd.ExecuteReader
rprActiveOp.DataBind()
Catch ex As Exception
Throw New Exception(ex.Message)
Thanks
Jamie
My page has a repeater control on it which puls data from my sql db. the
query string I have has several fields of the same name but from different
tables(shown below). On my aspx page I have the following:
<asp:Repeater id="rprActiveOp" runat="server">
<ItemTemplate>
<%# DataBinder.Eval(Container, "DataItem.title") & " " &
DataBinder.Eval(Container, "DataItem.firstname") & " " &
DataBinder.Eval(Container, "DataItem.lastname")%>
<br>
<%# databinder.Eval(Container, "DataItem.College_Name") %>
</ItemTemplate>
</repeater>
How do I use the other fields with the same name but from the different
tables?
Dim strsql As String = "SELECT tbl_user_opps.opp_id, tbl_user_opps.Status,
tbl_User_Details.Title, tbl_User_Details.Firstname,
tbl_User_Details.Lastname, " & _
"tbl_colleges.College_Name, tbl_colleges.Address1,
tbl_colleges.Address2, tbl_colleges.Town, tbl_colleges.County,
tbl_colleges.PostalCode, " & _
"tbl_colleges.Telephone, tbl_colleges.Website, tbl_colleges.Title,
tbl_colleges.Firstname, tbl_colleges.lastname, tbl_colleges.JobTitle, " & _
"tbl_opportunities.Opp_Name FROM tbl_colleges INNER JOIN
tbl_User_Details ON tbl_colleges.College_Id = tbl_User_Details.College_Id
INNER JOIN " & _
"tbl_opportunities INNER JOIN tbl_user_opps ON
tbl_opportunities.opp_id = tbl_user_opps.opp_id ON tbl_User_Details.Username
= tbl_user_opps.Username " & _
"WHERE (tbl_user_opps.opp_id ='15') AND (tbl_user_opps.Status =
'Approved')"
Dim cmd As New SqlCommand(strsql, conn)
Try
conn.Open()
rprActiveOp.DataSource = cmd.ExecuteReader
rprActiveOp.DataBind()
Catch ex As Exception
Throw New Exception(ex.Message)
Thanks
Jamie