473,657 Members | 2,294 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Getting value of field in dropdown datasource within Formview

I have a dropdown list in a Formview that includes a number of fields in the
SQLDatasource.

I want to be able to get the value of one of the fields in the Datasource
that is not the Datatextfield or the Datavaluefield from within a Formview
control.

I know that I can get the data text field or datavalue field by using the
following:
-Dim ddlCompanyName as DropDownList
-Dim txtCompanyName as Textbox
-ddlCompanyName = CType(FormView1 .Row.FindContro l("ddlCompanyNa me"),
DropDownList)
-txtCompanyName =
CType(FormView1 .Row.findcontro l("CompanyNameT extbox"),Textbo x)
-txtCompanyName. text = ddlCompanyName. Items(ddlCompan yName.SelectedI ndex).Text

But how can I get the value from a different field in the datasource?

Please help with any suggestions??

Jun 19 '06 #1
0 1835

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

Similar topics

5
2658
by: DC Gringo | last post by:
I have a dropdownlist that, upon form submission, I'd like to maintain the selected value when I get my result...how do I do that? <asp:dropdownlist Font-Size="8" id="ddlCommunities" runat="server" Width="100"></asp:dropdownlist> Sub RunReport_OnClick(sender As Object, e As System.EventArgs) _sqlStmt &= " AND tblSurvey1.clnGUID = '" &
6
5393
by: Jenna Alten | last post by:
I have a datagrid with a template column that contains a dropdown list. I currently fill and display the dropdown list on the page load. This is working correctly. I am NOT using an Edit Column. I am receiving errors when trying to set the selected value of the dropdown within the ItemDataBound() subroutine. Below is the code I am using. I hope someone can tell me if this is possible. '''HTML''' <asp:datagrid id="dgAssignments"...
1
1610
by: Craig | last post by:
In ASP.NET 2.0 and the formview control how do you get the value of the identity field of a newly inserted record? In ASP.NET 1.1 after the new record was saved you just said intNewIdentityID = Dataset.tblMtTable.IndentityID Simple but can't seem to do it in the formview. Thanks
1
7293
by: Jay | last post by:
On my aspx page I have a FormView with a RadioButtonList bound to a column on a DataSource table. The form starts up in Edit mode. I want the formView to start up with nothing yet selected in the RadioButtonList. Is there a way to do this? With null in the table/column, I get a startup error complaining the SelectedValue is invalid because it does not exist in the list of items. Thanks very much if someone has a way to solve this...
1
10387
by: Ben | last post by:
I have a formview with a few dropdownlists (software version, database version, etc). When a software version is selected, the database version dropdownlist updates itself accordingly. When in edit mode, everything works fine - the selected value in each list defaults to the value from the database record (selectedvalue=bind...). However, in insert mode (insertitem), it is not working. I pass in a value on the query string that I would...
3
1851
by: Dave | last post by:
I have 2 Dropdown's in a Web FormView. I would like to get one to be a Parameter for the other, but I can't seem to figure out how to get the value out of the first. When I double click it to get to the C# Window...neither of the Dropdowns are available to get the Value or set a profile. How can I get this Value?
8
7065
by: BB | last post by:
Hi, I am using FormView Contol, TextBox (Hidden ) and Submit button whose caption is "View Page" in my aspx page. Here is what I am tryin to do.When page loads I generate dynamic url in text box . I want to append exisitng value in Formview field "CustomeID" to url. When userclicks on "view page" ,new window is opened with dynamic url. I am able to do generarting url dynamically, but dont know how i can do rest of the things. Any idea?
2
2725
by: Hugh | last post by:
Naive developer needs help. how to retrieve a dropdown value inside a formview in VB? Is findcontrol the way to go? Thanks in advance. Hugh
3
2784
by: John | last post by:
I have two dropdown lists that I have bound to a datatable and set the DataTextField and DataValueField for. Both lists show the values I expect from the database. However, when I need to access the valueField for a dropdown list I always get the first value. Here is my code I do on load to bind the dropdowns: Try 'load the Division Dropdown dtDiv = objDAL.ExecuteDataTable("GetDivision") With ddDivision
0
8407
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
8319
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,...
1
8512
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
8612
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
7347
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...
0
4171
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
4329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1969
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1732
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.