codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Dynamic Insertion  mca.mdebnath at 16:02 on Saturday, November 14, 2009
 

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..









CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Dynamic Insertion
•  Date and Time function around the world???
•  Significant Factors
•  Perl array access
•  Re: huffman encoding and decoding in C++...
•  Perl One Liner: Replace {(
•  Re: html including php, accessing the functions
•  Something like an INI editor or a DelimitedText-Editor
•  Error Deleting File or Folder


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2009