Morris Neuman
5/16/2008 1:59:00 AM
Wen
Since I suspected my default Fill() the cause ( since I modified it to take
a parameter), I went back to my project and deleted the MBDetails data set
and rectreated it but this time I left the default Fill() query as is with no
parameters vs before when I had added @BoxNumber so it was Fill(Dataset,
Boxnumber) in order to satify the Where Boxnumber=@Boxnumber clause of the
Select Query).
Then I created a second Select Query (with the Designer) and that one was
called FillByBoxNumber(Dataset, BoxNmuber). I used this second select query
to retrieve the desired record in the Form_Load() and RowEnter/Add() event
handler. And that worked and then the Updates started working.
So I am guessing that altering the default Fill to take a parameter for a
Where clause and then telling the Wizard to generate the Update quiries was
the problem. But now the Updates are working. I could try to recreate the
problem and send that to you if you want? I did not go back to confirm my
theory.
But alteast my Updates work and want to thank you for your assistance and
guidance which were critical to me working it out here.
I have 3 more ques. but I understand they should be new postings, but I ask
them here so you can answer or tell which is the best group for them to be
posted in.
1. Is there a utility which can display/trace the stack of windows message /
events that are sent to my forms for debugging purposes?
2. I see that when I enter a new value in the bindingNavigatorPositionItem
field and hit Enter I do not get an bindingNavigatorPositionItemTextChanged
event Only when I click on another field does that event get sent. What event
do I need to handle the user hitting Enter after changing the field value?
3. What is the best pratice for having the bindingNavigatorMoveNextItem,
Previous, First, and LastItem Events all perform the same function. Should
I define each button's EventHandler to perfom the same Fill () statement or
Define the same EventHandler for each buttons Click event?
Thanks again so much for your help.
Sincerely
--
Morris
""Wen Yuan Wang [MSFT]"" wrote:
> Hello Morris,
>
> Thanks for your reply and detailed information. I tried the steps which you
> posted in thread. I created two different datasets base on the same table,
> one retrieves only id column from the DB table and another one is detailed
> information. I drag-drop them on the form. Thus, VS IDE generates GridView
> and Navigationbar automatically. At last, I pasted the code snippet in
> GridView and Button Event. TableAdapter.Update() method works fine after I
> edited GridView. I never got any error said parameter is empty. Actually,
> @IsNull_BoxNumber Parameter should be filled in updat() faction by .net. I
> checked the source code in Reflector. @IsNull_BoxNumber Parameter is filled
> automatically if it's not null and SourceColumnNullMapping is true.
>
> DbParameter parameter2 = parameter as DbParameter;
> if ((parameter2 != null) && parameter2.SourceColumnNullMapping)
> {
> parameter.Value = ADP.IsNull(parameter.Value) ?
> ParameterValueNullValue : ParameterValueNonNullValue;
> }
>
> If it's possible, could you please send us a simply project to reproduce
> the issue on our side? You can get me at v-wywang@microsoft.com. We are
> willing to drill into the project and figure out the root cause, if you can
> send us it to reproduce the issue.
>
> Please feel free to let us know if you have any more concern. We are glad
> to assist you.
>
> Have a great day,
> Best regards,
> Wen Yuan
>
> Microsoft Online Community Support
> Delighting our customers is our #1 priority. We welcome your comments and
> suggestions about how we can improve the support we provide to you. Please
> feel free to let my manager know what you think of the level of service
> provided. You can send feedback directly to my manager at:
> msdnmg@microsoft.com.
> ==================================================
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>