Click here to Skip to main content
16,005,120 members
Home / Discussions / C#
   

C#

 
Questionremovegroup, currently there is no ogroup object Pin
TAREQ F ABUZUHRI22-Jul-06 0:15
TAREQ F ABUZUHRI22-Jul-06 0:15 
QuestionGraphicsPath [modified] Pin
-Yoyosh-21-Jul-06 23:53
-Yoyosh-21-Jul-06 23:53 
AnswerRe: GraphicsPath Pin
mav.northwind22-Jul-06 6:42
mav.northwind22-Jul-06 6:42 
Questiondll comparison Pin
Ananthalvan21-Jul-06 23:20
Ananthalvan21-Jul-06 23:20 
AnswerRe: dll comparison Pin
Nader Elshehabi22-Jul-06 2:12
Nader Elshehabi22-Jul-06 2:12 
GeneralRe: dll comparison Pin
Ananthalvan25-Jul-06 4:46
Ananthalvan25-Jul-06 4:46 
GeneralRe: dll comparison Pin
Nader Elshehabi27-Jul-06 3:29
Nader Elshehabi27-Jul-06 3:29 
QuestionUrgent Help Required in Databindings [modified] Pin
Vinu M21-Jul-06 22:48
Vinu M21-Jul-06 22:48 
Dear Friends

I have an employee master form wiht having 5 tables. My requuirement is when the user opens the form, it must be the add new record mode. My problem is i can add new employee first time. After saving am reseting the dataset using clear(). After that when i add the next employee, it throws error saying the index out of range. This is when i refer the row[0] of the emp data adapter.

//*********** MY Reset script

dsEmp.Clear();
this.BindingContext[dsEmp, "HR_M_EMPLOYEE"].EndCurrentEdit();
this.BindingContext[dsEmp, "HR_M_EMPLOYEE"].AddNew();
this.BindingContext[dsEmp, "HR_M_EMP_EAR_DED_EAR"].EndCurrentEdit();
this.BindingContext[dsEmp, "HR_M_EMP_EAR_DED_EAR"].AddNew();
this.BindingContext[dsEmp, "HR_M_EMP_EAR_DED_DED"].EndCurrentEdit();
this.BindingContext[dsEmp, "HR_M_EMP_EAR_DED_DED"].AddNew();
this.BindingContext[dsEmp, "HR_M_EMP_DOCUMENTS"].EndCurrentEdit();
this.BindingContext[dsEmp, "HR_M_EMP_DOCUMENTS"].AddNew();
this.BindingContext[dsEmp, "HR_M_EMP_DEPENDENTS"].EndCurrentEdit();
this.BindingContext[dsEmp, "HR_M_EMP_DEPENDENTS"].AddNew();
this.BindingContext[dsEmp, "HR_M_EMP_QUALIFICATIONS"].EndCurrentEdit();
this.BindingContext[dsEmp, "HR_M_EMP_QUALIFICATIONS"].AddNew();
this.BindingContext[dsEmp, "HR_M_EMP_CERTIFICATION"].EndCurrentEdit();
this.BindingContext[dsEmp, "HR_M_EMP_CERTIFICATION"].AddNew();
this.BindingContext[dsEmp, "HR_M_EMP_EXPERIENCE"].EndCurrentEdit();
this.BindingContext[dsEmp, "HR_M_EMP_EXPERIENCE"].AddNew();
this.BindingContext[dsEmp, "HR_M_EMP_SKILLS"].EndCurrentEdit();
this.BindingContext[dsEmp, "HR_M_EMP_SKILLS"].AddNew();
this.BindingContext[dsEmp, "HR_M_EMPLOYEE_PHOTOS"].EndCurrentEdit();
this.BindingContext[dsEmp, "HR_M_EMPLOYEE_PHOTOS"].AddNew();
errEmpForm.Clear();

//*********** end of Reset script


When user save the employee, am setting some values to the hiden columns
Error is appearing here


this.BindingContext[dsEmp, "HR_M_EMPLOYEE"].EndCurrentEdit();
if (dsEmp.Tables["HR_M_EMPLOYEE"].Rows[0].RowState == DataRowState.Added)
{
dsEmp.Tables["HR_M_EMPLOYEE"].Rows[0]["N_COMP_CODE"] = GlobalMembers.gi_compcode.ToString();
dsEmp.Tables["HR_M_EMPLOYEE"].Rows[0]["N_USER_CODE"] = GlobalMembers.gi_usercode.ToString();
dsEmp.Tables["HR_M_EMPLOYEE"].Rows[0]["D_MODTIME"] = DateTime.Now.ToString();
}

What i need is after saving the employee, the form must be Add new record mode.

How can i achieve this. Am sure that am wrong somewhere. I dont know how can i do this. Even though am calling the AddNew using the binding contect, the new record is not reflecting.

I need help. If reuired the complete script i can send that also, it is very very big.
Plsss help meeee, i have the deadling next week.

Vinu M

QuestionVideo Play Out(Please Help Me Urgent) Pin
shakil ahmed21-Jul-06 21:05
shakil ahmed21-Jul-06 21:05 
QuestionDrag Drop from ListView to Explorer Pin
fperugini21-Jul-06 13:36
fperugini21-Jul-06 13:36 
AnswerRe: Drag Drop from ListView to Explorer Pin
fperugini22-Jul-06 4:13
fperugini22-Jul-06 4:13 
GeneralRe: Drag Drop from ListView to Explorer Pin
Judah Gabriel Himango22-Jul-06 6:42
sponsorJudah Gabriel Himango22-Jul-06 6:42 
AnswerRe: Drag Drop from ListView to Explorer Pin
fperugini22-Jul-06 8:26
fperugini22-Jul-06 8:26 
GeneralRe: Drag Drop from ListView to Explorer Pin
Judah Gabriel Himango22-Jul-06 12:12
sponsorJudah Gabriel Himango22-Jul-06 12:12 
Question1st chance exceptions in VS 2005 Pin
Ami Bar21-Jul-06 11:07
Ami Bar21-Jul-06 11:07 
AnswerRe: 1st chance exceptions in VS 2005 Pin
Nader Elshehabi22-Jul-06 2:09
Nader Elshehabi22-Jul-06 2:09 
GeneralRe: 1st chance exceptions in VS 2005 Pin
Ami Bar22-Jul-06 4:45
Ami Bar22-Jul-06 4:45 
GeneralRe: 1st chance exceptions in VS 2005 Pin
Nader Elshehabi22-Jul-06 8:05
Nader Elshehabi22-Jul-06 8:05 
GeneralRe: 1st chance exceptions in VS 2005 Pin
Ami Bar22-Jul-06 9:08
Ami Bar22-Jul-06 9:08 
GeneralRe: 1st chance exceptions in VS 2005 Pin
Nader Elshehabi22-Jul-06 10:52
Nader Elshehabi22-Jul-06 10:52 
Questioncompiler details Pin
waheed awan21-Jul-06 10:57
waheed awan21-Jul-06 10:57 
AnswerRe: compiler details Pin
Ed.Poore21-Jul-06 12:14
Ed.Poore21-Jul-06 12:14 
GeneralRe: compiler details Pin
Paul Conrad21-Jul-06 12:22
professionalPaul Conrad21-Jul-06 12:22 
AnswerRe: compiler details Pin
BoneSoft22-Jul-06 5:55
BoneSoft22-Jul-06 5:55 
QuestionRich text box Pin
waheed awan21-Jul-06 10:42
waheed awan21-Jul-06 10:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.