Help with SQL CAST / Conver function

16 views
Skip to first unread message

Pavan Jaju

unread,
Dec 30, 2014, 4:53:02 AM12/30/14
to simpl...@googlegroups.com
Hi Mark,

I might be asking a silly question, but I somewhere in my code I came across a situation where I need to compare a string column with numeric user input value. For this, sql have functions to cast/convert string to number, but so far I am not able to replicate similar behavior. Can you please guide me with this.

Thanks a lot in advance.

Sunny

unread,
Jan 6, 2015, 12:05:57 PM1/6/15
to simpl...@googlegroups.com
Doesn't .Where(db.MyTable.MyColumn == userInput.ToString()) work?

--
You received this message because you are subscribed to the Google Groups "Simple.Data" group.
To unsubscribe from this group and stop receiving emails from it, send an email to simpledata+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Svetoslav Milenov (Sunny)

Artificial Intelligence is no match for natural stupidity.

Mark Rendle

unread,
Jan 6, 2015, 5:30:37 PM1/6/15
to simpl...@googlegroups.com
Indeed, it is easier to convert the number to a string in .NET code than the string to a number in SQL.

Sent from Acompli

Reply all
Reply to author
Forward
0 new messages