Solved

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

Posted on 2004-09-07
3
295 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

Technology Partners: 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

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…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

696 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