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

Multiple datasources in FormView/DetailsView

Hi all

I am displaying some information from my database using DetailsView
which is bound to SqlDataSource1.

<asp:DetailsView ID="DetailsView1" runat="server"
AutoGenerateRows="False" DataSourceID="SqlDataSource1"
ForeColor="#333333" >

<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT [x], [y], [z], [a], [b], [c] FROM [sometable]
WHERE ([ID] = @ID)"> />

When I allow editing of this information, I want to populate certain
dropdownlists in the DetailsView using different datasources. Is this
possible?

Specifically:

<ItemTemplate>
<asp:Label ID="lbl" runat="server" Text='<%# Bind("someField")
%>'></asp:Label><br />
</ItemTemplate>

<EditItemTemplate>
<asp:DropDownList ID="ddl" runat="server" </asp:DropDownList><br />
</EditItemTemplate>

The ListItems for this DropDownList need to come from another database
table, not the same one to which it is bound in the ItemTemplate.

Is this possible at all?

Thanks!

Nov 17 '05 #1
0 2788

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

Similar topics

0
by: Neil Young | last post by:
Hello group, I'm referring to a "rather old thread" (April 21st 2005). Because I also ran into problems with ASP.NET 2.0 formview and DBNull, but found a way around, I would like to share my...
1
by: Shawn Wildermuth | last post by:
I have a *single* SqlDataSource that loads up a single result set that I show in a GridView. In the GridView, i've added a "Select" button and handling the SelectedItem event. I also have a...
1
by: TdarTdar | last post by:
I wanted to add three columns up on the form and run some logic to fill in the third but not sure how to call the field names in the formview control. Dim Girth As Integer Elenght =...
5
by: Jurgen Appelo | last post by:
I'm at a loss here... My FormView control automatically performs a databind at each postback on the server. But in some cases I don't want this to happen. Like when the business layer decides that...
1
by: cisco | last post by:
I've been trying to figure out how the client of a DetailsView or FormView should handle the ItemUpdating event when setting the datasource programatically. I want to do something simple like...
1
by: R.A.M. | last post by:
Hi, I am learning .NET 2.0 and I would like to know what is the difference between DetailsView and FormView? When, IN PRACTICE, use each of these? Thank you! /RAM/
1
by: Larry Bud | last post by:
I have a stored procedure that returns statistics based on the parameter passed to it. I would like to have a table with 4 columns, (and about 20 rows which is what is returned from the SP). Each...
1
by: firozb | last post by:
Good day to you, I am using ASP.Net 2.0 with VS 2005. I have created a template page, with a Gridview, Formview, 2 objectdatasources linked to the views, as well as a multiview and a drop-down...
2
by: Paulo | last post by:
What is DetailsView, FormView, DataList, Repeater components? Any differences? VS 2005 asp.net C#
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.