|
Here is a code project in asp.net.
i have to insert dynamically create rows in a table name : [Pin_Generate]
The number of rows are inserted by the user and then submit and it create that number of rows in that table.
But it cannot be done when its going 2nd time in a loop...
for (i = 1; i <= Convert.ToInt32(EnterByUserTextBox.Text); i++)
{
scomm1.Parameters.AddWithValue("@pid_no", lblprint_id.Text);
scomm1.Parameters.AddWithValue("@pserial_no", lblserial_no.Text);
scomm1.Parameters.AddWithValue("@ppassword", lblpassword.Text);
sconn1.Open();
int x = 0;
x=scomm1.ExecuteNonQuery(); // when i=2, the error occurs here.
sconn1.Close();
if (x > 0)
{
lblmsg.Text = "Successfully Created";
update();
}
else
{
lblmsg.Text = "Please Try Again";
}
}
Plz help me out.... its very urgent..
|
|
|
|
|
|
|
|