System.Data.SyntaxErrorException was unhandled
Message="Cannot interpret token '\\' at position 8."
Source="System.Data"
StackTrace:
at System.Data.ExpressionParser.Scan()
at System.Data.ExpressionParser.Parse()
at System.Data.DataExpression..ctor(DataTable table, String expression, Type type)
at System.Data.Select..ctor(DataTable table, String filterExpression, String sort, DataViewRowState recordStates)
at System.Data.DataTable.Select(String filterExpression)
at ServerScanCompare.FileScanCompare.FileCompare(DataTable dtbScanResults) in C:\Documents and Settings\441051\My Documents\Visual Studio 2008\Projects\ServerScanCompare\ServerScanCompare\FileScanCompare.cs:line 64
at ServerScanCompare.FileScanCompare.RunFileScanCompare(String szSearchArgs, String[] szServer, String[] szSharedResource) in C:\Documents and Settings\441051\My Documents\Visual Studio 2008\Projects\ServerScanCompare\ServerScanCompare\FileScanCompare.cs:line 45
at ServerScanCompare.MainGUI..ctor() in C:\Documents and Settings\441051\My Documents\Visual Studio 2008\Projects\ServerScanCompare\ServerScanCompare\MainGUI.cs:line 20
at ServerScanCompare.Program.Main() in C:\Documents and Settings\441051\My Documents\Visual Studio 2008\Projects\ServerScanCompare\ServerScanCompare\Program.cs:line 19
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
And my code that is erroring out is this:
public DataSet FileCompare(DataTable dtbScanResults)
{
//create the dataset
DataSet dsFileCompareResults = new DataSet("FileCompareResults");
//add the tables to the data set
dsFileCompareResults.Tables.Add(dtbScanResults);
dsFileCompareResults.Tables.Add(CreateNewFileNameTable("FileNameFlags"));
//search the dtb results for differing files
foreach(DataRow drPrimaryRow in dtbScanResults.Rows) {
if((bool)drPrimaryRow["FlaggedFile"] != true)
{
foreach(DataRow drComparedRow in [B]dtbScanResults.Select(drPrimaryRow["FileDirectoryLocation"].ToString())[/B])
{
....
Bolded is the line that errors.Other information that may be relevant:
- The DataTable that is put in as a parameter has 7 Columns. The first 6 are string types, and the last is a bool type.
- The primary keys of the table are "FileFullPath" and "FileDirectoryLocation" which are both string types. FileFullPath is unique, but FileDirectoryLocation is not.
- The string returned from dtbScanResults.Select(drPrimaryRow["FileDirectoryLocation"].ToString() is "//export//", it is /export/ in the DataTable


Sign In
Create Account


Back to top









