c# - Select datetime column from SQL Server 2008 R2 table -


i have datetime column on table in sql server 2008 r2 database. c# front end inserting row in table datetime parameter.

datetime t = datetime.now; cmd.commandtype = commandtype.storedprocedure; cmd.commandtext = "cargridsnapshot"; cmd.parameters.addwithvalue("@t", t); cmd.executenonquery(); 

the datetime column in row in table this:

2013-09-04 16:21:23.450 

but

select * table  timecolumn = '2013-09-04 16:21:23.450'  

returns no results.

sql server can represent datetime in variety of ways when comparing string database value. have month before day, day before month. localization of sql server causing issue; can read more here. specifically, set dateformat.


Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -