Я получаю следующую трассировку стека, когда мой код пытается выполнить процедуру сохранения, присутствующую в файле .dbml
.
Передача поиска исключения: System.Data.SqlClient.SqlException:
Неверное имя объекта 't_wfe_user_role'.
в System.Data.SqlClient.SqlConnection.OnError (исключение SqlException, логическое breakConnection)
в System.Data.SqlClient.SqlInternalExnection.OlError Sql)1008 * в System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning (TdsParserStateObject stateObj)
в System.Data.SqlClient.TdsParser.Run (RunBehavior runBehavior, Sql_ObDesignSlayShell_SlaySlay_SlaySlay_SlaySlay_SlaySlaySlaySlaySource_Source_Source_Source_Source_SjectSlaySlaySlaySlaySlaySlaySourceSlaySourceSjectSourceSjectSignSlaySlaySlaySlaySlaySlaySlaySlaySlaySlaySlaySlaySlaySourceSlaySourceSjectSourceSjectSignSlaySlaySource_Source_SlaySlaySource_SlayShellSlaySourceTegSer_TeO.Data.SqlClient.SqlDataReader.ConsumeMetaData ()
в System.Data.SqlClient.SqlDataReader.get_MetaData ()
в System.Data.SqlClient.SqlCommand.FinishExecuteReataeng)
в System.Data.SqlClient.SqlCommand.RunExecuteReaderTds (CommandBehavior cmdBehavior, RunBehavior runBehavior, логический returnStream, логический асинхронный), Строковый метод, результат DbAsyncResult)
в System.Data.SqlClient.SqlCommand.RunExecuteReader (CommandBehavior cmdBehavior, RunBehavior runBehavior, логический returnStream, метод String)
поведенияСтроковый метод)
в System.Data.SqlClient.SqlCommand.ExecuteDbDataReader (поведение CommandBehavior)
в System.Data.Common.DbCommand.ExecuteReader ()
в System.Data.Linq.SqlClient.SqlTrovide.(Запрос выражения, QueryInfo queryInfo, фабрика IObjectReaderFactory, объект [] parentArgs, объект [] userArgs, ICompiledSubQuery [] subQueries, объект lastResult)
в System.Data.Linq.SqlClient.SqlProvider.ExecuteAll (экспрессИонный запрос, QueryInfo [] queryInfos, IObjectReaderFactory factory, Object [] userArguments, ICompiledSubQuery [] subQueries)
в System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute (Expression)
в System.Data.Linq.DataContext.ExecuteMethodCall (экземпляр объекта, methodInfo methodInfo, параметры Object [])
в LinqDataClasses.DataClasses.WorkflowsDataContext.sp_wfe_transfer_task_force (Nullable 1
p_d2_user_ref, Nullable
1_f_f_1_f_1_f_1_f_1_f_1_f_1_f_1_f_1_2_2_2_2_2_2_2_2_2_2_2_2_2_2_2_2_2_2_2_2_1_2_2_2_2_2_2_2_2_2_F_F_2_2_P_F_F_2_2_2_Перечисления_1_2_1_1_1_1_1_1_0) в C: \ Documents and Settings \ Администратор \ Мои документы \ SPSM-Bidragshantering_Origo \ SPSM \ Main \ CommonData \ LinqDataClasses \ DataClasses \ Workflows.designer.cs: строка 347
в случаях SPSM.ContinueWorkflows.ContinueWFs (Int32 [], Тип строки) в C: \ Documents and Settings \ Администратор \ Мои документы \ SPSM-Bidragshantering_Origo \ SPSM \ Main \ SIS \ Applications \ SIS-PreditionalDecision \ ContinueWorkflows.cs: строка 67
Мои толькоПодозреваю, что плюрализация сама по себе споткнулась.В БД нет таблицы с именем t_wfe_user_role
.Он называется t_wfe_user_roles
, но затем Linq переименовывает его t_wfe_user_role
в графическом интерфейсе файла .dbml
.Эта таблица представляет собой таблицу соединений с двумя внешними ключами.
Любые идеи!?
Это фрагмент кода, из которого я вызываю процедуру сохранения.Вызов завершен (sp_wfe_transfer_task_force):
public class ContinueWorkflows
{
public AppVariables _APPVARS = new Utility.AppVariables();
public void ContinueWFs(int[] cases, string type)
{
foreach (int Case in cases)
{
if (Case != 0)
{
_APPVARS = (Utility.AppVariables)System.Web.HttpContext.Current.Session["CommonAppVariables"];
LinqDataClasses.DataClasses.WorkflowsDataContext wfdc = new LinqDataClasses.DataClasses.WorkflowsDataContext(_APPVARS.SQLConnectionString);
LinqDataClasses.DataClasses.t_wfe_workflow wf = wfdc.t_wfe_workflows.Where(p => p.c_d2_case_ref == Case && p.c_cancelled != true).FirstOrDefault();
if (wf != null)
{
LinqDataClasses.DataClasses.t_wfe_state state = wfdc.t_wfe_states.Where(p => p.c_workflow_ref == wf.c_rowid && p.c_cancelled != true).FirstOrDefault();
if (state != null)
{
LinqDataClasses.DataClasses.t_wfe_transfer transfer;
if (type == "Beslut")
{
transfer = wfdc.t_wfe_transfers.Where(p => p.c_from_step_ref == state.c_step_ref && p.c_name == "Till beslut" && p.c_cancelled != true).FirstOrDefault();
if (transfer == null)
{
transfer = wfdc.t_wfe_transfers.Where(p => p.c_from_step_ref == state.c_step_ref && p.c_name == "Övergång direkt till beslut" && p.c_cancelled != true).FirstOrDefault();
}
if (transfer == null)
{
transfer = wfdc.t_wfe_transfers.Where(p => p.c_from_step_ref == state.c_step_ref && p.c_name == "Övergång till beslut" && p.c_cancelled != true).FirstOrDefault();
}
}else if (type == "BVS")
{
transfer = wfdc.t_wfe_transfers.Where(p => p.c_from_step_ref == state.c_step_ref && p.c_name == "Stopp" && p.c_cancelled != true).FirstOrDefault();
}
else if (type == "TUFF")
{
transfer = wfdc.t_wfe_transfers.Where(p => p.c_from_step_ref == state.c_step_ref && p.c_name == "Preliminärt besked" && p.c_cancelled != true).FirstOrDefault();
}
else // SIS Prel Besked
{
transfer = wfdc.t_wfe_transfers.Where(p => p.c_from_step_ref == state.c_step_ref && p.c_name == "Övergång till preliminärt besked" && p.c_cancelled != true).FirstOrDefault();
}
if (transfer != null)
{
//Do transfer
int transref = transfer.c_rowid;
wfdc.sp_wfe_transfer_task_force(1, _APPVARS.DiaryRef, state.c_rowid, transref);
}
}
}
}
}
}
}