what to use for display

J

JohnE

I have a formview that I need to display a listing of items in. This list is
related to the one record that the formview is displaying. So it is a one to
many issue. My question is what is the best way to display the data? It
would be in the ItemTemplate of the formview. It would also need to show in
the EditTemplate as well. Currently, the formview is working just like it
should be so only the display of the multiple is needed.
Thanks.
John
 
J

JohnE

JohnE said:
I have a formview that I need to display a listing of items in. This list is
related to the one record that the formview is displaying. So it is a one to
many issue. My question is what is the best way to display the data? It
would be in the ItemTemplate of the formview. It would also need to show in
the EditTemplate as well. Currently, the formview is working just like it
should be so only the display of the multiple is needed.
Thanks.
John

I started using a listview that is using a sqldatasource. I have gotten the
listview to work but it is showing all the application in the table. I hard
code a CR in and it shows what is there for it. The sqldatasource is below.
If a put in the WHERE the @cr a get an error indicating to 'declare the
variable @cr'.

<asp:SqlDataSource ID="ApplicationItemSqlDataSource" runat="server"
ConnectionString="<%$ ConnectionStrings:proteusConnectionString %>"
SelectCommand="SELECT tblApplicationItem.ApplicationItem
FROM tblApplication
INNER JOIN tblApplicationItem ON
tblApplication.ApplicationItemID = tblApplicationItem.ApplicationItemID
INNER JOIN tblChangeRequest ON
tblApplication.ChangeRequestID = tblChangeRequest.ChangeRequestID
WHERE tblApplication.ChangeRequestID = @cr
ORDER BY
tblApplicationItem.ApplicationItem">
</asp:SqlDataSource>

My question now is how do I pass it from the gridview that is passing the cr
to the formview also to the listview?

Thanks...John
 
J

JohnE

JohnE said:
I started using a listview that is using a sqldatasource. I have gotten the
listview to work but it is showing all the application in the table. I hard
code a CR in and it shows what is there for it. The sqldatasource is below.
If a put in the WHERE the @cr a get an error indicating to 'declare the
variable @cr'.

<asp:SqlDataSource ID="ApplicationItemSqlDataSource" runat="server"
ConnectionString="<%$ ConnectionStrings:proteusConnectionString %>"
SelectCommand="SELECT tblApplicationItem.ApplicationItem
FROM tblApplication
INNER JOIN tblApplicationItem ON
tblApplication.ApplicationItemID = tblApplicationItem.ApplicationItemID
INNER JOIN tblChangeRequest ON
tblApplication.ChangeRequestID = tblChangeRequest.ChangeRequestID
WHERE tblApplication.ChangeRequestID = @cr
ORDER BY
tblApplicationItem.ApplicationItem">
</asp:SqlDataSource>

My question now is how do I pass it from the gridview that is passing the cr
to the formview also to the listview?

Thanks...John

Thought I would give an update. I no longer get an error but I get no info
for the listview either. Sending the sqldatasource and what I have for the
source code of the listview. The listview is inside a formview that shows
the details of a record from a gridview. I get the correct data with
exception of the nested listview.

<th>Application:</th>
<td><asp:ListView ID="lvwItemApplications" runat="server"
DataSourceID="ApplicationItemSqlDataSource" DataKeyNames="ChangeRequestID" >
<LayoutTemplate>
<asp:placeHolder ID="itemPlaceholder" runat="server" />
</LayoutTemplate>
<ItemTemplate>
<asp:Label ID="ItemApplicationsLabel" runat="server" Text='<%#
Eval("ApplicationItem") %>' />
</ItemTemplate>
</asp:ListView>


<asp:SqlDataSource ID="ApplicationItemSqlDataSource" runat="server"
ConnectionString="<%$ ConnectionStrings:proteusConnectionString %>"
SelectCommand="SELECT tblApplicationItem.ApplicationItem,
tblApplication.ChangeRequestID
FROM tblApplication
INNER JOIN tblApplicationItem ON
tblApplication.ApplicationItemID = tblApplicationItem.ApplicationItemID
INNER JOIN tblChangeRequest ON
tblApplication.ChangeRequestID = tblChangeRequest.ChangeRequestID
WHERE tblApplication.ChangeRequestID = @ChangeRequestID
ORDER BY tblApplicationItem.ApplicationItem">

<SelectParameters>
<asp:QueryStringParameter Name="@ChangeRequestID" Type="Int32" />
</SelectParameters>

</asp:SqlDataSource>

I did have <asp:parameter for the select parameter but that wasn't working
either.

I would like it if someone could look at this and see what I am missing.

Thanks.
John
 
J

JohnE

JohnE said:
Thought I would give an update. I no longer get an error but I get no info
for the listview either. Sending the sqldatasource and what I have for the
source code of the listview. The listview is inside a formview that shows
the details of a record from a gridview. I get the correct data with
exception of the nested listview.

<th>Application:</th>
<td><asp:ListView ID="lvwItemApplications" runat="server"
DataSourceID="ApplicationItemSqlDataSource" DataKeyNames="ChangeRequestID" >
<LayoutTemplate>
<asp:placeHolder ID="itemPlaceholder" runat="server" />
</LayoutTemplate>
<ItemTemplate>
<asp:Label ID="ItemApplicationsLabel" runat="server" Text='<%#
Eval("ApplicationItem") %>' />
</ItemTemplate>
</asp:ListView>


<asp:SqlDataSource ID="ApplicationItemSqlDataSource" runat="server"
ConnectionString="<%$ ConnectionStrings:proteusConnectionString %>"
SelectCommand="SELECT tblApplicationItem.ApplicationItem,
tblApplication.ChangeRequestID
FROM tblApplication
INNER JOIN tblApplicationItem ON
tblApplication.ApplicationItemID = tblApplicationItem.ApplicationItemID
INNER JOIN tblChangeRequest ON
tblApplication.ChangeRequestID = tblChangeRequest.ChangeRequestID
WHERE tblApplication.ChangeRequestID = @ChangeRequestID
ORDER BY tblApplicationItem.ApplicationItem">

<SelectParameters>
<asp:QueryStringParameter Name="@ChangeRequestID" Type="Int32" />
</SelectParameters>

</asp:SqlDataSource>

I did have <asp:parameter for the select parameter but that wasn't working
either.

I would like it if someone could look at this and see what I am missing.

Thanks.
John

I finally got it figured out. No need to respond.
Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top