Last post Nov 05, 2013 04:12 PM by James Dean
Nov 05, 2013 04:12 PM|James Dean|LINK
it's confusing, see:
1. I added a dataset in app_code folder and then added a dummy datatable (field names similar to one in database), so it is visible to Crystal report in ADO.net datasets list.
2. Dragged all field names from Datatable to Crystal report.
3. Now as i added code to do in .aspx.cs and it's working perfectly.
protected void Page_Load(object sender, EventArgs e)
string conStr = WebConfigurationManager.ConnectionStrings["LoginDatabaseConnectionString"].ConnectionString;
public void fillin_cr()
// DataSet2 ds = new DataSet2();
DataTable dt = new DataTable();
using(SqlConnection sqlCon = new SqlConnection(conStr))
using(SqlCommand sqlCom = new SqlCommand("select * from login", sqlCon ))
using (SqlDataAdapter sda = new SqlDataAdapter(sqlCom))
ReportDocument rd = new ReportDocument();
crViewer2.ReportSource = rd;
catch (Exception exc)
But problem is that why it is working ? even i commented this line
but still it's working, why ? names which i dragged are from another (dummy) table and the one i mentioned in code is another (though same field names) but i didn't merge and still it's working, why ?