Hello

I have a strong typed dataset, and when the add btn on the toolbar is
clicked I do the following - which basiscally defines the strongly typed
row, creates a new one & adds it to the dataset datarowcollection.

drow As ds_studies.sp_retrieve_studiesRow
drow = ds_studies.sp_retrieve_studies.Newsp_retrieve_studiesRow

ds_studies.EnforceConstraints = False

ds_studies.sp_retrieve_studies.Addsp_retrieve_studiesRow(drow)

The user finds a blank screen and proceeds on filling values into the
textbox controls / combo boxes etc. When the user clicks on the save button,
I do the dataset update and all the usual stuff like checking for a
successful update / retrieving the newly added row.


My problem: when I reach the line of code in the save btn i.e.
dataadapter.Update(dataset),

I expect to have my adapter.InsertCommand.Parameter Collection filled with
the user entered values:
The parameters look right, the source column in each of them is the colum
specified in the table mappings

However none of the parm values are filled in. I dont think I should be
filling in these values programatically. For your info my datasource is a
stored proc and the parms are exactly mapped to what the proc requires.

If anyone can shed some light on this, I'd appreciate it.

Thanks,
Nisha

Re: Dataset Insert Parameters... by Miha

Miha
Wed Jan 07 15:04:42 CST 2004

HI Nisha,

Instead of passing dataset to dataadapter.Update(dataset) method, try
passing dataset.yourtable.

--
Miha Markic - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

"Nisha" <nisha.lalvani@rogers.com> wrote in message
news:FQYKb.35988$1g41.17812@twister01.bloor.is.net.cable.rogers.com...
> Hello
>
> I have a strong typed dataset, and when the add btn on the toolbar is
> clicked I do the following - which basiscally defines the strongly typed
> row, creates a new one & adds it to the dataset datarowcollection.
>
> drow As ds_studies.sp_retrieve_studiesRow
> drow = ds_studies.sp_retrieve_studies.Newsp_retrieve_studiesRow
>
> ds_studies.EnforceConstraints = False
>
> ds_studies.sp_retrieve_studies.Addsp_retrieve_studiesRow(drow)
>
> The user finds a blank screen and proceeds on filling values into the
> textbox controls / combo boxes etc. When the user clicks on the save
button,
> I do the dataset update and all the usual stuff like checking for a
> successful update / retrieving the newly added row.
>
>
> My problem: when I reach the line of code in the save btn i.e.
> dataadapter.Update(dataset),
>
> I expect to have my adapter.InsertCommand.Parameter Collection filled with
> the user entered values:
> The parameters look right, the source column in each of them is the colum
> specified in the table mappings
>
> However none of the parm values are filled in. I dont think I should be
> filling in these values programatically. For your info my datasource is a
> stored proc and the parms are exactly mapped to what the proc requires.
>
> If anyone can shed some light on this, I'd appreciate it.
>
> Thanks,
> Nisha
>
>
>
>
>
>
>



Re: Dataset Insert Parameters... by Nisha

Nisha
Thu Jan 08 11:15:00 CST 2004

Hi Miha,

Thanks for your help. However this doesn't seem to help either. I have tried
innumerable scenarios such as changing the sourcecolumn within the
insertcommand parameter collection to proposed and changing the
updaterowsource property.

Even loading up the paramerter collection manually before the adapter.Update
method, is not working
i.e I did the following

adapter.InsertCommand.Parameter(0).value = tbx.text
and so on..

however if I check the profiler the Insert proc is being executed with

exec sp_insert_studies @parm1 = null, @parm2 = null

and so on.

WHAT COULD BE POSSIBLY WRONG HERE ??

Is there anything else I should be trying out?

Any suggestions are welcome.

Thanks,

...Nisha




"Miha Markic" <miha at rthand com> wrote in message
news:O$NfhHW1DHA.3216@TK2MSFTNGP11.phx.gbl...
> HI Nisha,
>
> Instead of passing dataset to dataadapter.Update(dataset) method, try
> passing dataset.yourtable.
>
> --
> Miha Markic - RightHand .NET consulting & development
> miha at rthand com
> www.rthand.com
>
> "Nisha" <nisha.lalvani@rogers.com> wrote in message
> news:FQYKb.35988$1g41.17812@twister01.bloor.is.net.cable.rogers.com...
> > Hello
> >
> > I have a strong typed dataset, and when the add btn on the toolbar is
> > clicked I do the following - which basiscally defines the strongly typed
> > row, creates a new one & adds it to the dataset datarowcollection.
> >
> > drow As ds_studies.sp_retrieve_studiesRow
> > drow = ds_studies.sp_retrieve_studies.Newsp_retrieve_studiesRow
> >
> > ds_studies.EnforceConstraints = False
> >
> > ds_studies.sp_retrieve_studies.Addsp_retrieve_studiesRow(drow)
> >
> > The user finds a blank screen and proceeds on filling values into the
> > textbox controls / combo boxes etc. When the user clicks on the save
> button,
> > I do the dataset update and all the usual stuff like checking for a
> > successful update / retrieving the newly added row.
> >
> >
> > My problem: when I reach the line of code in the save btn i.e.
> > dataadapter.Update(dataset),
> >
> > I expect to have my adapter.InsertCommand.Parameter Collection filled
with
> > the user entered values:
> > The parameters look right, the source column in each of them is the
colum
> > specified in the table mappings
> >
> > However none of the parm values are filled in. I dont think I should be
> > filling in these values programatically. For your info my datasource is
a
> > stored proc and the parms are exactly mapped to what the proc requires.
> >
> > If anyone can shed some light on this, I'd appreciate it.
> >
> > Thanks,
> > Nisha
> >
> >
> >
> >
> >
> >
> >
>
>



Re: Dataset Insert Parameters... by Miha

Miha
Thu Jan 08 11:53:11 CST 2004


> Is there anything else I should be trying out?

Try calling BindingManagerBase.EndCurrentEdit before calling Update method.

--
Miha Markic - RightHand .NET consulting & development
miha at rthand com
www.rthand.com



Re: Dataset Insert Parameters... by Nisha

Nisha
Fri Jan 09 09:11:32 CST 2004

Thanks again Miha... Yes this did work.

I think I need to understand the Bindingmanager a little better. I am still
a little confused why I have one way binding working and not the other
way... I suppose I need to read up a little more on this.

..Nisha

"Miha Markic" <miha at rthand com> wrote in message
news:e0zeKBh1DHA.4032@tk2msftngp13.phx.gbl...
>
> > Is there anything else I should be trying out?
>
> Try calling BindingManagerBase.EndCurrentEdit before calling Update
method.
>
> --
> Miha Markic - RightHand .NET consulting & development
> miha at rthand com
> www.rthand.com
>
>



Re: Dataset Insert Parameters... by Miha

Miha
Fri Jan 09 09:43:21 CST 2004

Hi Nisha,

Yes, they are a bit tricky. They are created implicitly. So you have to take
care how do you bind (arguments) because you might end with two bmb-s for
the same source.
As per your problem - bmbs normally create a buffer for editing in both edit
and add mode.
The buffer is stored to datasource only explicitly or when bmb moves
position.

--
Miha Markic - RightHand .NET consulting & software development
miha at rthand com
www.rthand.com

"Nisha" <nisha.lalvani@rogers.com> wrote in message
news:EwzLb.43179$AJB.5323@news04.bloor.is.net.cable.rogers.com...
> Thanks again Miha... Yes this did work.
>
> I think I need to understand the Bindingmanager a little better. I am
still
> a little confused why I have one way binding working and not the other
> way... I suppose I need to read up a little more on this.
>
> ..Nisha
>
> "Miha Markic" <miha at rthand com> wrote in message
> news:e0zeKBh1DHA.4032@tk2msftngp13.phx.gbl...
> >
> > > Is there anything else I should be trying out?
> >
> > Try calling BindingManagerBase.EndCurrentEdit before calling Update
> method.
> >
> > --
> > Miha Markic - RightHand .NET consulting & development
> > miha at rthand com
> > www.rthand.com
> >
> >
>
>