Re: Data access advise by John
John
Sun Sep 04 11:27:04 CDT 2005
Hi
Thanks for info.
Re: point 3, my main table "companies" has the following fields among
others;
ID
Company
ParentComnpany
CompanyType
I have only placed two fields on the form ID & Company. The standard vs2005
dataaccess/databinding code is generated when I dragged the two fields on
the form. Now when I enter a value in company field on form and save it, all
the fields that have 'Company' in their name such as ParentCompany,
CompanyType etc., get the same value in the underlying table. Hope this
explains it.
Regards
"W.G. Ryan MVP" <WilliamRyan@nospam.gmail.com> wrote in message
news:OhLyP68rFHA.3080@TK2MSFTNGP15.phx.gbl...
> THe RowChanging/Changed and ColumnChanging/Changed events will let you
> trap the fields as they are being changed. Of course, you can change the
> values on your own by binding them to controls or using
> DataSetName.Tables[TableIndex].Rows[RowIndex].Columns[ColumnIndex]
>
> 2- YOu need two data adapters, one for each the parent and the child.
> Update the Uppermost table on the chain first, then cycle down through the
> dependencies.
> 3- Sorry, I don't follow you here. If you can post a little more perhaps
> I can be of greater help.
> "John" <John@nospam.infovis.co.uk> wrote in message
> news:%23SFrUP1rFHA.2008@TK2MSFTNGP10.phx.gbl...
>> Hi
>>
>> vs2005/sql server2004. I have created a simple winform app by dragging a
>> table on a winform. I have used stored procedures for data access. I have
>> the following questions;
>>
>> 1. Using the default code generated by vs2005 for data access, how can I
>> trap record insertion to set some field values before the record is
>> inserted?
>>
>> 2. The default data access works nicely for insert in the main table. I
>> need to insert a detailed record for every record inserted in the main
>> table. How and where do I implement this second insert?
>>
>> 3. If I type a value in 'Company' field on the winform, when record is
>> saved the underlying table contains that same value in every field that
>> has word "company" in the fieldname such as CompanyType, CompanyAddress
>> etc. Why is that?
>>
>> Thanks
>>
>> Regards
>>
>>
>
>