<%--code provided by getcodesnippet.com--%>
| User ID | User Name | Contact Number |
|---|
<%# Eval("User_Id")%>
<%# Eval("User_Name")%>
<%# Eval("Contact_Number")%>
<%# Eval("Email")%>
-------code----
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
// code provided by getcodesnippet.com
SqlConnection conn = new SqlConnection("Data Source=.;Initial Catalog=CPD_TEST;User ID=sa;Password=sunil");
SqlCommand cmd = new SqlCommand("Select * From Table1", conn);
conn.Open();
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
conn.Close();
ListView1.DataSource = dt;
ListView1.DataBind();
}
}
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
// code provided by getcodesnippet.com
SqlConnection conn = new SqlConnection("Data Source=.;Initial Catalog=CPD_TEST;User ID=sa;Password=sunil");
SqlCommand cmd = new SqlCommand("Select * From Table1", conn);
conn.Open();
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
conn.Close();
ListView1.DataSource = dt;
ListView1.DataBind();
}
}
-------------------------------
This Control Not Show in Any Browser.
Please Solve Problem.
1 Reply
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.

Karthik RajPosted Jan 12, 2015, 2:46 AM