Click here to Skip to main content
15,900,907 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
SQL
insert into VersionLog_Details( Ref_UserID, Server_Name, Database_Name, Object_Type, Object_Name, Comment, Changes_Date,Object_Code)values('4','VOI_05\SQLEXPRESS','abc','Procedure','ra','sczcszcfsdfsdfsd, mksdgmklldsfgkjfgkjkf 'Hii How are You','1/30/2015 2:12:31 PM','CREATE procedure ra
(
 @EmpID int
 )
   as
   begin
Insert Into MyEmployees values('s','s','','','','')
    end


    select * from MyEmployees')
Posted
Comments
VishwaKL 30-Jan-15 4:18am    
Check that string ending format closed properly or not. I observed your code after the 'ra' some sting missing closing quote that's why your 'Hii How are you string not looking in red color. close that string it will work
Rahulgupta.hanu 30-Jan-15 4:41am    
Multiple Single Quote issue in this code How to resolve.

1 solution

try..
C#
insert into VersionLog_Details( Ref_UserID, Server_Name, Database_Name, Object_Type, Object_Name, Comment, Changes_Date,Object_Code) values(
@Ref_UserID,
@Server_Name,
@Database_Name,
@Object_Type,
@Object_Name,
@Comment,
@Changes_Date,
@Object_Code
)

command.Parameters.AddWithValue("@Ref_UserID", '4');
command.Parameters.AddWithValue("@Server_Name", 'VOI_05\SQLEXPRESS');
.
.
.
.
string strCmnts="Hii How are You";
command.Parameters.AddWithValue("@Comment", strCmnts);
command.Parameters.AddWithValue("@Changes_Date", '1/30/2015 2:12:31 PM');

srtring strSp=@"CREATE procedure ra
(
 @EmpID int
 )
   as
   begin
Insert Into MyEmployees values('s','s','','','','')
    end
 

    select * from MyEmployees')";
command.Parameters.AddWithValue("@Object_Code", strSp);


ref.
https://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.parameters(v=vs.110).aspx[^]
 
Share this answer
 
Comments
Rahulgupta.hanu 31-Jan-15 7:58am    
Thanks..

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