yasser777 / nettiers

Automatically exported from code.google.com/p/nettiers
0 stars 0 forks source link

Issue with DbType instead of SqlDbType while adding a parameter to the command #130

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. I am using Sql server 2008 express and .net 3.5 sp1,codesmith 5.0 and 
nettiers 2.3 beta
2. I have a column called 'JoinTime' of type 'Time' in sql server 2008 
express and i generated the c# components. I tried to insert a row in 
database using the generated components. 
3.  It is throwing an exception 'Failed to convert parameter value from a 
TimeSpan to a DateTime'
4. if changed the next 'a' statement to 'b' statemtnt it worked.

a. database.AddInParameter(commandWrapper, "@JoinTime", DbType.Time, 
(entity.JoinTime.HasValue ? (object) entity.JoinTime  : 
System.DBNull.Value));

b. database.AddInParameter(commandWrapper, "@JoinTime", SqlDbType.Time, 
(entity.JoinTime.HasValue ? (object) entity.JoinTime  : 
System.DBNull.Value));

DbType.Time is the problem. 
i think it has to be SqlDbType.Time

Original issue reported on code.google.com by schinni....@gmail.com on 24 Nov 2008 at 5:28

GoogleCodeExporter commented 9 years ago
What version of CodeSmith are you using? Have you reset your samples and mapping
files? This should return System.DateTime.

Original comment by bniemyjski on 30 Nov 2008 at 12:25

GoogleCodeExporter commented 9 years ago

Original comment by bniemyjski on 30 Nov 2008 at 4:48

GoogleCodeExporter commented 9 years ago
Am using CodeSmith 5.0 trial and NetTiers 2.3 beta. and What does meant by 
'reset 
your samples and mapping
files?'

Original comment by schinni....@gmail.com on 1 Dec 2008 at 3:56

GoogleCodeExporter commented 9 years ago
Hello,

Please upgrade to .netTiers 2.3 beta 2
(http://windowscoding.com/blogs/blake/archive/2008/11/30/nettiers-2-3-0-beta-2.a
spx)
as well as here is the documentation about resetting the sample templates
(http://windowscoding.com/blogs/blake/archive/2008/04/30/tips-amp-tricks-resetti
ng-the-codesmith-sample-templates.aspx).

-Blake

Original comment by bniemyjski on 1 Dec 2008 at 1:12

GoogleCodeExporter commented 9 years ago
following thin techs am using 
1. Codesmith 5.0.3
2. NetTiers 2.3. beta 2
3. Vs 2008 sp1 (component generated language c#)
4. Sql server 2008 express

as u said I set the codesmith samples and maps in my system
but same problem

thank u 
Sree

Original comment by schinni....@gmail.com on 3 Dec 2008 at 5:55

GoogleCodeExporter commented 9 years ago
We are going to release CodeSmith 5.0.4 sometime this coming week. I have went 
ahead
and completely went through the mapping files...

If you could check this out, by getting latest here
(http://code.google.com/p/codesmith/source/checkout) and overriding your mapping
files that are in your my documents folder with these. and try again that would 
be
awesome. If that doesn't work please attach your SQL schema and I'll try to 
reproduce
here.

Original comment by bniemyjski on 8 Dec 2008 at 1:00

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Database: Sql server 2008 Express
Table : Employee
Columns:

EmpID int,
EmpName varchar(20),
JoinDate date,
JoinTime time,
DeptID int

i am getting error stated that 'Failed to convert datetime to timespan' on 
inserting and updating of JoinTime column
Thanks 
sree.

Original comment by schinni....@gmail.com on 9 Dec 2008 at 5:59

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Hello,

Please try reproducing this with CodeSmith 5.1 and .netTiers 2.3 RTM.

Thanks
-Blake

Original comment by bniemyjski on 25 May 2009 at 3:14

GoogleCodeExporter commented 9 years ago

Original comment by bniemyjski on 25 May 2009 at 3:30