1

I am trying to add some features to existing web app, a newbie here thank you for your help. I am kinda lost here and went through library solution could not find the solution.

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: AssistToolv2.SqlException: SqlException occurred during query execution:

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[SqlException: SqlException occurred during query execution: ]
   AssistToolv2.SQLEngine.Query(String query) in C:\Users\Tokin\Desktop\AssistToolv2\AssistToolv2\Classes\SQLEngine.cs:156
   AssistToolv2.AssistRoundRobin.EE.Page_Load(Object sender, EventArgs e) in C:\Users\Tokin\Desktop\AssistToolv2\AssistToolv2\AssistRoundRobin\EE.aspx.cs:29
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
   System.Web.UI.Control.LoadRecursive() +71
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3048

Code

using System;
using System.Collections.Generic; 
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace AssistToolv2.AssistRoundRobin
{
    public partial class EE : System.Web.UI.Page
    {

        protected void Page_Load(object sender, EventArgs e)
        {
            DataTable SMEs = new DataTable();
            if (UserUtils.AccessLevel(Context.User.Identity.Name) < 5)
                SMEs = SQLEngine.Query(string.Format("SELECT * FROM arr_SMEs WHERE ID={0}", UserUtils.AccessGroup(Context.User.Identity.Name))).Copy();
            else
                SMEs = SQLEngine.Query("SELECT * FROM arr_SMEs").Copy();

                foreach (DataRow SME in SMEs.Rows)
                {
                    Label SMEName = new Label();
                    SMEName.Font.Bold = true;
                    SMEName.Text = SME["Name"].ToString();
                    SMEPlaceHolder.Controls.Add(SMEName);

                    DataTable SMEEs = SQLEngine.Query("SELECT * FROM arr_SMEs WHERE ID=DataRow.SMEs");

                    DataTable DisplayData = new DataTable();
                    DisplayData.Columns.Add("Name");
                    DisplayData.Columns.Add("Skills");
                    DisplayData.Columns.Add("Count");

                    foreach (DataRow SMEE in SMEEs.Rows)
                    {
                        DataRow DisplayInfo = DisplayData.NewRow();
                        DisplayInfo["Name"] = SMEE["Name"];
                        DisplayInfo["Skills"] = string.Empty;
                        string[] eeskills = SMEE["Skills"].ToString().Split(';');

                        int count = 0;
                        foreach (string skill in eeskills)
                        {
                            if (count > 0)
                                DisplayInfo["Skills"] += ",";
                            DataTable skillName = SQLEngine.Query(string.Format("SELECT Name from arr_Skills WHERE SME={0}", SMEE["ID"].ToString())).Copy();
                            DisplayInfo["Skills"] += skillName.Rows[0] ["Name"].ToString();
                            count++;
                        }
                    }
                    GridView SMEHistory = new GridView();
                    SMEHistory.Width = Unit.Percentage(185.00);
                    SMEHistory.DataSource = DisplayData;
                    SMEHistory.DataBind();
                    SMEPlaceHolder.Controls.Add(SMEHistory);
                    LiteralControl linebreak = new LiteralControl("<br /><br />");
                    SMEPlaceHolder.Controls.Add(linebreak);

                }
        }

        protected void DetailsView_PageIndexChanging(object sender, DetailsViewPageEventArgs e)
        {
            bool test_var = true;
        }

    }
}'
Learner
  • 43
  • 1
  • 5
  • 1
    This is a generic exception. Can you post the `InnerException`? – Arian Motamedi Oct 21 '14 at 15:45
  • Where exactly is the error? – jayvee Oct 21 '14 at 15:47
  • 1
    This looks like it would throw a SQL exception `SQLEngine.Query("SELECT * FROM arr_SMEs WHERE ID=DataRow.SMEs");` – Ben Robinson Oct 21 '14 at 15:51
  • @PoweredByOrange I have added the inner one, hope this is what you are expecting. Thank you. – Learner Oct 21 '14 at 16:11
  • @Tokin The inner exception suggests that there's a problem with the remote server and not SQL server. [Check out this answer](http://stackoverflow.com/questions/2946340/visual-studio-2010-web-deployment-task-failed), it might be related to your issue. – Arian Motamedi Oct 21 '14 at 17:18
  • @PoweredByOrange It helped, I had changed my password so there was this error on VS2010 but I still have the other errors, SqlException occurred during query execution as above Thank you. – Learner Oct 21 '14 at 18:02
  • What's the inner exception now? – Arian Motamedi Oct 21 '14 at 18:27
  • @PoweredByOrange there is no any inner error or exception shown in VS, only after I publish it to web and go in the page I see the error as above. – Learner Oct 21 '14 at 18:41

0 Answers0