Ignore warning on duplicate on duplicate definition
- dmasterplan
- Posts: 143
- Joined: Thu Mar 17, 2022 4:04 am
- Location: Philippines
Ignore warning on duplicate on duplicate definition
Hi,
How do I ignore error for dupllicate definition?
Shown below, there are two (2) definition for Responsible Person.
public virtual string Responsible_Person
{
get
{
return ((string)(StiReport.ChangeType(this["Responsible Person"], typeof(string), true)));
}
}
public virtual string Package_In_Charge
{
get
{
return ((string)(StiReport.ChangeType(this["Package-In-Charge"], typeof(string), true)));
}
}
public virtual string Responsible_Person
{
get
{
return ((string)(StiReport.ChangeType(this["Responsible Person"], typeof(string), true)));
}
}
I have a purpose for it as this is my query for the datasource
SELECT
Name,
projectno,
BEName,
package,
Code,
description,
PackageCategory,
status,
tenderlettingdate,
tendercalldate,
acttendcalldate,
acttendletdate,
Discipline,
[Responsible Person],
CASE
WHEN MainQuery.[Package-In-Charge] <> ''
THEN LEFT(MainQuery.[Package-In-Charge], CAST((LEN(MainQuery.[Package-In-Charge]) - 1) AS INT))
ELSE
''
END 'Package-In-Charge',
MainQuery.[Responsible Person]
FROM
(
SELECT
Cmdiscipline.code "Discipline",
ISNULL(
SUBSTRING(
(
SELECT DISTINCT
CONCAT(
ISNULL(
CAST(CONCAT(contact.Name, ', ', Parent.RecipientCode + ', ') AS NVARCHAR(1000)),
''
), ''
) AS [text()]
FROM
contact
INNER JOIN
contact parent
ON parent.contact = contact.parentcontact
INNER JOIN
packagerole
ON PackageRole.contact = contact.contact
WHERE
1 = 1
AND packagerole.Package = package.package
FOR XML PATH('')
), 1, 1000
), ''
) 'Package-In-Charge',
(
SELECT
CONCAT(Contact.Name, ', ', Parent.RecipientCode)
FROM
contact
INNER JOIN
contact Parent
ON Parent.contact = contact.parentContact
INNER JOIN
package p
ON p.ResponsiblePerson = contact.contact
WHERE
p.package = package.package
) "Responsible Person"
FROM
Project
INNER JOIN
Package
ON Project.Project = Package.Project
INNER JOIN
BusEnt
ON Project.BusEnt = BusEnt.BusEnt
LEFT JOIN
cmdiscipline
ON Cmdiscipline.Cmdiscipline = Package.Cmdiscipline
WHERE
Project.Project = 104
AND BusEnt.BusEnt = 7
AND (
Package.packagecategory = 0
OR 0 = 0
)
) MainQuery
I have read an article regarding supressing warning
class Test
{
int unused;
int assigned = 3;
}
warning CS0169: The field 'Test.unused' is never used
warning CS0414: The field 'Test.assigned' is assigned but its value is never used
It was suppressed like this:
class Test
{
#pragma warning disable 169, 414
int unused;
int assigned = 3;
}
and re-enabled like this:
class Test
{
#pragma warning disable 169, 414
int unused;
int assigned = 3;
#pragma warning restore 169, 414
}
I am not sure if this is possible or not AND it didn't give a code for the error or warning.
How can this be solved?
Regards,
Leeyo
How do I ignore error for dupllicate definition?
Shown below, there are two (2) definition for Responsible Person.
public virtual string Responsible_Person
{
get
{
return ((string)(StiReport.ChangeType(this["Responsible Person"], typeof(string), true)));
}
}
public virtual string Package_In_Charge
{
get
{
return ((string)(StiReport.ChangeType(this["Package-In-Charge"], typeof(string), true)));
}
}
public virtual string Responsible_Person
{
get
{
return ((string)(StiReport.ChangeType(this["Responsible Person"], typeof(string), true)));
}
}
I have a purpose for it as this is my query for the datasource
SELECT
Name,
projectno,
BEName,
package,
Code,
description,
PackageCategory,
status,
tenderlettingdate,
tendercalldate,
acttendcalldate,
acttendletdate,
Discipline,
[Responsible Person],
CASE
WHEN MainQuery.[Package-In-Charge] <> ''
THEN LEFT(MainQuery.[Package-In-Charge], CAST((LEN(MainQuery.[Package-In-Charge]) - 1) AS INT))
ELSE
''
END 'Package-In-Charge',
MainQuery.[Responsible Person]
FROM
(
SELECT
Cmdiscipline.code "Discipline",
ISNULL(
SUBSTRING(
(
SELECT DISTINCT
CONCAT(
ISNULL(
CAST(CONCAT(contact.Name, ', ', Parent.RecipientCode + ', ') AS NVARCHAR(1000)),
''
), ''
) AS [text()]
FROM
contact
INNER JOIN
contact parent
ON parent.contact = contact.parentcontact
INNER JOIN
packagerole
ON PackageRole.contact = contact.contact
WHERE
1 = 1
AND packagerole.Package = package.package
FOR XML PATH('')
), 1, 1000
), ''
) 'Package-In-Charge',
(
SELECT
CONCAT(Contact.Name, ', ', Parent.RecipientCode)
FROM
contact
INNER JOIN
contact Parent
ON Parent.contact = contact.parentContact
INNER JOIN
package p
ON p.ResponsiblePerson = contact.contact
WHERE
p.package = package.package
) "Responsible Person"
FROM
Project
INNER JOIN
Package
ON Project.Project = Package.Project
INNER JOIN
BusEnt
ON Project.BusEnt = BusEnt.BusEnt
LEFT JOIN
cmdiscipline
ON Cmdiscipline.Cmdiscipline = Package.Cmdiscipline
WHERE
Project.Project = 104
AND BusEnt.BusEnt = 7
AND (
Package.packagecategory = 0
OR 0 = 0
)
) MainQuery
I have read an article regarding supressing warning
class Test
{
int unused;
int assigned = 3;
}
warning CS0169: The field 'Test.unused' is never used
warning CS0414: The field 'Test.assigned' is assigned but its value is never used
It was suppressed like this:
class Test
{
#pragma warning disable 169, 414
int unused;
int assigned = 3;
}
and re-enabled like this:
class Test
{
#pragma warning disable 169, 414
int unused;
int assigned = 3;
#pragma warning restore 169, 414
}
I am not sure if this is possible or not AND it didn't give a code for the error or warning.
How can this be solved?
Regards,
Leeyo
-
- Posts: 7338
- Joined: Tue Mar 20, 2018 5:34 am
Re: Ignore warning on duplicate on duplicate definition
Hello,
Please send us a sample that reproduces the issue for analysis.
Thank you.
Please send us a sample that reproduces the issue for analysis.
Thank you.
Re: Ignore warning on duplicate on duplicate definition
Your Sql Query returned two columns with name 'Responsible Person'.
- dmasterplan
- Posts: 143
- Joined: Thu Mar 17, 2022 4:04 am
- Location: Philippines
- dmasterplan
- Posts: 143
- Joined: Thu Mar 17, 2022 4:04 am
- Location: Philippines
Re: Ignore warning on duplicate on duplicate definition
should I send the mrt? I can't send the db as it is a company property. how to convert (table) it to xml anyway?Lech Kulikowski wrote: ↑Wed Mar 30, 2022 9:42 am Hello,
Please send us a sample that reproduces the issue for analysis.
Thank you.
and how do I send it? where?
Re: Ignore warning on duplicate on duplicate definition
Column names have to be unique.
-
- Posts: 7338
- Joined: Tue Mar 20, 2018 5:34 am
Re: Ignore warning on duplicate on duplicate definition
Hello,
You can set the Calculation mode option to the Interpretation for the report.
But in that case, any other compilation errors will be ignored.
Thank you.
You can set the Calculation mode option to the Interpretation for the report.
But in that case, any other compilation errors will be ignored.
Thank you.