Results 1 to 5 of 5

Thread: Insert Random data from Textbox.

  1. #1

    Thread Starter
    Hyperactive Member Ram2Curious's Avatar
    Join Date
    Apr 2010
    Posts
    484

    Insert Random data from Textbox.

    Hi,

    I am using Oracle 8i as backend....

    I have 1 combobox and 6 textboxes on a form, so if i select 1 in combobox then a single textbox is filled, 2 then 2 textboxes are filled with data, 3,4 and so on.....

    Now i would like to know how to insert this sort of a random data from 6 textboxes(based on selection of digit in combobox) into the Table...?

    Please help me......

    Thank you....

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Insert Random data from Textbox.

    There's no way we can answer that based on the information you've given us. We don't know what language you're coding in for a start, now do we know what the table looks like that you're inserting the data into.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Hyperactive Member Ram2Curious's Avatar
    Join Date
    Apr 2010
    Posts
    484

    Re: Insert Random data from Textbox.

    Ok i ll make it simple...

    a) 1 combobox ( Has list of digits from 1 to 6 loaded using AddItem method)

    b) 6 textboxes

    On Click event of Combobox i have coded like....

    vb Code:
    1. If cboSem_no.ListIndex = 0 Then
    2.     txtSem_name1.Text = "I-Semester"
    3. Else
    4.     If cboSem_no.ListIndex = 1 Then
    5.     txtSem_name1.Text = "II-Semester"
    6.     end if
    7. end if

    and so on till 6 semesters......

    So if 2 digit is selected from combobox then 2 textboxes will be loaded( names of semester)....

    The problem is about to use the SQL INSERT INTO (Oracle8i) statement without inserting NULL values from the remaining textboxes(if No. of Semesters selected are less than 6).

    Thank you....

  4. #4
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    Re: Insert Random data from Textbox.

    If this is related to your other thread aqnd order of insert is important then consider creating a package with subprograms that will do the insert. Overload subprogram to accept varying number of parameters (each in turn will just call subprogram with less number of parameters). Something like.
    Code:
    pkg.sample (x, y, z)
    as
    begin
      /* do insert of x and y */
       pkg.sample (x, y);
       /* then do insert of z */
       pkg.sample (z);
    end

    Otherwise, if you going to do it at the front-end you will have to define the queries there since data needs to be pivoted (or rather unpivoted) before insert.
    Last edited by leinad31; Jul 20th, 2010 at 01:21 AM.

  5. #5

    Thread Starter
    Hyperactive Member Ram2Curious's Avatar
    Join Date
    Apr 2010
    Posts
    484

    Re: Insert Random data from Textbox.

    Thanks leinad.....I ll try to implement your idea......

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width