473,327 Members | 1,892 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Insert item into listbox



Hi - I've used this code from another posting - what I'd like to know
is, is it possible to insert another item into the dataset (eg. please
select category)?

I know I can do this to a normal list box, by using
'control'.items.insert(0, New ListItem("Please select category","0")) -
but I'm not sure how to do it in this example.

Thanks for any help.

Mark

Function GetCategories() as DataSet

Dim myConnection as New
SqlConnection("server=local;database=northwind;Int egrated Security=SSPI
")

Dim ddlDataSet as DataSet = New DataSet()

Dim ddlDataSetTime as DataSet = New DataSet()

'Populate the list of NOtices

Const strSQLDDL as String = "SELECT distinct(NoticeName) FROM
ListOfNotices ORDER BY NoticeName"

Dim myDataAdapter as SqlDataAdapter = New SqlDataAdapter(strSQLDDL,
myConnection)

myDataAdapter.Fill(ddlDataSet, "Notices")

Return ddlDataSet

End Function

<asp:TemplateColumn HeaderText="PastdueTime">

<ItemTemplate>

<asp:DropDownList runat="server" id="dplPastduetime"
DataValueField="TimeOfYear" DataTextField="TimeOfYear" DataSource='<%#
GetCategoriesTime() %>' />

</ItemTemplate>

</asp:TemplateColumn>

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 21 '05 #1
0 1762

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Andrew | last post by:
Hi I just started learning wxPython I wanted to know how I could do this in wxPython self.listbox.delete(0, END) for item in self.results: self.listbox.insert(END, item)
4
by: Peter Moscatt | last post by:
I am having trouble understanding the methods for the Listbox from Tk. If I was to select at item in the list using a mouse click (have already created the bind event) - what method returns the...
9
by: Gerald Lightsey | last post by:
I am doing some work that involves automating MS MapPoint 2002. The object model is documented in the context of Visual Basic 6.0. A typical example follows. 'Output first result of find...
1
by: jez123456 | last post by:
Hi, I have a windows form with a listbox control. My code all works correctly when deleting an item from the listbox except the last item. I get the following message when trying to delete the...
6
by: orahm | last post by:
I added an object to a listbox. This object is a complex number and not a string so it shows "Consolapplication.Complex" as a list item. If I convert the complex number to a string then it shows a...
2
by: Jeff | last post by:
I need to insert into a table multiple item of a listbox. (item.text and item.value Right now, I'm using an OleDBConnection with Access, a Command(Insert string) and parameters. I don't see how an...
6
by: David De Cotis | last post by:
Hello all, I am trying to go through a ListBox and verify if am item was selected. If an item was selected, I would like to get a handle of the item and simply do a response.write on the selected...
1
by: Karen Grube | last post by:
Hi! I'm using a standard server side ASP.Net listbox control on a web form. The page is basically various shades of green. The listbox itself has a pale green background and forest green text...
3
by: perrycheung221 | last post by:
Hi guys, I got 2 listboxes in a window form, one on left and one on right. The 1st listbox have some items while the 2nd listbox is empty. Also there are 2 buttons between the 2 listboxes which...
1
by: Jim | last post by:
I'm trying to take the data from strSQL below and "append / insert" that into the Access database. The problem is: although the listbox displays correctly, the Access table gets the first record...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.