Steven,
I'm very sorry but I again need help of you and all other forum frnds regarding the same subject.I'm Trying to explain it as clearly as possible....
<pre> UI
|================================= |
| |||||||||||||||||||||<---(Emp_code TextBox) |
| ||||||||||||||||||||||<---(Emp_code TextBox) |
| etc. |
| ++++++++++++++++++++++ |
| + |||||<---(Prf_exp1 CheckBox) + <---(CheckBox List of ASP Controls)
| + |||||<---(Prf_exp2 CheckBox) + |
| + + + + + + + + + + + + + + + |
|================================= |
</pre>
just look at the image(assume as an image).
Here, the UI contains ,
3 Controls, 2 TextBoxes and 1 CheckBox list.It is just a sample part of the UI which I have tried to show to explain the problem.
Emp_code, Emp_name, Emp_salary etc.(All are in a table named "employees" in the database)
Emp_code,Prf_qualification is contained in a different table named "emp_prf_qualfn"
Now it is clearly visible that, for a single employee, there may be multiple professional qualifications....which are going to be selected from the "CheckBoxList"
Now when I'll press the "Insert" button the following steps sholud happen...
1) Connection will be built and opened with the DB ( working properly according to steven's article)
2) Stored Procedure Should be called.( working properly according to steven's article)
3) Now this store procedure will take values from that text box and checkbox list as the argument passed to it( working properly according to steven's article)
4) inside the Stored Procedure, there are 2 insert statement ( The Stored Procedure is mentioned by me in two posts back,to see just scroll up a bit).
a) one insert statement will take value from first two text boxes(all r controls are not showen,thats why specified 2 textboxes) and will keep inside "employees" table.
b) another insert statement will take one value from the textbox called "EMP_CODE" and other values from specified checkboxlist and will be entered to the "emp_prf_qualfn" table.something like following..
<pre>
Table1 :-
emp_code | emp_name | etc......
==========================
12 | XYZ |
11 | ABC |
Table 2 :-
emp_ code | prf_qualfn
====================
12 | prf_qualfn1
12 | prf_qualfn2
</pre>
5) So when the insert buton will be executed then all the datas should have to be entered into above explained manner.
Now initially, I tried with,
" cmd.Parameters.Add("Salary", OracleDbType.Decimal, SALARYTextBox.Text, ParameterDirection.Input); "
syntax to try to insert one row at atime and that was fine. One professional qualification was accepted and entered perfectly.
But to insert multiple row in one go when I followed Steven's article..I faced a problem...
i.e. My emp_code column will be always same , that will be used multiple time with multiple number of professional qualifications and those datas will be stored into the "emp_prof_qualfn" table. But it is not happening and throwing error "Integrity Constraint Violated: Primary Key not found" Error.Which logically should not happened 'cause in the first insert statement I have already insert the parent key value into the "employees" table....
I know this post is not only quite big , and may also seems messy...but please help in this issue...beacause this can solve all the issues which preventing me to develop an application.
Please kindly let me know if any other informations needed to understand the problem propose the solution....
please help your novice friend, just to make him your true friend in all aspect in future..
Please its really very urgent....
Thanks...