473,323 Members | 1,547 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

Data access advise

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
Nov 21 '05 #1
2 1200
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" <Jo**@nospam.infovis.co.uk> wrote in message
news:%2****************@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

Nov 21 '05 #2
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" <Wi*********@nospam.gmail.com> wrote in message
news:Oh**************@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" <Jo**@nospam.infovis.co.uk> wrote in message
news:%2****************@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


Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: serge calderara | last post by:
Dear all, I need to collect different type of data. Source of those data are CSV files and Access database. I am thinking on the way I should retrive those data under my VB.NET application in...
7
by: Jack | last post by:
Hi, I am trying to test a sql statement in Access which gives me the error as stated in the heading. The sql statement is built as a part of asp login verification, where the userid and password...
10
by: Zap | last post by:
Widespread opinion is that public data members are evil, because if you have to change the way the data is stored in your class you have to break the code accessing it, etc. After reading this...
4
by: Ron_A | last post by:
I consider myself an intermediate to budding-expert in developing using ACC-97. For some time now, on Win-NT, I've been using Split DB's with backend on server and front end local with all my...
2
by: Rooksarii | last post by:
Hello folks, Let me first apologize for any impropper terminology I may use as I am presently trying to broaden my Office knowledge by diving into Access head on. My specific problem is this....
5
by: teser3 | last post by:
I would like to transfer an Outlook 2000 Event Calendar information into an Access 2000 database. Please advise if and how I can do this where after something is entered in the Event Calendar it...
1
by: Bob Alston | last post by:
Anyone able to do this with Access created Data Access Pages, using UseRemoteProvider parm on DAP and getting RDS configured properly on the server so the DAP's activeX can access the database on...
4
by: phong.lee | last post by:
Here is an issue i've been trying to figure out which i do not have an answer to. Basically i have an excel spreadsheet which has data that i copy and paste from another resource. I also created...
0
by: Scott | last post by:
I have a search form built with Access 97 and now I upgraded to Access 2003. On one field of the resulting form, I have a field of hyperlink data type containing the path of the file, i.e., Disk...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.