A
Aussie Rules
Hi,
I am still having a problem using a datalist control using VB.net
This is my code......
In the HTML page I have
<aspataList ID="DataList1" runat="server">
</aspataList>
In the codebehind file (code below) I get an error saying that NAME
datalist1 is not declared........
What am I doing wrong here????
Codebehind contents.....
Try
Dim SQLServerConnection As SqlConnection
Dim SqlConnectionCls As New clsSQL
Dim SqlDataAdapter As New SqlDataAdapter
Dim ds As New Data.DataSet
SQLServerConnection = SqlConnectionCls.Connect
Dim SqlCommand As New SqlCommand
With SqlCommand
.CommandType = Data.CommandType.StoredProcedure
.Connection = SQLServerConnection
.CommandTimeout = 15
.CommandText = "sproc_GetBannerAdvertDetails"
End With
SqlDataAdapter.SelectCommand = SqlCommand
SqlDataAdapter.Fill(ds, "data")
DataList1.DataSource = ds.Tables("data")
DataList1.DataBind()
Catch ex As Exception
End Try
I am still having a problem using a datalist control using VB.net
This is my code......
In the HTML page I have
<aspataList ID="DataList1" runat="server">
</aspataList>
In the codebehind file (code below) I get an error saying that NAME
datalist1 is not declared........
What am I doing wrong here????
Codebehind contents.....
Try
Dim SQLServerConnection As SqlConnection
Dim SqlConnectionCls As New clsSQL
Dim SqlDataAdapter As New SqlDataAdapter
Dim ds As New Data.DataSet
SQLServerConnection = SqlConnectionCls.Connect
Dim SqlCommand As New SqlCommand
With SqlCommand
.CommandType = Data.CommandType.StoredProcedure
.Connection = SQLServerConnection
.CommandTimeout = 15
.CommandText = "sproc_GetBannerAdvertDetails"
End With
SqlDataAdapter.SelectCommand = SqlCommand
SqlDataAdapter.Fill(ds, "data")
DataList1.DataSource = ds.Tables("data")
DataList1.DataBind()
Catch ex As Exception
End Try