Solved

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

Posted on 2004-09-07
3
283 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
3 Comments
 
LVL 1

Accepted Solution

by:
ahmedrashid earned 25 total points
Comment Utility
0
 

Author Comment

by:Cola78
Comment Utility
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
Comment Utility
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

772 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now