Solved

How to Insert Data from drop-down list into DB?

Posted on 2004-09-07
3
294 Views
Last Modified: 2009-12-16
I have a drop-down list and an Insert button
How can I Insert data that choose from the drop-down list into DB?

Before this I have set the value for the parameter:
lst.setLocation("Place A");

and when I change to:
lst.getLocation(drop.SelectedItem.Text);

I have this error:
Method getLocation in type Loc.Location from assembly getLocation does not have an implementation.


Now what should I change to?

TQ!
0
Comment
Question by:Cola78
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 1

Accepted Solution

by:
ahmedrashid earned 25 total points
ID: 12003398
0
 

Author Comment

by:Cola78
ID: 12003833
private void Button1_Click(object sender, System.EventArgs e)
{  :
   :
 lst.setLocation(drop.SelectedItem.Text);

}
==========================
this is working..
but the problem is it will only insert the 1st item in the drop-down list regardless which items u select.
how can I make it to insert only the item I select?
0
 
LVL 10

Assisted Solution

by:123654789987
123654789987 earned 25 total points
ID: 12005286
U can see this sample

Dim str() As String
Dim selected As String
For i As Integer = 0 To ListBox1.Items.Count - 1
           If ListBox1.Items(i).Selected = True Then
               selected = selected + ListBox1.Items(i).Text
               selected = selected + ","
           End If
       Next
       If Not selected = "" Then
           selected = Left(selected, Len(selected) - 1)
       End If
       str = selected.Split(CType(",", Char))

This way u can get a string array containing a list of selected items. U can insert them into the database
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question