473,598 Members | 3,252 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Master/Detail problem on Whidbey CTP build

The following code is from the online tutorial but it doesn't run on my CTP
build I've just installed.

The first problem is, ImageField doesn't have a public DataField field. Ok,
I removed this line.

The second problem is that "the @EmployeeID column can not be found." Hmmm,
could any one help me verify if the program happens on your side?

BTW, I didn't install SQL 2005. I still use SQL 2000. Can it be the cause of
the problems?

<table cellpadding="10 ">
<tr>
<td valign="top">
<asp:GridView
ID="MasterGridV iew"
DataSourceID="M asterSource"
AutoGenerateCol umns="false"
DataKeyNames="E mployeeID"
CellPadding="5"
SelectedRowStyl e-BackColor="#eee eee"
Runat="Server">
<Columns>
<asp:TemplateFi eld HeaderText="Emp loyee">
<ItemTemplate >
<asp:LinkButt on CommandName="Se lect" Runat="Server">
<%# Eval("LastName" ) %>, <%# Eval("FirstName ") %>
</asp:LinkButton>
</ItemTemplate>
</asp:TemplateFie ld>
</Columns>
</asp:GridView>

</td>
<td valign="top">

<asp:DetailsVie w
DataSourceID="D etailsSource"
AutoGenerateRow s="false"
CellPadding="5"
FieldHeaderStyl e-Font-Bold="true"
FieldHeaderStyl e-HorizontalAlign ="Right"
Runat="Server">
<Fields>
<asp:ImageFie ld DataField="Phot o" HeaderText="Pho to:" />
<asp:BoundFie ld DataField="Last Name"
HeaderText="Las t Name:" />
<asp:BoundFie ld DataField="Firs tName"
HeaderText="Fir st Name:" />
<asp:BoundFie ld DataField="Exte nsion"
HeaderText="Ext ension:" />
</Fields>
</asp:DetailsView >
</td>
</tr>
</table>
<asp:SqlDataSou rce
ID="MasterSourc e"
EnableCaching=" true"
CacheDuration=" 600"
ConnectionStrin g=
"Server=localho st;database=Nor thwind;Trusted_ Connection=true "
SelectCommand=" SELECT * FROM Employees"
Runat="Server" />
<asp:SqlDataSou rce
ID="DetailsSour ce"
EnableCaching=" true"
CacheDuration=" 600"
ConnectionStrin g=
"Server=localho st;database=Nor thwind;Trusted_ Connection=true "
SelectCommand=" SELECT * FROM Employees"
FilterExpressio n="EmployeeID=@ EmployeeID"
Runat="Server">
<FilterParamete rs>
<asp:ControlPar ameter
Name="EmployeeI D"
ControlID="Mast erGridView"
PropertyName="S electedValue" />
</FilterParameter s>
</asp:SqlDataSour ce>
Nov 19 '05 #1
1 1198
Haaa! I found the solution by myself from the MSDN product feedback center.

There is a syntax change in the new version, just change

FilterExpressio n="EmployeeID=' @Employee'"

to

FilterExpressio n="EmployeeID=' {0}'"

and the problem is gone.

Refer to
http://lab.msdn.microsoft.com/produc...3-d5ee72fd9303

"Johnny §õ«¶¿« (Microsoft MVP for ASP.NET)" <jo****@phone.i dv.tw> ¼¶¼g©ó¶l¥ó
·s»D:OM******** *****@TK2MSFTNG P10.phx.gbl...
The following code is from the online tutorial but it doesn't run on my CTP build I've just installed.

The first problem is, ImageField doesn't have a public DataField field. Ok, I removed this line.

The second problem is that "the @EmployeeID column can not be found." Hmmm, could any one help me verify if the program happens on your side?

BTW, I didn't install SQL 2005. I still use SQL 2000. Can it be the cause of the problems?

<table cellpadding="10 ">
<tr>
<td valign="top">
<asp:GridView
ID="MasterGridV iew"
DataSourceID="M asterSource"
AutoGenerateCol umns="false"
DataKeyNames="E mployeeID"
CellPadding="5"
SelectedRowStyl e-BackColor="#eee eee"
Runat="Server">
<Columns>
<asp:TemplateFi eld HeaderText="Emp loyee">
<ItemTemplate >
<asp:LinkButt on CommandName="Se lect" Runat="Server">
<%# Eval("LastName" ) %>, <%# Eval("FirstName ") %>
</asp:LinkButton>
</ItemTemplate>
</asp:TemplateFie ld>
</Columns>
</asp:GridView>

</td>
<td valign="top">

<asp:DetailsVie w
DataSourceID="D etailsSource"
AutoGenerateRow s="false"
CellPadding="5"
FieldHeaderStyl e-Font-Bold="true"
FieldHeaderStyl e-HorizontalAlign ="Right"
Runat="Server">
<Fields>
<asp:ImageFie ld DataField="Phot o" HeaderText="Pho to:" />
<asp:BoundFie ld DataField="Last Name"
HeaderText="Las t Name:" />
<asp:BoundFie ld DataField="Firs tName"
HeaderText="Fir st Name:" />
<asp:BoundFie ld DataField="Exte nsion"
HeaderText="Ext ension:" />
</Fields>
</asp:DetailsView >
</td>
</tr>
</table>
<asp:SqlDataSou rce
ID="MasterSourc e"
EnableCaching=" true"
CacheDuration=" 600"
ConnectionStrin g=
"Server=localho st;database=Nor thwind;Trusted_ Connection=true "
SelectCommand=" SELECT * FROM Employees"
Runat="Server" />
<asp:SqlDataSou rce
ID="DetailsSour ce"
EnableCaching=" true"
CacheDuration=" 600"
ConnectionStrin g=
"Server=localho st;database=Nor thwind;Trusted_ Connection=true "
SelectCommand=" SELECT * FROM Employees"
FilterExpressio n="EmployeeID=@ EmployeeID"
Runat="Server">
<FilterParamete rs>
<asp:ControlPar ameter
Name="EmployeeI D"
ControlID="Mast erGridView"
PropertyName="S electedValue" />
</FilterParameter s>
</asp:SqlDataSour ce>

Nov 19 '05 #2

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

Similar topics

4
2014
by: John Holmes | last post by:
With ASP we have setup a pretty good method for maintaining a consistent look and feel with minimal effort. The method has it's pros and cons, but the maintenance is minimal. The method consists of utilizing a single default.asp page to call any page on the site passing query parameters with the page to determine what page and associated menu to load. The menu info is maintained in a database and a COM+ dll is utilized to go to the...
2
423
by: ruca | last post by:
Hi, I have a master and a detail datagrid. I put detail grid showing insise of a column of master grid. The problem is that it's not what I really want. What I really want would be that the detail grid appears between rows of master grid, i.e., when I select one record in master grid that detail grid appears between the selected row and next row. I know that the reason why my detail grid is show in one master column it's because I...
4
2046
by: Jerome | last post by:
Hi, I've got a table like this Cat1 ¦ Item1 Cat1 ¦ Item2 Cat1 ¦ Item3 Cat2 ¦ ItemA Cat2 ¦ ItemB
3
1558
by: sqlboy2000 | last post by:
Hi, I've just started playing around with master / detail pages and I'm trying to simply change the detail page displayed in the contentplaceholder control from code behind. I can't seem to find any examples of this. Does anyone know how to do this? Thanks in advance.
1
2176
by: Sam | last post by:
Attached I am sending 2 URL's from MSFT ASP.net Quick Start Tutorial Web Site. 1) Run it URL: http://www.asp.net/QuickStart/aspnet/samples/data/GridViewMasterDetai... 2) View Source URL: http://www.asp.net/QuickStart/util/srcview.aspx?path=~/aspnet/samples...
0
1289
by: Sam | last post by:
Sorry to post the same post multiple times but the URL Addresses were not Correct in Earlier Posts. Here are the correct URL's: 1) Run It URL is here: http://www.asp.net/QuickStart/aspnet/samples/data/GridViewMasterDetailsInsertPage_vb.aspx
1
1518
by: Gary200 | last post by:
Hello All, I bind two datagrids in a master-detail relationship successfully. What I want is to set allowNew and allowDelete disabled in both datagrid using dataview. The code like this: Dim masterGrid As DataGrid Dim detailGrid As DataGrid
0
1715
by: Mike Wilson | last post by:
Dear group, I have an invoice entry form, which is a simple Master fields / Detail grid. The main summary information of the invoice are stored in one table in a dataset, which is bound using a BindingSource (InvoiceBindingSource). The line details of each item in the invoice is held in a child table which is bound to another bindingsource (InvoiceRowsBindingSource). I took the basic design from an MSDN article, and all works well....
2
2277
by: John | last post by:
Hi I am trying to create a master/detail form. I have my master and details tables dragged onto the dataset. I have also dragged the fields from master table on the form which has created the navigation toolbar for me and which works fine with the master table. I also have a dataview on the same form ready for detail table but as yet not assigned to the detail table. How can I now create a master/detail relationship between my master and...
0
7899
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8392
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8397
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8264
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6718
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5438
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3897
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1504
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1250
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.