s
Contact Login Register
h M

Data Springs Modules Community Questions & Answers

Forms not working with SQL Datatype

Hi, I'm having issues with DynamicForms and datatypes in SQL. In my form I have multiple textbox fields where the user enters numbers. In my database table I have the corresponding columns' data types set as decimal(5,2) but the form won't store its values to the database. 

However, when I change those datatypes to nvarchar, the form submits just fine and the information is stored in the database. 

The weird part is that the form submits fine if I change only one of the columns back to a decimal datatype. But if I change any of the other columns, the form won't store its values to the database.

I need for these fields to be a numeric type because I have calculation that need to done with their values.  

Is there anyway to solve this issue?
asked 6/19/2014
23

1 Answer

This answer has been selected by the question author as the best answer. Hello,

I would always recommend storing data as nvarchar if you have the choice. Unless it's a date, identity column, etc...

So perhaps you can do a quick conversion on your token when injecting into your SQL table.

------------------------------------------------

INSERT INTO TABLE
(
COLUMN1,
...
...
)
VALUES
(
Convert(varchar,cast('$(VALUE1)' as money),1),
...
...
)

------------------------------------------------


Let me know if this assists you in storing the data.

-Ryan
answered 6/20/2014 Rbakerink 160
Rbakerink
  • Thank you so much! This solution worked perfectly! - 6/20/2014

  • But now I have another problem now. The values that I did a conversion on cause the form to NOT to submit to the database when their fields in the from are left blank. However, If I add values to these fields in the form, the form submits it's values to the database just fine. - 6/20/2014

Your Answer

In order to provide an answer to this question, you must Login

I am flagging this question because...




10 inform moderator flags remaining

I am deleting this question because...




I am flagging this answer because...




10 inform moderator flags remaining

Flagging a Post

You have already flagged this post. Clicking "Remove Flag" below will remove your flag, thus reducing the count by one as well.

I am deleting this answer because...




Enter your email below AND grab your spot in our big giveaway!

The winner will receive the entire Data Springs Collection 7.0 - Designed to get your website up and running like a DNN superhero (spandex not included).

  
Subscribe
united luxury shop
konulu porno
deneme bonusu maltcasino bahis siteleri
sex video free download in mobile hot sexy naked indian girls download free xxx video
atasehir eskort antalya escort bahcelievler escort alanya escort atasehir escort
porno izle
gaziantep escort gaziantep escort
escort pendik
buca escort
izmir escort bayan
vdcasino casino metropol casinomaxi
buca escort
izmir escort
baybahis
holiganbet