Försöker fylla en datalist med den här koden
Dim objconn As New OleDbConnection(ConfigurationSettings.AppSettings("connectionstring"))
Public dl_poll As DataList
Public error6 As Label
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Not (IsPostBack) Then
bindgrid()
End If
End Sub
Private grupp As String = ""
Public Property _pid() As String
Get
grupp = grupp
End Get
Set(ByVal Value As String)
grupp = Value
End Set
End Property
Public Sub bindgrid()
Dim objcmd As New OleDbDataAdapter _
("select [id],[votes],[pid],[alternativ] from [votes] where [pid]=" & grupp & " order by [id] desc", objconn)
Dim ds1 As DataSet = New DataSet()
objcmd.Fill(ds1, "poll1")
dl_poll.DataSource = ds1.Tables("poll1"). _
DefaultView
DataBind()
End Sub
Får det här felmeddelandet
Source Error:
Line 49: dl_poll.DataSource = ds1.Tables("poll1"). _
Line 50: DefaultView
Line 51: DataBind()
Line 52: End Sub
Line 53:
Source File: h:\inetpub\wwwroot\tibroik.net\poll.ascx.vb Line: 51
Någon som vet vad som kan vara fel?