|
this is the sender
sender {DevExpress.Web.ASPxUploadControl.ASPxUploadControl} object {DevExpress.Web.ASPxUploadControl.ASPxUploadControl}
|
|
|
|
|
Yes, but it's the container that is getting null - the sender can't be null as it's the class instance that raised the event.
Use the debugger!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
I am, Im a DBA so I dont know much about this, long story short we hired a programmer and he jump ship on us, so my boss ask me to fix it. I bought Dev express used project converter 14.1. I fixed all the database stuff and i lil code things. th is the last part I need to get working. How should i use the debug it just breaks at the same line>
|
|
|
|
|
It's really easy to do, but it takes a lot of explaining to find the simple way (one click!) if you can't see the screen.
So, we'll do it the slow way, and that'll show you the quick way.
Look at the source, and click on the line you want the breakpoint on:
GridViewDetailRowTemplateContainer container = ((Control)sender).NamingContainer as GridViewDetailRowTemplateContainer;
Look on the menu bar, under "Debug" - select "Toggle Breakpoint" (and it probably has a short cut key, most likely F9, but it doesn't have to be) and look at what happenes to the left hand side of the source code line you clicked on. See the "Red Dot"? That's a breakpoint, and the debugger will stop immediately before it executes that line. Click on the dot, and it goes away.
Now click on where the dot was, and it comes back - that's the quickest way to set or remove a breakpoint: just click on that vertical column, and it'll toggle a breakpoint there.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
I understand that, my issue is when i breaks what am I looking for?
|
|
|
|
|
Start by looking at sender - what type is it? Which control is it?
Then look at it's NamingContainer is it a GridViewDetailRowTemplateContainer?
If it isn't, then the end result will be null - and you need to look at exactly what it is to find out what the as part should be.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
it is a GridViewDetailRowTemplateContainer
|
|
|
|
|
The sender is not a Control so you get a null value. Inspect the content of the sender object and match the type in your boxing.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Are you sure Mycroft? If sender is not a control, but is not null then the (Control) cast will give an InvalidCastException rather than return a null value.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
I'm pretty sure, I'd have to test it but I seem to remember the tedious null checking I have to do every time I try to unbox from a UI/sender to a type in WPF.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I tried the code but when a click the button, it
displays an error that Index and length must
refer to a location within the string. Parameter
name: length
|
|
|
|
|
We can't see your screen, access your hard-drive, or read your mind.
Edit your question to post the relevant code and the exact error message, and to indicate the line in the code which produces the error.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Without your code, we can't help: but that kind of error normally comes from an SQL Substring function - so start by looking at your queries and stored procedures, and the data you are passing to them.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
I put an xml file with a structure like this
<list>
<person>
<name>Micky Mouse</name>
<phone>
<phone1>1111111</phone1>
<phone2>2222222</phone2>
</phone>
</person>
<person>
<name>Donald Duck</name>
<phone>
<phone1>3333333</phone1>
</phone>
</person>
<person>
<name>Pluto</name>
<phone>
</phone>
</person>
<person>
<name>Goofy</name>
<phone>
<phone1>5555555</phone1>
<phone2>6666666</phone2>
<phone3>7777777</phone3>
</phone>
</person>
.....
.....
.....
</list>
into a dataset and then I try to load the dataset into a list. The problem is there are 2 root tables (person and phone) in the main table (list) and I am not sure how to loop through the dataset to fill my list (List<Person> ListP = new List<Person>())
so that the the content of each would match the correct parts.
Example
ListP[0] would contain Micky Mouse, 1111111, 2222222,
ListP[1] would contain Donald Duck 333333
ListP[2] would contain Pluto
ListP[3] would contain Goofy 5555555, 6666666, 7777777
… ect
Thanks for any help
modified 18-Dec-14 4:31am.
|
|
|
|
|
According to the input you don't have two root tables. Phone is a nested table of person. Your Person object should look like this.
class Person
{
String Name;
List<String> Phone;
}
If you can influence how the list is generated, you should probably get the naming of the phone tags changed into something like this:
<phones>
<phone>11111</phone>
<phone>22222</phone>
</phones>
That would make parsing the list easier, as you wouldn't have all these differently names tags.
The good thing about pessimism is, that you are always either right or pleasently surprised.
|
|
|
|
|
I don't know why I wrote "root" tables. I meant 2 tables (person and phone) and that is what I don't know how to loop through properly and put there content into my list (List<person> ListP = new List<person>()).
I will try that change you wrote.
|
|
|
|
|
To add to what Freak30 has said I would also have a look at this
XML Serialization and Deserialization: Part-1[^]
It will save you half the work on firstly importing it to a dataset and then to a list.
Every day, thousands of innocent plants are killed by vegetarians.
Help end the violence EAT BACON
|
|
|
|
|
In WPF I have 3 calls to the database and a process that requires the results of these 3 call to complete. Currently I chain the calls and then call the processing method.
If I used an array of 3 tasks and initiating the processing method after Task.AwaitAll, would this achieve the same result as the chaining.
I know I can test this but I'm still reading and trying to relate this to actual issues.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
It depends, but since you haven't shown your code that sets up the Tasks, it's pretty much just a guess at what you're really doing.
But, if none of the Tasks are waiting on each other, then all the Tasks will execute separately and at the same time. Task.WaitAll() will wait for all of the Tasks to complete.
|
|
|
|
|
I did not have any code to show as I was still reading the docs, just trying to relate to an actual issue I have.
Dave Kreskowiak wrote: Task.WaitAll() will wait for all of the Tasks to complete So I tried this with asynch Silverlight calls to the wcf
It had a number of issues around INotifyPropertyChanged which was used in the called process so I need to do some more reading and work out the best way to implement it.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I use it in an a lot of places in my database access...
The only thing is important that the 3 calls must have to be unrelated...
Otherwise it can be a very good way to improve performance...
Skipper: We'll fix it.
Alex: Fix it? How you gonna fix this?
Skipper: Grit, spit and a whole lotta duct tape.
|
|
|
|
|
Kornfeld Eliyahu Peter wrote: The only thing is important that the 3 calls must have to be unrelated Define unrelated, I would expect to use it where I have multiple selects when opening a view but would never use it when inserting/updating multiple records.
The selects would be on different but related tables I don't see this as a problem.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
In this context unrelated means that the outcome of one call does not effect the others...Which you say no...
Skipper: We'll fix it.
Alex: Fix it? How you gonna fix this?
Skipper: Grit, spit and a whole lotta duct tape.
|
|
|
|
|
As I understand your post, currently you have 3 awaitable calls which you are chaining to execute one after another in your processing method and awaiting the processing method.
If my understanding is correct, I think the array of tasks with Task.WaitAll() should perform better.
And I think you meant Task.WaitAll().
Your time will come, if you let it be right.
|
|
|
|
|
You are correct, for some reason I have Await stuck in my head and that is what comes out the fingers - then I get annoyed with intellisense when it does not know what I want.
Never underestimate the power of human stupidity
RAH
|
|
|
|