[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.9

Adding a DropDownlist to a repeater Control using an ObjectDataSource

Asked by coleenholley in Programming for ASP.NET, Microsoft Visual Basic.Net

Tags: VB.Net. ASP.Net

Hi all :-)
I've stopped tying to use a GridView Control to create a data entry form and am now using a repeater control.  I've got an ASP.Net table in a Repeater control, and this generates the blank rows for Data entry wonderfully.  However, I need to populate 3 DDL's inside the Repeater and when I try to connect the DDL to the ODS like I did with the Gridview DDL's, I get an error: "DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'MODE_TY'."

Attached is both my SP.Net code and my VB.Net code.  thanks for any help - I appreciate it
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="RepeaterTest.aspx.vb" Inherits="DataListRepeaterBasics_RepeaterTest" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
	<link href="../Includes/fuelfont.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <div>
	 <h2>Test Receipts Data Entry</h2>
	<asp:Repeater ID="Repeater1" runat="server" EnableViewState="false"> <%--DataSourceID="DMVODSRcptDisb"--%>
		<HeaderTemplate>
			<asp:Table ID=tblRptrheader runat=server>
				<asp:TableHeaderRow HorizontalAlign =center>
				<asp:TableHeaderCell><asp:Label ID="lblCarrFEIN" runat="server" Text="Carrier FEIN" Width=80px></asp:Label></asp:TableHeaderCell>
				<asp:TableHeaderCell><asp:Label ID="lblCarrName" runat="server" Text="Carrier Name" Width=80px></asp:Label></asp:TableHeaderCell>
				<asp:TableHeaderCell><asp:Label ID="lblModeTy" runat="server" Text="Mode Type" Width=80px></asp:Label></asp:TableHeaderCell>
				<asp:TableHeaderCell><asp:Label ID="lblOrigCity" runat="server" Text="Origin City" Width=80px></asp:Label></asp:TableHeaderCell>
				<asp:TableHeaderCell><asp:Label ID="lblOrigState" runat="server" Text="Origin State" Width=80px></asp:Label></asp:TableHeaderCell>
				<asp:TableHeaderCell><asp:Label ID="lblDestCity" runat="server" Text="Dest City" Width=80px></asp:Label></asp:TableHeaderCell>
				<asp:TableHeaderCell><asp:Label ID="lblDestState" runat="server" Text="Dest State" Width=80px></asp:Label></asp:TableHeaderCell>
				<asp:TableHeaderCell><asp:Label ID="lblSellerFEIN" runat="server" Text="Seller's FEIN" Width=80px></asp:Label></asp:TableHeaderCell>
				<asp:TableHeaderCell><asp:Label ID="lblRcvdFrom" runat="server" Text="Received From" Width=80px></asp:Label></asp:TableHeaderCell>
				<asp:TableHeaderCell><asp:Label ID="lblDateRcvd" runat="server" Text="Date Received" Width=80px></asp:Label></asp:TableHeaderCell>
				<asp:TableHeaderCell><asp:Label ID="lblBOL" runat="server" Text="BOL/Manifest" Width=80px></asp:Label></asp:TableHeaderCell>
				<asp:TableHeaderCell><asp:Label ID="lblNetGal" runat="server" Text="Net Gallons" Width=80px></asp:Label></asp:TableHeaderCell>
				<asp:TableHeaderCell><asp:Label ID="lblGrossGal" runat="server" Text="Gross gallons" Width=80px></asp:Label></asp:TableHeaderCell>
				<asp:TableHeaderCell><asp:Label ID="lblBillGal" runat="server" Text="Billed Gallons" Width=80px></asp:Label></asp:TableHeaderCell>
				</asp:TableHeaderRow>
			</asp:Table>
		</HeaderTemplate>
		<ItemTemplate>
			<asp:Table ID=tblRptrtable runat=server>
				<asp:TableRow>
				     <asp:TableCell><asp:TextBox ID="txtCarrFEIN" runat="server" Width=80px></asp:TextBox></asp:TableCell>
				     <asp:TableCell><asp:TextBox ID="txtCarrName" runat="server" Width=80px></asp:TextBox></asp:TableCell>
  				     <asp:TableCell>
					<asp:DropDownList ID="ddlModeType" runat="server" Width=80px DataSourceID="odsuf_rtdata_mfmo" DataTextField="data_txt" 
		DataValueField="key_txt" SelectedValue='<%# Eval("MODE_TY") %>' >
					</asp:DropDownList>
				     </asp:TableCell>
				<asp:TableCell><asp:TextBox ID="txtOrigCity" runat="server" Width=80px></asp:TextBox></asp:TableCell>
			         <asp:TableCell>
				     <asp:DropDownList ID="ddlOrigState" runat="server" Width=80px>
    				     </asp:DropDownList>
				</asp:TableCell>
				<asp:TableCell><asp:TextBox ID="txtDestCity" runat="server" Width=80px></asp:TextBox></asp:TableCell>
				<asp:TableCell><asp:DropDownList ID="ddlDestState" runat="server" Width=80px>
					</asp:DropDownList>
				</asp:TableCell>
				<asp:TableCell><asp:TextBox ID="txtSellerFEIN" runat="server" Width=80px></asp:TextBox></asp:TableCell>
				<asp:TableCell><asp:TextBox ID="txtRcvdFrom" runat="server" Width=80px></asp:TextBox></asp:TableCell>
				<asp:TableCell><asp:TextBox ID="txtDateRcvd" runat="server" Width=80px></asp:TextBox></asp:TableCell>
				<asp:TableCell><asp:TextBox ID="txtBOL" runat="server" Width=80px></asp:TextBox></asp:TableCell>
				<asp:TableCell><asp:TextBox ID="txtNetGal" runat="server" Width=80px></asp:TextBox></asp:TableCell>
				<asp:TableCell><asp:TextBox ID="txtGrossGal" runat="server" Width=80px></asp:TextBox></asp:TableCell>
				<asp:TableCell><asp:TextBox ID="txtBillGal" runat="server" Width=80px></asp:TextBox></asp:TableCell>
				</asp:TableRow>
			</asp:Table>
		</ItemTemplate>
	</asp:Repeater>
	<br />
	<asp:ObjectDataSource ID="DMVODSRcptDisb" runat="server" SelectMethod="populate_datagrid" TypeName="misc_func">
	    <SelectParameters>
		    <asp:SessionParameter Name="ls_mc_rqd_fld" SessionField="ls_mc_rqd_fld" Type="String" />
		    <asp:SessionParameter Name="bus_id" SessionField="bus_id" Type="String" />
		    <asp:SessionParameter Name="ls_fuelty" SessionField="ls_fuelty" Type="String" />
		    <asp:SessionParameter Name="ls_fuelcd" SessionField="ls_fuelcd" Type="String" />
		    <asp:SessionParameter Name="ls_sch" SessionField="ls_sch" Type="String" />
		    <asp:SessionParameter Name="lsRcptDisbTy" SessionField="lsRcptDisbTy" Type="String" />
		    <asp:SessionParameter Name="ls_rcv_sold_dt" SessionField="ls_rcv_sold_dt" Type="String" />
		    <asp:SessionParameter Name="emp_id" SessionField="emp_id" Type="String" />
		    <asp:SessionParameter Name="fein" SessionField="fein" Type="String" />
		    <asp:SessionParameter Name="rptprdnum" SessionField="rptprdnum" Type="String" />
	    </SelectParameters>
	</asp:ObjectDataSource>
	<br />	
	<asp:ObjectDataSource ID="odsuf_rtdata_mfmo" runat="server" SelectMethod="uf_rtdata_rftID" TypeName="misc_func">
	    <SelectParameters>
		<asp:Parameter ConvertEmptyStringToNull="False" DefaultValue="MFMO" Name="as_ref_tbl_id" Type="String" />
		</SelectParameters>
	</asp:ObjectDataSource>
	<br />
	    <asp:ObjectDataSource ID="odsuf_rtdata_gsta" runat="server" SelectMethod="uf_rtdata"
		    TypeName="misc_func">
		    <SelectParameters>
			    <asp:Parameter DefaultValue="GSTA" Name="as_ref_tbl_id" Type="String" />
		    </SelectParameters>
	    </asp:ObjectDataSource>
    </div>
    </form>
</body>
</html>
 
 
Partial Class DataListRepeaterBasics_RepeaterTest
Inherits System.Web.UI.Page
 
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
	
	Dim dtBlankRows as New DataTable
	Dim drBlankRows as DataRow
	Dim i as Integer = 0
	
	dtBlankRows.Columns.Add(New DataColumn("Carrier FEIN", GetType(String)))
    dtBlankRows.Columns.Add(New DataColumn("Carrier Name", GetType(String)))
	dtBlankRows.Columns.Add(New DataColumn("Mode Type", GetType(String)))
	dtBlankRows.Columns.Add(New DataColumn("Orig City", GetType(String)))
    dtBlankRows.Columns.Add(New DataColumn("Orig State", GetType(String)))
	dtBlankRows.Columns.Add(New DataColumn("Dest City", GetType(String)))
	dtBlankRows.Columns.Add(New DataColumn("Dest State", GetType(String)))
    dtBlankRows.Columns.Add(New DataColumn("Seller's FEIN", GetType(String)))
	dtBlankRows.Columns.Add(New DataColumn("Received From", GetType(String)))
	dtBlankRows.Columns.Add(New DataColumn("Date Received", GetType(String)))
    dtBlankRows.Columns.Add(New DataColumn("BOL/Manifest", GetType(String)))
	dtBlankRows.Columns.Add(New DataColumn("Net Gallons", GetType(String)))
	dtBlankRows.Columns.Add(New DataColumn("Gross Gallons", GetType(String)))
    dtBlankRows.Columns.Add(New DataColumn("Billed Gallons", GetType(String)))
	
	For i = 0 to 9
	drBlankRows = dtBlankRows.NewRow()
    dtBlankRows.Rows.Add(drBlankRows)
	Next
	
	Try
		 Repeater1.DataSource = dtBlankRows
		 Repeater1.DataBind()
    Catch
            fatal_error_handle()
    End Try
End Sub
[+][-]03/06/08 10:20 AM, ID: 21063153Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: Programming for ASP.NET, Microsoft Visual Basic.Net
Tags: VB.Net. ASP.Net
Sign Up Now!
Solution Provided By: CmdoProg2
Participating Experts: 1
Solution Grade: A
 
[+][-]03/05/08 12:30 PM, ID: 21054157Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03/05/08 12:38 PM, ID: 21054230Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03/05/08 01:39 PM, ID: 21054790Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03/05/08 01:43 PM, ID: 21054839Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03/05/08 01:47 PM, ID: 21054882Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03/05/08 02:05 PM, ID: 21055068Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03/05/08 02:23 PM, ID: 21055272Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03/05/08 02:58 PM, ID: 21055572Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03/05/08 03:47 PM, ID: 21055969Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03/05/08 04:00 PM, ID: 21056050Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03/06/08 06:03 AM, ID: 21060209Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03/06/08 10:06 AM, ID: 21063033Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03/06/08 10:24 AM, ID: 21063176Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03/06/08 10:36 AM, ID: 21063280Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-92 / EE_QW_2_20070628