How to bind data with DataList controlLLegolas15yAsked Aug 2, 2011, 12:25 AM EDT3 answersShareLinkedInXCopy linkSaveHi,How to bind sql server data with DataList control in asp.net ?
How to bind data with DataList controlLLegolas15yAsked Aug 2, 2011, 12:25 AM EDT3 answersShareLinkedInXCopy linkSaveHi,How to bind sql server data with DataList control in asp.net ?
Mayur DigheRank #1,078 · 1.8K reputation15y agoPosted Aug 3, 2011, 7:59 AM EDT0This Link can be helpful to you....Check it.... http://immortaldotnet.blogspot.com/search/label/DataList0
Satyapriya NayakRank #47 · 31.5K reputation15y agoPosted Aug 10, 2011, 8:28 AM EDT0Hi Legolas,Use the below code and run the attachments.Default.aspx code<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %> Untitled Page Id Name Address Marks <%#Eval("sid")%> <%#Eval("sname")%> <%#Eval("saddress")%> <%#Eval("smarks")%> Default.aspx.vb codeImports System.Data.SqlClientImports System.DataPartial Class _Default Inherits System.Web.UI.Page Dim strConnString As String = System.Configuration.ConfigurationManager.ConnectionStrings.Item("ConnectionString").ToString() Dim con As New SqlConnection(strConnString) Dim sqlda As SqlDataAdapter Dim com As SqlCommand Dim ds As DataSet Dim str As String Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load bindlist() End Sub Sub bindlist() Try con.Open() str = "select * from student" com = New SqlCommand(str, con) sqlda = New SqlDataAdapter(com) ds = New DataSet sqlda.Fill(ds, "student") DataList1.DataSource = ds DataList1.DataMember = "student" DataList1.DataBind() con.Close() Catch ex As Exception Response.Write(ex.Message) End Try End SubEnd ClassThanks If this post helps you mark it as answer0Satyapriya NayakRank #47 · 31.5K reputation15y agoPosted Aug 11, 2011, 10:51 AM EDT0Hi legolas, If this post helps you mark it as answer Thanks0Join to answer this questionEvery answer you publish earns 20 SHARP.Create free accountSign inKnow the answer?Answer a question in the forums and earn +20 SHARP for every answer.See unanswered questionsForumsTop experts01Arun PottiAnswers in the forums20answers02Tahir AnsariAnswers in the forums5answers03Kamlesh KumarAnswers in the forums5answers04Sam HobbsAnswers in the forums4answers05Željko PerićAnswers in the forums3answers?YouYour name goes here.Every answer: 20 SHARP.JoinFull leaderboard →2026DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Satyapriya NayakRank #47 · 31.5K reputation15y agoPosted Aug 11, 2011, 10:51 AM EDT0Hi legolas, If this post helps you mark it as answer Thanks0
Mayur DigheRank #1,078 · 1.8K reputationPosted Aug 3, 2011, 7:59 AM EDT
This Link can be helpful to you....
Check it....
http://immortaldotnet.blogspot.com/search/label/DataList
Satyapriya NayakRank #47 · 31.5K reputationPosted Aug 10, 2011, 8:28 AM EDT
Use the below code and run the attachments.
Default.aspx code
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>