Click here to Skip to main content
15,886,689 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a querry:

C#
string query = Insert into IndividualTestSkills  Select TestID,TestName,  Date.now  from ALTest.ALBulkTestMaster where  TestID= + m_obj.NewTestID.ToString() ++ "'"; 



Showing the multi-part: identifier Date.now could not be found.
Posted
Updated 18-Jan-16 3:01am
v2
Comments
F-ES Sitecore 18-Jan-16 8:48am    
Did you mean "DateTime.Now"?
Member 11970398 18-Jan-16 8:57am    
yeah out of bound errrror

1 solution

If you're in SQL Server try "getdate()"

C#
string query = Insert into IndividualTestSkills Select TestID,TestName, getdate() from ALTest.ALBulkTestMaster where TestID= + m_obj.NewTestID.ToString() ++ "'"; 
 
Share this answer
 
Comments
Member 11970398 18-Jan-16 12:55pm    
getdata is a function in SQL server i am writing this query in visual studio
snorkie 18-Jan-16 14:10pm    
Yes, when you pass the query string into SQL server, it will recognize the SQL function and run it.

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