I have a simple web app , and want to save some numbers of Float or Double format in SQL server.
but there is a problem , when I try to save 123.66 , In Table I see
I think this is VS Problem not Sql server, Here i pass amount in string ("12.89") to stored procedure and find data save accurate 12.89
Change Float to string in Properties and Methods,procedure
Note
Example-
Public Float Amount { get; set; }
TO
Public String Amount { get; set; }
Public boolAdd(String amount)
{
//Your Logic Like
bool status = false;
DbParam[] param = new DbParam[1];
param[0] = new DbParam("@amount", "", "amount", SqlDbType.VarChar);
status = Db.Update(ds, "sp_Add", "", "", param, true);
return status;
}
Create Proc sp_Add
(
@amount varchar(20)
)
as
begin
Insert into Price(amount) values (@amount)
end