TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Israel
634
1.3k
219.8k
How to save decimal into a column
Aug 10 2016 12:04 PM
Hi!
I need to save number as decimal in my "amount" column. How can I do it please. I inform that the type of my column is currency.
See my codes:
conn.Open();
OleDbCommand comm = new OleDbCommand();
comm.Connection = conn;
connstr = "SELECT COUNT(*) FROM Test WHERE [Dat] = @dat";
comm.CommandText = connstr;
comm.Parameters.Clear();
comm.Parameters.AddWithValue("@dat", data.Value);
int numRecords = (int)comm.ExecuteScalar();
if (numRecords == 0)
{
//connstr = "INSERT INTO Test([dat],[amount])VALUES(@date,@amount)";
comm.CommandText = connstr;
comm.Parameters.Clear();
comm.Parameters.AddWithValue("@dat", date.Value);
comm.Parameters.AddWithValue("@amount", txtAmount.Text);
if (MessageBox.Show("Are you sure to save?", "Janela de gravação", MessageBoxButtons.YesNo) == DialogResult.Yes)
comm.ExecuteNonQuery();
}
else
{
MessageBox.Show("There no product", dtFluxoCaixa.Text);
}
conn.Close();
Reply
Answers (
2
)
wt is difference between session state,view state,appl state
What is MEF Concept?