How do I get the value from this combo box in vb .net...

In asp .net I have it under control however in vb .net its not quite the same. I have a dataadapter that I pop with a ds. bind it to the combobox. Now I'm trying to get the selected value and I'm thinking I have to do a ctype but don't know what the param's are. can someone please help... Here is the code:

myConnection.Open()
myDataAdapter = New SqlDataAdapter(strSQL, myConnection)

Dim myDataSet As DataSet = New DataSet()

myDataAdapter.Fill(myDataSet, "ListingStatus")

Dim myDataView As DataView = myDataSet.Tables("ListingStatus").DefaultView

lstStatus.DataSource = myDataView

lstStatus.DisplayMember = "Descr"

myConnection.Close()

0
rperreta
2/10/2006 3:23:45 AM
asp.net.visual-basic.net 3721 articles. 0 followers. Follow

5 Replies
829 Views

Similar Articles

[PageSpeed] 32

If you are trying to get the selected value of the DropDownList, you can use DropDownList.SelectedItem.Value.


Ryan Olshan
ASPInsider | Microsoft MVP, ASP.NET
http://ryanolshan.com

How to ask a question
0
StrongTypes
2/10/2006 9:57:36 PM

There is no such properties however there is lstStatus.SelectedValue.ToString - and that returns
System.Data.DataRowView.  I think I need to do a Ctype here however I'm not sure of the format so if someone can help me out I would appreciate it.

Vb .Net 2.0 (VS 2005 Pro)

thanks
-rjp

0
rperreta
2/13/2006 3:25:57 PM

I figured it out - I was not setting the valuememeber to the id when I created the dataset. It's working now... fyi: it's format is combobox.selectedvalue.tostring.

 

thanks for the help..
-rjp

0
rperreta
2/13/2006 3:34:12 PM
Ah. You're using a ComboBox. For some reason I thought you were using a DropDownList. lstStatus.SelectedValue.ToString() should return the selected value. What happens if you try lstStatus.SelectedText?
Ryan Olshan
ASPInsider | Microsoft MVP, ASP.NET
http://ryanolshan.com

How to ask a question
0
StrongTypes
2/13/2006 3:39:38 PM

you get the text value but I need the int value (id) for the DB

 

-rjp

0
rperreta
2/16/2006 4:28:02 AM
Reply:

Similar Artilces:

Sending SMS using vb.net or C#.net using vb.net or c#.net
Hi  My requirement is I hav one csv file with these fields id,mobilenum,messgae,status.intiallu staus is 0. once i read the all fileds and take that mobile number.using tat mobile number  i need to send sms .after sending sms i shuld change status as 1 How to send sms thru coding (please dont provide any links.if it is provide also please give working links becox i checked codeproject .i didnt get any nice link. and also provide the how to update the status field im csv file   Thank ssandhya   To send SMS, you need some third party SMS providers. if you consul...

Visual Basic.NET or Visual Studio.NET?
OK, this has probably been asked before... I'm a student looking to cut my costs, and I can do this by just purchasing Visual Basic.NET as opposed to the fully-fledged Visual Studio.NET application. Of course, I'll only be able to program in VB, but that's fine with me. I wanted to know if all of the ASP.NET specific options are available, such as using a WYSIWYG editor? I'd also like to know if VB.NET has IntelliSense, or that's a specific option only available to Visual Studio.NET users. Thanks in advance. I'd have to believe that VB.Net has intellisense. What is the price d...

Visual Studio .Net? Visual Basic .Net?
Okay, I admit it -- I know nothing about .Net. I'm a Visual Basic and ASP developer. DotNetNuke is my first tentative step into the whole ".Net Thing", and I'm looking for some advice... What do I really need to be able to make some modifications, or new modules for DotNetNuke? Do I need the full, THOUSAND DOLLAR Visual Studio .Net 2003 package, or can I get away with the HUNDRED DOLLAR Visual Basic .Net Standard package?Chameleon Systems, Inc. You can use webmatrix, available here for free. One of the drawbacks of webmatrix however is that it does not support code-be...

What are the diff. visual basic 6 and vb.net ? How to convert the VB6 project to vb.net proj ?
What are the diff. visual basic 6 and vb.net ? How to convert the VB6 project to vb.net proj ? with code and interface too. There are entire forums dedicated to the differences between the two, and to convert your projects you should try the upgrade wizard in Visual Studio....

Visual Basic.NET or Visual Studio.NET? #2
I am currently using the Web Matrix to develop ASP.NET applications, but I am keep to upgrade to VS.NET. However, I can't justify spending $1,000 at the moment. I then found the MUCH cheaper "Visual Basic .NET 2003 Standard Edition" which is only $100. I have very little C# knowledge, and use Basic almost all the time. Would this be a good tool to use for web development? Does it support all the code behind stuff that VS users love so much? Thanks!! I use "VB.NET Standard Edition" and I'm happy with it. It has exactly the same features as Visual Studio.NET. Th...

Visual Studio.Net and VB.Net
Can we install VS.Net and VB.Net on the same machine and work side by. Is there any thing I need to worry about? I use VS.Net enterprise for my office work and I am planning to buy VB.Net standard for my personal use. Before I goahead and buy, I wanted to make sure that it works. Thanks for your help. Anil...

converting to vb.net from c#.net authorize.net
authorize.net offered me some sample code when I signed up with them the only problem is the sample code is in c#.net but my page that they type all of their credit card into is vb.net <code><%@ Import Namespace="System.Net" %> <%@ Import Namespace="System.IO" %> <script language="C#" runat="server"> void Page_Load(Object Src, EventArgs E) { myPage.Text = readHtmlPage("https://certification.authorize.net/gateway/transact.dll"); } private String readHtmlPage(string url) { ...

Visual Basic .NET 2003 vs Visual Studio .NET 2003
Hi, If im going to be coding my ASP.NET in just VB.NET then would I be able to go for the cheaper option of buying Visual Basic .NET 2003 ?? - Carl S Yes.Starting with ASP.NET 2.0? Look at:Programming Microsoft Web Forms My Blog Are there any limitations if I was doing my ASP.NET with VB.NET in Visual Basic .NET 2003 than if I was using the full Visual Studio .NET 2003 ?? Or are the only advantages of Visual Studio .NET 2003 in that it supports more programming languages ?? - Carl S You should check the MS Web site, but I believe that, given an edition (Standard, Professional...

Net:Net:Net::LDAP::FAQ
------_=_NextPart_001_01C6429F.D89AA417 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hello, Net::LDAP Net::LDAPS Is there a possible to LDAP bind with an encrypted (SHA, SSHA, CRYPT, ....) password? I don't like to write the secret password to the perl file. Best regards Barbara Wilbert ------_=_NextPart_001_01C6429F.D89AA417-- Wilbert Barbara (CI/OSI) * wrote: > Hello, > > Net::LDAP > Net::LDAPS > > Is there a possible to LDAP bind with an encrypted (SHA, SSHA, CRYPT, > ......

vb.net vs c#.net vs j#.net
just out of curiousity which looks, acts most like java? i'm still learning trying to used to vb.net but it seems that it was easier to do some stuff with java. C# is Java++ in my opinion. If you have done C or Jave you will prefer C#.Mike Schellenberger - MCAD If you are looking for language similar to java go for J#. However most code samples you find on the net will be in VB.NET and C#....

How to get RS (From VB6) to .NET (VB.NET)
Hi Friends,         I have requirement, there is one function in VB6 it returns a RS, I need to call that function in  VB.NET, how to get those values into .NET, if can any body can help (pass me some code snippets), that will be greate, Thank you.Madhu... -Madhu hey guys i got this one just by using fill method.-Madhu...

ADO.NET Programming in Visual Basic .NET
Has anyone read "ADO.NET Programming in Visual Basic .NET, Second Edition" by Steve Holzner (Author), Bob Howell (Author)? I am trying to working on a project and there are a few things that I need to tie up quickly in my web forms. Is this book a good one? karls------------------------------------'Old and wrinkled is not what I expected to become when I grew up!'...

use VB.NET and C#.NET code in the same C#.NET project
All-- Here is a sample that is "off the beaten path", (at least for me). Is it possible, in an ASP.NET application, using the code-behind page building technique, to have both pages written in VB.NET and pages written C#.NET?At http://www.WebLogicArts.com/DemoList.aspx there is a sample that shows that, (contrary to popular belief), it IS possible to mix ASP.NET pages built with C#.NET with ASP.NET pages built with VB.NET in the same VS.NET 2003 project. Note that this is just a "fun" sample to see if it can be done and I do not recommend this practice as a "standard" way of develo...

C# Visual Basic.NET JScript.NET what should I choose ?
I'm just a beginner with programing ASP.NET web sistes. Unfortunatelly I don't know any of the languages supported by ASP. (By the time I programmed in DELPHI and SQL) So I should start to learn one of the languages. Could somebody help me to choose the language I should use ? Which and why ? Thanks in advance, Gonzi Use C# or VB.NET, which ever you are comfortable with. Go here to see sample of both in use http://samples.gotdotnet.com/quickstart/aspplus Ultimately, once you get more advanced, you'll really want to become comfortable with both languages. I ...

Web resources about - How do I get the value from this combo box in vb .net... - asp.net.visual-basic.net

Shooting in San Bernardino leaves 14 dead; the 2 suspects also killed
A HEAVILY armed man and woman terrorised this city on Wednesday, killing at least 14 people and wounding at least 17 at a social services centre ...

Playing out the College Football Playoff: Sooners top Tide for title
Washington Post Playing out the College Football Playoff: Sooners top Tide for title CBSSports.com Clemson enters the second College Football ...

Islamic State claims responsibility for Aden assassination
Los Angeles Times Islamic State claims responsibility for Aden assassination Los Angeles Times Yemenis inspect the scene of a car bomb attack ...

Donald Trump Would Go After Terrorists’ Wives Because They ‘Know What’s Happening’
Donald Trump is vowing to clamp down on suspected terrorists if elected president, by going after their families. “I would certainly go after ...

Arnold Schwarzenegger: Climate Change Hard On The Brain, Global Warming Fight Needs China And U.S. To ...
According to former California governor Arnold Schwarzenegger, climate change science is very difficult for the average brain to understand. ...

Former President Jimmy Carter Announces He's Cancer-Free
Jimmy Carter has announced that his latest scan showed no signs of cancer. According to the Atlanta Journal-Constitution , the 91-year-old former ...

The Best & Worst Sketches from Ryan Gosling’s ‘Saturday Night Live’
Kicking off the final three episodes of Saturday Night Live that we’ll get in 2015, The Notebook and Drive star Ryan Gosling took the stage at ...

Has Anyone Seen The Star Wars Toyota Celica? Seriously, It's Missing
When the first Star Wars movie came out in 1977, Toyota had a Celica painted and sticker’d up with Darth Vader and friends (technically enemies, ...

Morgan Freeman’s Plane Crash Leaves Actor And SJ30 Jet Pilot, Jimmy Hobson, Unscathed
A private plane carrying actor Morgan Freeman and pilot Jimmy Hobson made an emergency crash landing in Tunica, Mississippi on Saturday. Fortunately, ...

‘Doctor Who’ Season Finale Sends Whovians Spinning
Doctor Who fans take their show extremely seriously, so it should be no surprise that the season finale, Hell Bent , has fans of the show – known ...

Resources last updated: 12/6/2015 8:48:15 PM