473,804 Members | 2,136 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to get the value of a field in a detailsview?

I need the value of a field of a detailsview in DataBound event.
i can find the fieldname with this:
Dim a As DataControlFiel d
a = DetailsView1.Fi elds(0)

But how to get the value of that field?
i tried a lot of things without succes:
Protected Sub DetailsView1_Da taBound(ByVal sender As Object, ByVal e As
System.EventArg s) Handles DetailsView1.Da taBound
dim enqna as DetailsViewRow
enqna = DetailsView1.Da taItem

or

dim enqna As DataColumn
enqna= DetailsView1.Da taItem
.....
or
Dim va As String
va = DetailsView1.Co ntrols.Item(1). ToString

Thanks for help
Chris
Jul 28 '07 #1
1 7975
you could get the value of the field by get the value of the corresponding
label control value of the field.
the lable load event should do the trick.

"Chris" <gd***@er.dfÐ´È ëÏûÏ¢ÐÂÎÅ:OI*** ***********@TK2 MSFTNGP03.phx.g bl...
>I need the value of a field of a detailsview in DataBound event.
i can find the fieldname with this:
Dim a As DataControlFiel d
a = DetailsView1.Fi elds(0)

But how to get the value of that field?
i tried a lot of things without succes:
Protected Sub DetailsView1_Da taBound(ByVal sender As Object, ByVal e As
System.EventArg s) Handles DetailsView1.Da taBound
dim enqna as DetailsViewRow
enqna = DetailsView1.Da taItem

or

dim enqna As DataColumn
enqna= DetailsView1.Da taItem
....
or
Dim va As String
va = DetailsView1.Co ntrols.Item(1). ToString

Thanks for help
Chris

Jul 29 '07 #2

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

Similar topics

1
4441
by: sck10 | last post by:
Hello, I am trying to change a value when a user goes into edit mode on a DetailsView control. I am trying to use the following, but can not figure out how to get to the bound field ("MyBoundField") to set its new value. Any help with this would be appreciated. Sub EmployeeDetailView_ModeChanged(ByVal sender As Object, ByVal e As EventArgs) Select Case CustomerDetailView.CurrentMode
1
3264
by: Sam | last post by:
Hi, I don't know how to specify the display and value field for a combobox when using AddRange to fill the combo. Here is what I have so far: -A function to build an array of object : Dim returnData() As Object Do While myReader.Read()
1
1581
by: arulbenito | last post by:
i need to write a xml data inside the value field in web.config file. it looks likes this <configuration> <appSettings> <add key="MyXmlData" value="<data><type></type>........." /> </appSettings> </configuration>
0
1248
by: Seok Bee | last post by:
Dear Experts, In my web application, I have a Master/Detail display of records using Gridview and DetailsView controls. Whenever, I made a selection of a record from the Gridview control, the detail information of the record will be displayed in the DetailsView control. Information in the editable in the detailsview by allowing user to have the edit option. On top of that I also allow user to add new record through the detailsview...
1
1440
by: somanyusernamesaretakenal | last post by:
Hi everyone, I am working with Access 2003. I know a crosstab query only allows 1 value field, but how to do you around this restriction? I have a table with let’s say customers, products, calendar year (this field include year 2005-2007), months and a number of expense fields. I was told that to get the sums of products (expenses) per year I need to create a crosstab query. The problem is that some expense fields are added together or...
10
1805
by: Hugh Middity2 | last post by:
Hello, is there a parameter value field in access that can be passed between queries, forms and reports? For example, we have two companies both selling the same products. To extract data we have to enter the date twice, once for each company. To print a report we have to enter the date again. Is it possible to enter the date once which can be used by all the processes? Thanks for your help.
0
1863
by: miketayloruk | last post by:
I'm using a detailsview control that I want to use to insert data to a table. One of the fields is a date field and I want that to default to todays date. In classic asp I would do it like this: <input name="textfield" type="text" value="<%=now()%>" /> How do I do this in ASP.NET, heere is my current code: <asp:DetailsView ID="DetailsView1" runat="server" AllowPaging="True" AutoGenerateRows="False" DataKeyNames="data_key"
2
2390
by: bob | last post by:
Hi, the detailsview (default mode = insert) is used to introduce names into the database. I need in code-behind the introduced name. I tried this: <asp:DetailsView ID="DetailsView1" runat="server" DefaultMode="Insert" > <Fields> <asp:BoundField DataField="name" />
15
4975
by: amy1 | last post by:
Hello everyone, I'm new here and new to Access2007 as well! I have a multi-value field in a form, and would like to calculate the total of the selected values in this field and place the total in a textbox. what I know is that should use DSum function. but I have no clue on how to use it or even where (in the textbox or multi-value field)?!! so a detailed answer would be very appreciated.
19
7187
by: jaad | last post by:
how do you reference a single value field to a multi-value field? I sometime use a macro in form1 to open form 2 containing the same ID example: Open form: WorkOrder where condition: ="=" & Nz(,0)
0
9716
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
10354
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
9177
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
7643
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
6870
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
5536
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
5675
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4314
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
3837
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.