Hello
I need to display Id, Title, price,code and Image folder in DataList.
Please help me...
aspx
aspx.cs
if (!Page.IsPostBack)
{
string connectionString = ConfigurationManager.ConnectionStrings["indConnStr"].ConnectionString;
DataTable dt = new DataTable();
SqlConnection conn = new SqlConnection(connectionString);
using (conn)
{
SqlDataAdapter ad = new SqlDataAdapter("SELECT * FROM product", conn);
ad.Fill(dt);
}
dtlist.DataSource = dt;
dtlist.DataBind();
}
{
string connectionString = ConfigurationManager.ConnectionStrings["indConnStr"].ConnectionString;
DataTable dt = new DataTable();
SqlConnection conn = new SqlConnection(connectionString);
using (conn)
{
SqlDataAdapter ad = new SqlDataAdapter("SELECT * FROM product", conn);
ad.Fill(dt);
}
dtlist.DataSource = dt;
dtlist.DataBind();
}
web.config
error show:-
Instance failure.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.InvalidOperationException: Instance failure.
Source Error:
The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL: |
Stack Trace:

Vishal JadavPosted Dec 17, 2015, 6:51 AM
{
string connectionString = ConfigurationManager.ConnectionStrings["indConnStr"].ConnectionString;
DataTable dt = new DataTable();
SqlConnection conn = new SqlConnection(connectionString);
SqlDataAdapter ad = new SqlDataAdapter("SELECT * FROM product", conn);
ad.Fill(dt);
dtlist.DataSource = dt;
dtlist.DataBind();
}