Link to home
Start Free TrialLog in
Avatar of zhshqzyc
zhshqzyc

asked on

Syntax error near coalesce

Thanks for help.
cmd.CommandText = "update dbo.User_Info SET COALESCE(@FirstName, FirstName),COALESCE(@LastName,LastName),COALESCE(@Degree,Degree),COALESCE(@Organization,Organization),COALESCE(@Phone,Phone),COALESCE(@Ext,Ext) where UserName =@username";
            cmd.Parameters.Add("FirstName", SqlDbType.VarChar).Value = TextFirstName.Text;
            cmd.Parameters.Add("LastName", SqlDbType.VarChar).Value = TextLastName.Text;
            cmd.Parameters.Add("Degree", SqlDbType.VarChar).Value = TextDegree.Text;
            cmd.Parameters.Add("Organization", SqlDbType.VarChar).Value = TextOrg.Text;
            cmd.Parameters.Add("Phone", SqlDbType.VarChar).Value = TextPhone.Text;
            cmd.Parameters.Add("Ext", SqlDbType.VarChar).Value = TextExt.Text; 

Open in new window

SOLUTION
Avatar of tim_cs
tim_cs
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Jim Horn
Jim Horn
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial