473,770 Members | 1,862 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 1867

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

Similar topics

2
3627
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
5339
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
1636
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
1687
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
1972
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
4273
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
4063
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
4145
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
7791
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
9454
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
10257
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
10099
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
9904
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
6710
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
5354
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
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.