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
shyam kumar
NA
8
682
INSERT QTY IN DATABASE 1 BY 1 PCS
Feb 21 2018 7:19 AM
//purchaseitem barcode
for (int i = 0; i < dataGridView1.Rows.Count; i++)
{
string stck = "INSERT INTO stock (isissue)" + "VALUES (@quantity)";
cmd = new OleDbCommand(stck, con);
cmd.Parameters.AddWithValue("quantity", dataGridView1.Rows[i].Cells[9].Value.ToString());
for (int q = 0; q <= int.Parse(dataGridView1.Rows[0].Cells[9].Value.ToString()); q++)
try
{
con.Open();
cmd.ExecuteNonQuery();
{
clear();
}
MessageBox.Show("Saved Successfully");
con.Close();
}
catch (Exception X)
{
MessageBox.Show(this, "Error" + X, "Stop", MessageBoxButtons.OK, MessageBoxIcon.Stop);
}
}
}
( I HAVE TRIED THIS CODE IN C# BUT THIS CODE INSERT THE DATA BY QTY CELL VALUE
LIKE QTY CELL VALUE = 5 , THEN THIS CODE INSERT THE DATA 5 VALUE 5 TIMES
I WANT CODE TO INSERT DATA 1 VALUE TO 5 TIMES TO CREATE BARCODE
Reply
Answers (
2
)
Visual studio shortcut key for xml comment in C#
How can I change the IP of clients connected to one network?