Click here to Skip to main content
15,899,937 members
Home / Discussions / C#
   

C#

 
AnswerRe: Opening an application on remote machine .... Pin
Dave Kreskowiak1-Mar-07 6:39
mveDave Kreskowiak1-Mar-07 6:39 
QuestionForm holding Pin
hiremath711-Mar-07 2:23
hiremath711-Mar-07 2:23 
AnswerRe: Form holding Pin
Obaid ur Rehman1-Mar-07 2:31
Obaid ur Rehman1-Mar-07 2:31 
AnswerRe: Form holding Pin
Stefan Troschuetz1-Mar-07 2:32
Stefan Troschuetz1-Mar-07 2:32 
QuestionGetting the screen resolution Pin
Icarus1231-Mar-07 2:09
Icarus1231-Mar-07 2:09 
AnswerRe: Getting the screen resolution Pin
Stefan Troschuetz1-Mar-07 2:29
Stefan Troschuetz1-Mar-07 2:29 
AnswerRe: Getting the screen resolution Pin
Scott Dorman1-Mar-07 16:07
professionalScott Dorman1-Mar-07 16:07 
Questionread from file Pin
shereem khaleel1-Mar-07 1:56
shereem khaleel1-Mar-07 1:56 
AnswerRe: read from file Pin
Colin Angus Mackay1-Mar-07 2:03
Colin Angus Mackay1-Mar-07 2:03 
QuestionQuerry regarding DirListBox control Pin
s_123451-Mar-07 1:34
s_123451-Mar-07 1:34 
QuestionEvents in an interface Pin
jdkulkarni1-Mar-07 1:10
jdkulkarni1-Mar-07 1:10 
AnswerRe: Events in an interface Pin
Stefan Troschuetz1-Mar-07 2:36
Stefan Troschuetz1-Mar-07 2:36 
GeneralRe: Events in an interface Pin
jdkulkarni1-Mar-07 4:50
jdkulkarni1-Mar-07 4:50 
GeneralRe: Events in an interface Pin
Stefan Troschuetz1-Mar-07 5:07
Stefan Troschuetz1-Mar-07 5:07 
QuestionPopUp Block Detection Pin
babutkchn1-Mar-07 0:36
babutkchn1-Mar-07 0:36 
Questionxml Pin
md_refay1-Mar-07 0:30
md_refay1-Mar-07 0:30 
AnswerRe: xml Pin
Stefan Troschuetz1-Mar-07 0:48
Stefan Troschuetz1-Mar-07 0:48 
Questiondimension array Pin
md_refay1-Mar-07 0:27
md_refay1-Mar-07 0:27 
AnswerRe: dimension array Pin
Martin#1-Mar-07 0:32
Martin#1-Mar-07 0:32 
QuestionBest way of generating a lookup table Pin
mail5723521-Mar-07 0:13
mail5723521-Mar-07 0:13 
AnswerRe: Best way of generating a lookup table Pin
Stefan Troschuetz1-Mar-07 0:47
Stefan Troschuetz1-Mar-07 0:47 
AnswerRe: Best way of generating a lookup table Pin
thowra1-Mar-07 22:29
thowra1-Mar-07 22:29 
QuestionReturning values Pin
scotlandc1-Mar-07 0:11
scotlandc1-Mar-07 0:11 
Hi,

I hope someone can help.

I have to import some data from a text file into a database. The text files are loaded into a datagrid to be previewed and validated before being imported.

There are some conditions to the import, each child record must have a pre-existing parent record before it will be imported etc. The validation is handled in a stored procedure.

What I need to do is return all of the values that have failed to import in a collection.

public ItemEventCollection failures = null;
...
public ItemEventCollection EventImport(SecurityContext sc, ItemEventCollection EventCollection)
{
if (EventCollection != null)
{

foreach (ItemEvent itemEvent in EventCollection)
{
try
{
ItemEventInsertCommand.Execute(DataAccessManager(sc), itemEvent);
}

catch
{
failures.Add(ItemEvent);
}

}
}

return failures;

}


If I step through the code, failures always has a count of 0 when I know there are rows failing the import conditions. I need to add them to failures then pass it back to a datagrid.

How?

Do I use the out keyword or simply return the ItemEventCollection, I'm really stumped on this one, please can someone help?

Best regards

Scott Wink | ;)


Questionasp.net for google map Pin
Member 387693428-Feb-07 23:37
Member 387693428-Feb-07 23:37 
Questionhow to check if object exists? Pin
arkiboys28-Feb-07 23:30
arkiboys28-Feb-07 23:30 

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.