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
alaa
NA
166
85.2k
field type change in insert
Apr 29 2015 2:42 AM
hi everyone i have database access where i have atable which gets its data from gridview 3 of field are number and accept double when i pass value the fields type get change into text
whats the wrong that make happen this is my code
public void Addrep(string ReName, double Reprice, double Retotal, double Recount)
{
String str = " INSERT INTO Report ( Re_Name, Re_price, Re_total, Re_count ) values ('" + ReName + "','" + Reprice + "','" + Retotal + "','" + Recount + "' )";
OpenCnn();
//3- Open command option - cnn parameter is imporant
OleDbCommand cmd = new OleDbCommand(str, cnn);
cmd.ExecuteNonQuery();
//5 close connection
CloseCnn();
}
if (RowsCount != 0 || RowsCount != null)
{
repo.DeleteRe();
for (int i = 0; i < RowsCount; i++)
{
//this.dgvsell.Rows[i].Cells[2].Value.ToString()
repo.Insert(this.dgvsell[2, i].Value.ToString(),
Convert.ToDouble(dgvsell[4, i].Value),
Convert.ToDouble(dgvsell[5, i].Value),
Convert.ToDouble(dgvsell[6, i].Value));
}
}
and my fields are Re_Name text, Re_price double, Re_total double, Re_count number
in insert it changed automatically into
Re_Name text, Re_price text, Re_total text, Re_count text what is the best soulation for that problem
Reply
Answers (
2
)
Hi can anyone help me with the codes for bank cheque print?
How to display Doc or pdf file in datalist button