Error 1 The type or namespace name 'myreport' could not be found (are you missing a using directive or an assembly reference?) F:\myaspcrystal\Default.aspx.cs 49 9 F:\myaspcrystal\
Error 3 The name 'crystalReportViewer1' does not exist in the current context F:\myaspcrystal\Default.aspx.cs 77 9 F:\myaspcrystal\
using System; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; using System.Data.SqlClient; using System.IO; using System.Collections.Generic; using CrystalDecisions.CrystalReports.Engine; using CrystalDecisions.Shared;
public partial class _Default : System.Web.UI.Page { public static string connectionString = "Data Source=FAROOQPC\\SQLEXPRESS; Initial Catalog=mydb; Integrated Security=True"; private SqlDataAdapter dataAdapter; private DataSet dataSet; private DataTable dataTable; // *** End ADO.NET objects *** private static string Name; private static string Cell; private static string Address; //private static string EmpId; protected void Page_Load(object sender, EventArgs e) { string commandstring = "select * from db"; // The link between the sql command and the database connection dataAdapter = new SqlDataAdapter(commandstring, connectionString); // Define insert, update, and delete sql commands to use. // BuildCommands(); // Declare and fill the in-memory dataset from the database dataSet = new DataSet(); dataSet.CaseSensitive = true; dataAdapter.Fill(dataSet, "Employee"); myreport Report = new myreport(); //error line 1 mydataset ds=new mydataset(); mydataset.DataTable1DataTable t = (mydataset.DataTable1DataTable)ds.Tables[0]; dataTable = dataSet.Tables[0]; foreach (DataRow dataRow in dataTable.Rows) { // Load global strings from column values in the datarow //CustId = dataRow[""].ToString().Trim(); Name = dataRow["Name"].ToString().Trim(); Cell = dataRow["Cell"].ToString().Trim(); Address = dataRow["Address"].ToString().Trim(); t.AddDataTable1Row(Name, Cell, Address); } Report.SetDataSource(ds); crystalReportViewer1.ReportSource = Report; //Error Line 2 } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)