February 20, 2014 at 11:27 pm
when we update detetime column with string value in c# which is given
update Add_Flight set Date_of_Travel='"+Label3.Text+"'
then error given as
doesnot match datatype
any one help me
February 20, 2014 at 11:53 pm
The most likely for that is Label3.Text has a value that is not a DateTime value.
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
February 21, 2014 at 12:18 am
Step 1, parameterise that query
Step 2, read up on the .NET parameters collection and use it.
Step 3, read up on all the horrors of SQL injection attacks that you've now removed the risk of by doing 1 and 2.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
February 21, 2014 at 4:38 am
SQL Injection
It's not a good thing. You are absolutely making it possible with that code. Please stop and tell all your friends.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
February 21, 2014 at 7:55 am
Kind of necessary to share :hehe:
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
February 24, 2014 at 4:02 am
1)Check datatype of text
2)Remove quotes("")
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply