Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON (") quote issue!!! #1781

Closed
ImAbhishekTomar opened this issue Jun 18, 2018 · 5 comments
Closed

JSON (") quote issue!!! #1781

ImAbhishekTomar opened this issue Jun 18, 2018 · 5 comments

Comments

@ImAbhishekTomar
Copy link

Can you please help.

This is my object created by c# code based on SQL data.
{
"RowId": 4533,
"PriorityID": 11,
"Priority_Description": "Exceeded PG WD 11+ where Clock has not stopped",
"PrioritySort": 13000,
"Include": false,
"UnitID": 82,
"Unit": "PI",
"AuditDate": "/Date(1493700221290)/",
"AuditUser": "MS\jdean9",
"RuleStartDate": "/Date(1527828900000)/",
"RuleEndDate": "/Date(1528869600000)/",
"w2ui": "{"style": "background-color:#FFC7CE;color:#9C0006"}",
"IsExpire": false,
"CreatedBy": null,
"CreatedOn": null,
"ModifiedBy": null,
"ModifiedOn": null,
"recid": 4533,
"RuleStartDate_": null,
"RuleEndDate_": null
}

in this object w2ui property is bind in side (") quote.
If i will remove this quote then, this is showing error in my sql query.
how to resolve this issue?

SQL Query

SELECT
A.UID as RowId,A.PriorityID,B.Priority_Description,
A.PrioritySort,
CAST(IIF(A.[Include]=0,0,1) as bit) as [Include],A.UnitID,C.Unit,
A.AuditDate,A.AuditUser,
A.RuleStartDate,
A.RuleEndDate,
IIF(IsExpire=0, '{"style": "background-color:#FFC7CE;color:#9C0006"}' ,null) as w2ui,
A.IsExpire,
A.CreatedBy,
A.CreatedOn,
A.ModifiedBy,
A.ModifiedOn
FROM
[dbo].[T_CPSMasterInventory_Priority_By_Unit] A
INNER JOIN [dbo].[T_CPSMasterInventory_Priority] B
ON A.PriorityID=B.PriorityID
INNER JOIN [dbo].[T_UNIT_ID] C
ON C.UNITID=A.UnitID
AND C.Unit='PI'

ImAbhishekTomar pushed a commit to ImAbhishekTomar/w2ui that referenced this issue Jun 22, 2018
Resolved - JSON (") quote issue!!! vitmalina#1781
@ImAbhishekTomar
Copy link
Author

any one please help...

@ImAbhishekTomar
Copy link
Author

my solution is not working, can you please help on this issue #1781

@KirillBorunov
Copy link
Contributor

KirillBorunov commented Aug 9, 2018

have you tried escaping the quote? in your sql:
IIF(IsExpire=0, '{\"style\": \"background-color:#FFC7CE;color:#9C0006\"}' ,null) as w2ui,

@ImAbhishekTomar
Copy link
Author

@KirillBorunov okay I will try.... thanks for comment.

@mpf82
Copy link
Collaborator

mpf82 commented Apr 26, 2021

This is my object created by [...]

Well, your code is not valid JSON.

It is out of the scope of the w2ui project to write your C# backend code.

Closing issue: not a w2ui issue

@mpf82 mpf82 closed this as completed Apr 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants