Click here to Skip to main content
15,917,610 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi here is the code in front end

C#
PatientID = record["PatientID"].ToString() == "0" ? string.Empty : record["PatientID"].ToString(),


so in db procedure i have taken patient id as -

SQL
ISNULL(Convert(Varchar(50),PC.PatientID),'') AS 'PatientID',


my requirement is to have the patient id like-

PatientID = record["PatientID"].ToString(),

So how can i achieve the same by changing the sql procedure code in db by applying Isnull function to it.

thanks in advance
Posted

1 solution

What I understood from question..
If excuting "select" in stored procedure

then this will work

SQL
SELECT  [VendorID], ISNULL(Convert(varchar(50), [PatientID]),'0') AS PatientIDFROM [dbo].[TBL_Vendor]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900