473,414 Members | 2,019 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,414 software developers and data experts.

how do you get data out of a detailsview

I'm using a detailsview to insert a record, should be simple enough? What
am I doing wrong? Thank you for your help.

The user fills in all the textboxes and hits insert.
I've tried every event there is to retrieve cells and rows and I've even
converted some of the fields from bound controls to templates, and all the
data is blank no matter what I do:

<asp:DetailsView ID="dvBillingServiceInsert" runat="server"
GridLines="None"
AutoGenerateRows="False" DefaultMode="Insert" Width="722px"
BackColor="White"
BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px"
CellPadding="3">
<Fields>
<asp:TemplateField SortExpression="Section" HeaderText="Section:">
<ItemTemplate>
<asp:Label ID="lblSection" runat="server" Text='<%#
Bind("SectionName") %>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtNewSection"
runat="server"></asp:TextBox>
<br />
</EditItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="FirstName" HeaderText="First Name:" />
<asp:BoundField DataField="LastName" HeaderText="Last Name:" />
<asp:CommandField ShowInsertButton="True" />
</Fields>
<FooterStyle BackColor="White" ForeColor="#000066" />
<RowStyle ForeColor="#000066" />
<PagerStyle BackColor="White" ForeColor="#000066"
HorizontalAlign="Left" />
<HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White"
/>
</asp:DetailsView>
Code Behind (I have tried every event, the itemInserting event, the
itemUpdating, the prerender, databound, every every every event there is for
the detailsview), and the values are all "" even though I have put data in
the cells:

Dim row As DetailsViewRow = Sender.Rows(1)
Dim str as String = row.Cells(1).text
Dim item as New ListItem(str)
ListBox1.Items.Add(item)

Dim row2 As DetailsViewRow = Sender.Rows(2)
Dim str2 as String = row2.Cells(1).text
Dim item2 as New ListItem(str2)
ListBox1.Items.Add(item2)
Dim item4 as New ListItem("testing")
listbox1.Items.Add(item4)



Oct 29 '08 #1
0 1850

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

Similar topics

2
by: Andrew Robinson | last post by:
Is there any way to accomplish two way data binding in a Details View with a DataSet or DataTable as the DataSource. All I want is to get an updated DataSet or DataTable back from the...
9
by: Timm | last post by:
I have an ASP.NET 2.0 page with two DropDownLists. I am using declarative data binding wherever possible and trying to minimize the use of code. The list of values in DropDownList DDL2 should be...
0
by: tom c | last post by:
I am going through "Walkthrough: Editing and Inserting Data in Web Pages with the DetailsView Web Server Control" found at http://msdn2.microsoft.com/en-us/library/sdba1d59.aspx I am using...
0
by: le0 | last post by:
Guys, I create a simple insertion in a database using DetailsView control, when i run this page and try to insert some data, the browser returns an error like this ...
0
by: wardemon | last post by:
Hi All, I have a Master(GridView) / Detail(DetailsView) page scenario. When one clicks on a row in the GridView, the DetailsView will be filled-up with related data. My problem is that,...
1
by: Corey B | last post by:
I have a page with a DetailsView control and a SQLDataSource control. The SQLDataSource control is connected to an Access database. Everything works fine. Now I want to change the back end...
0
by: troydixon | last post by:
Hello, I am new at this, and have been trying to insert data into a table by using the footer of a gridview (which I dont like) or by using a detials view on the same page that is doing the...
1
by: ledneh | last post by:
I've been working on concurrency checking for an application I'm building, and a minor part of it has me slightly stumped. I've got a DetailsView that populates from an ObjectDataSource, using...
1
by: vineetbindal | last post by:
Hi all, I have a datagrid and detailsview. when a user selects a row in datagrid onSelectedIndexchanged is fired and Detailsview comes into picture. I want to display the data of the selected row...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
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...

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.