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
Poppa Wallace
NA
189
24.2k
Datagridview to MYSQL, think int is my problem
Nov 28 2016 5:55 AM
Can I get a little help with my insert statement. This is going to MYSQL. PageNumber and SlotPosition are both (int) which is why I think its failing.
But if I do
+ Convert.ToInt32(dataGridView2.Rows[i].Cells["PageNumber"].Value) + "','"
the other fields become Null.
String cmdText = "INSERT INTO merchantitem (MerchantItem_ID, ItemListID, ItemTemplateID, PageNumber, SlotPosition) VALUES ('"
+ dataGridView2.Rows[i].Cells["MerchantItem_ID"].Value + "','"
+ dataGridView2.Rows[i].Cells["ItemListID"].Value + "','"
+ dataGridView2.Rows[i].Cells["ItemTemplateID"].Value + "','"
+ dataGridView2.Rows[i].Cells["PageNumber"].Value + "','"
+ dataGridView2.Rows[i].Cells["SlotPosition"].Value + "')";
MySqlCommand cmd = new MySqlCommand(cmdText, constr);
cmd.ExecuteNonQuery();
Reply
Answers (
1
)
how to retraive gridview data into another webpage textbox
how to add other domain script tags to asp.net 4.0.