473,856 Members | 1,637 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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:DetailsVie w ID="dvBillingSe rviceInsert" runat="server"
GridLines="None "
AutoGenerateRow s="False" DefaultMode="In sert" Width="722px"
BackColor="Whit e"
BorderColor="#C CCCCC" BorderStyle="No ne" BorderWidth="1p x"
CellPadding="3" >
<Fields>
<asp:TemplateFi eld SortExpression= "Section" HeaderText="Sec tion:">
<ItemTemplate >
<asp:Label ID="lblSection " runat="server" Text='<%#
Bind("SectionNa me") %>'></asp:Label>
</ItemTemplate>
<EditItemTempla te>
<asp:TextBox ID="txtNewSecti on"
runat="server"> </asp:TextBox>
<br />
</EditItemTemplat e>
</asp:TemplateFie ld>
<asp:BoundFie ld DataField="Firs tName" HeaderText="Fir st Name:" />
<asp:BoundFie ld DataField="Last Name" HeaderText="Las t Name:" />
<asp:CommandFie ld ShowInsertButto n="True" />
</Fields>
<FooterStyle BackColor="Whit e" ForeColor="#000 066" />
<RowStyle ForeColor="#000 066" />
<PagerStyle BackColor="Whit e" ForeColor="#000 066"
HorizontalAlign ="Left" />
<HeaderStyle BackColor="#006 699" Font-Bold="True" ForeColor="Whit e"
/>
</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).te xt
Dim item as New ListItem(str)
ListBox1.Items. Add(item)

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



Oct 29 '08 #1
0 1871

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

Similar topics

2
3630
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 DetailsView and then handle my updating manually. -Andrew
9
5344
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 (filtered) dependent upon the selection in DDL1. I think this inevitably needs some code, but I'd be happy to be told otherwise! I have some code to handle OnSelectedIndexChanged for DDL1 that sets the FilterExpression associated with the...
0
1643
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 Access instead of SQL Server. Everything works fine until I get to the last step, where I try to insert a record. When I hit the New link it lets me add the new data, but then when I hit Insert, I get the yellow page which I have paseted below. I...
0
1692
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 --------------------------------------------------------------------------------------------------------------- Server Error in '/Document' Application.
0
1976
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, whenever one clicks on a row in the GridView that doesnt have any data to be displayed in the DetailsView, the DetailsView only displays "no record found" as set via the "EmptyDataText" property.
1
4276
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 database from Access to SQL Server. So I go in to the SQLDataSource and modify it to connect to the SQL Server database. No problem. However, the DetailsView control does not seem to pick up the changes. When I click on the little shortcut menu (not...
0
4069
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 following: 1) gets query string from url and filters records (works great) via a Details View 2) shows notes that have been added to the record shown in the details view using a grid view, and it filters the data by looking at the ID that is selected in...
1
4149
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 business objects with optimistic concurrency checking built in in my Save() method (against a timestamp column). This can be proven to work perfectly in the following scenario: - Start app, go to the DetailsView page (defaults to readonly), open a...
1
7795
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 in detailsview. can some1 please tell me how to do that. Regards, vineet
0
9920
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11063
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
10699
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...
1
10790
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9535
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...
1
7932
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7098
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
5762
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...
0
5960
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.