?
Solved

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

Posted on 2004-09-07
3
Medium Priority
?
296 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 75 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 75 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses
Course of the Month13 days, 2 hours left to enroll

777 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