Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Pls Help Me !!!

Pls Help Me !!!

Scheduled Pinned Locked Moved C#
helpdatabasesharepoint
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    Fahad Ali
    wrote on last edited by
    #1

    i am using this code to print a report but the problem comes when i pass parameters like Supplier_Id as i have done in this query the error comes like "Query engine Error and follows with the path.I am using this code.Well the problem doesn't comes with the query in which i have not passed parameters Pls help me to sort out this problem.Thanks Fahad. try { int Supplier_Id=Convert.ToInt32(Supplier_Id_C.Text); string s_p="sp_P_S_Rpt"; SqlConnection conn = Class_Connection.Make_Conn(); // SqlCommand command = new SqlCommand(s_p, conn); // command.CommandType = CommandType.StoredProcedure; // command.Parameters.Add("@Supplier_Id", SqlDbType.Int); // command.Parameters["@Supplier_Id"].Value = Supplier_Id; // SqlDataAdapter adapter = new SqlDataAdapter(command); // DataSet ds = new DataSet(); // adapter.Fill(ds, "P_S"); // // dataGrid1.DataSource=ds; // dataGrid1.DataMember="P_S"; // P_R_Rpt obj = new P_R_Rpt(); // obj.SetDatabaseLogon("sa","sa","CDMA","Final_Project1_e"); // obj.SetDataSource(ds); // crystalReportViewer1.ReportSource=obj; // Cursor = System.Windows.Forms.Cursors.Default; //reportDocument1.SetDatabaseLogon("sa","sa","CDMA","Final_Project1_e"); // reportDocument1.SetDataSource(ds); // crystalReportViewer1.ReportSource = reportDocument1; // Finalized.P_R_Rpt obj = new P_R_Rpt(); // obj.SetDatabaseLogon("sa","sa","CDMA","Final_Project1_e"); // reportDocument1.SetDataSource(ds); // crystalReportViewer1.ReportSource = reportDocument1; SqlCommand command = new SqlCommand(s_p, conn); command.CommandType = CommandType.StoredProcedure; command.Parameters.Add("@Supplier_Id", SqlDbType.Int); command.Parameters["@Supplier_Id"].Value = Supplier_Id; SqlDataAdapter adapter = new SqlDataAdapter("SELECT dbo.Supplier.Supplier_Name, dbo.P_Order.P_O_Date, dbo.P_Order.P_O_Serial_No, dbo.P_Order.P_O_Id FROM dbo.P_Order INNER JOIN dbo.P_O_Details ON dbo.P_Order.P_O_Id = dbo.P_O_Details.P_O_Id INNER JOIN dbo.Supplier ON dbo.P_O_Details.Supplier_Id = dbo.Supplier.Supplier_Id WHERE(dbo.P_O_Details.Supplier_Id = 2)","Data Source=CDMA;Database=Final_Project1_e;UID=sa;PASSWORD=sa");// = new SqlDataAdapter(command); //P_R ds = new P_R(); //SqlDataAdapter adapter = new SqlDataAdapter(command); DataSet ds = new DataSet(); adapter.Fill(ds,"P_R_Rpt1"); dataGrid1.DataSource=ds; dataGrid1.DataMember = "P_R_Rpt1"; //P_R ds = new P

    P 1 Reply Last reply
    0
    • F Fahad Ali

      i am using this code to print a report but the problem comes when i pass parameters like Supplier_Id as i have done in this query the error comes like "Query engine Error and follows with the path.I am using this code.Well the problem doesn't comes with the query in which i have not passed parameters Pls help me to sort out this problem.Thanks Fahad. try { int Supplier_Id=Convert.ToInt32(Supplier_Id_C.Text); string s_p="sp_P_S_Rpt"; SqlConnection conn = Class_Connection.Make_Conn(); // SqlCommand command = new SqlCommand(s_p, conn); // command.CommandType = CommandType.StoredProcedure; // command.Parameters.Add("@Supplier_Id", SqlDbType.Int); // command.Parameters["@Supplier_Id"].Value = Supplier_Id; // SqlDataAdapter adapter = new SqlDataAdapter(command); // DataSet ds = new DataSet(); // adapter.Fill(ds, "P_S"); // // dataGrid1.DataSource=ds; // dataGrid1.DataMember="P_S"; // P_R_Rpt obj = new P_R_Rpt(); // obj.SetDatabaseLogon("sa","sa","CDMA","Final_Project1_e"); // obj.SetDataSource(ds); // crystalReportViewer1.ReportSource=obj; // Cursor = System.Windows.Forms.Cursors.Default; //reportDocument1.SetDatabaseLogon("sa","sa","CDMA","Final_Project1_e"); // reportDocument1.SetDataSource(ds); // crystalReportViewer1.ReportSource = reportDocument1; // Finalized.P_R_Rpt obj = new P_R_Rpt(); // obj.SetDatabaseLogon("sa","sa","CDMA","Final_Project1_e"); // reportDocument1.SetDataSource(ds); // crystalReportViewer1.ReportSource = reportDocument1; SqlCommand command = new SqlCommand(s_p, conn); command.CommandType = CommandType.StoredProcedure; command.Parameters.Add("@Supplier_Id", SqlDbType.Int); command.Parameters["@Supplier_Id"].Value = Supplier_Id; SqlDataAdapter adapter = new SqlDataAdapter("SELECT dbo.Supplier.Supplier_Name, dbo.P_Order.P_O_Date, dbo.P_Order.P_O_Serial_No, dbo.P_Order.P_O_Id FROM dbo.P_Order INNER JOIN dbo.P_O_Details ON dbo.P_Order.P_O_Id = dbo.P_O_Details.P_O_Id INNER JOIN dbo.Supplier ON dbo.P_O_Details.Supplier_Id = dbo.Supplier.Supplier_Id WHERE(dbo.P_O_Details.Supplier_Id = 2)","Data Source=CDMA;Database=Final_Project1_e;UID=sa;PASSWORD=sa");// = new SqlDataAdapter(command); //P_R ds = new P_R(); //SqlDataAdapter adapter = new SqlDataAdapter(command); DataSet ds = new DataSet(); adapter.Fill(ds,"P_R_Rpt1"); dataGrid1.DataSource=ds; dataGrid1.DataMember = "P_R_Rpt1"; //P_R ds = new P

      P Offline
      P Offline
      PlayByTheRules
      wrote on last edited by
      #2

      Fahad Ali wrote as the subject line:

      Pls Help Me !!!

      Just about every one here is looking for help. This is a useless subject line. You should use something more meaningful. For example "Query Engine Error" would be better.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups