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!