Results 1 to 5 of 5

Thread: datasource of dropdownliist in a DataList

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 2011
    Posts
    17

    Post datasource of dropdownliist in a DataList

    hi,
    i want to "populate" a dropdownlist in vb code inside a Datalist_ItemDataBound but i get this error: adding a value to a 'datetime' column caused overflow vb.net
    maybe a have done something wrong. i need some help. thanx
    here is the code inside Datalist_ItemDataBound

    Dim loMarcaDL As String = hfMarca.Value 'CType(e.Item.FindControl("hfMarcaDL"), HiddenField).Value
    Dim loAnulDL As Integer = hfAnul.Value 'CType(e.Item.FindControl("hfAnulDL"), HiddenField).Value
    Dim loLunaDl As Integer = hfLuna.Value 'CType(e.Item.FindControl("hfLunaDL"), HiddenField).Value
    Dim loActivity As String = CType(e.Item.FindControl("hfActivityID"), HiddenField).Value

    'Find the DropDownList in the Row
    Dim ddlDescriptionEGD As DropDownList = CType(e.Item.FindControl("ddlDescriptionEGD"), DropDownList)

    Dim ta As New DataSet_SLA_ImportTableAdapters.sp_SLA_DictionarForLunar_GetTableAdapter
    Dim tb As New DataSet_SLA_Import.sp_SLA_DictionarForLunar_GetDataTable
    ddlDescriptionEGD.DataSource = ta.ta_SLA_DictionarForLunar_Get(loMarcaDL, loAnulDL, loLunaDl, loActivity) --> HERE I GET THE ERROR
    ddlDescriptionEGD.DataTextField = "Descriere"
    ddlDescriptionEGD.DataValueField = "Id"
    ddlDescriptionEGD.DataBind()

    'Add Default Item in the DropDownList
    ddlDescriptionEGD.Items.Insert(0, New ListItem("Please select"))

  2. #2
    Frenzied Member KGComputers's Avatar
    Join Date
    Dec 2005
    Location
    Cebu, PH
    Posts
    2,020

    Re: datasource of dropdownliist in a DataList

    What's the corresponding query in this method?
    Code:
    ta.ta_SLA_DictionarForLunar_Get(loMarcaDL, loAnulDL, loLunaDl, loActivity)
    CodeBank: VB.NET & C#.NET | ASP.NET
    Programming: C# | VB.NET
    Blogs: Personal | Programming
    Projects: GitHub | jsFiddle
    ___________________________________________________________________________________

    Rating someone's post is a way of saying Thanks...

  3. #3
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    11,715

    Re: datasource of dropdownliist in a DataList

    Moderator Action: Moved to ASP.Net forum.
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | Code Tags | Sword of Fury - Jameram

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Feb 2011
    Posts
    17

    Re: datasource of dropdownliist in a DataList

    hi, thank you.
    i solved the error i used another method.

  5. #5
    Frenzied Member KGComputers's Avatar
    Join Date
    Dec 2005
    Location
    Cebu, PH
    Posts
    2,020

    Re: datasource of dropdownliist in a DataList

    Great! Don't forget to mark this thread as 'Resolved'..

    KGC
    CodeBank: VB.NET & C#.NET | ASP.NET
    Programming: C# | VB.NET
    Blogs: Personal | Programming
    Projects: GitHub | jsFiddle
    ___________________________________________________________________________________

    Rating someone's post is a way of saying Thanks...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width