473,413 Members | 1,755 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,413 software developers and data experts.

How should I insert my data using an inherited class in an inherited form

3
Hello,
this seems like it should be more strait forward but I feel like I am missing the boat on best practices somewhere.
I have inherited types with contractual insert update and delete methods. I also have an inherited "EditData" form wherein the Base form takes my base type in its constructor. My trouble comes when I want to assign the control values of the form to the properties of the sub- type. The base form calls the base type's insert method but since the base type is highly generic it doesn't know which properties need to be mapped to the forms controls.
I seems like I have to do that in the sup-type but the sub-type has no access to the form. Also NOT all the properties of the type are going to be changed by this form only one or two but it will vary from type to type.
SO... after that mouthfull, my question is should I...
1) give access to the form by passing the form to the insert method and make the form controls public and have the insert method set the type's properties accordingly?
or
2) make the insert method take a bunch of parameters (9 to be exact) and have the type set its properties from those accordingly?

OR is some other option I am not seeing?

let me know if you dont get my question of if you need to see some code

thanks in advance
Sep 16 '10 #1
2 1155
hype261
207 100+
Warpig,

Is the insert method in the parent class virtual and overriden in the child class? I think this will solve your problem.
Sep 17 '10 #2
Warpig
3
Yes, parent is virtual and overridden in child. I settled on passing the instance of the inherited form to the inherited classes insert method that way it has momentary access to the form controls and can use the values it needs to accordingly. This way each inherited instance of my class and it's Insert(EditForm form) method has what it needs and I don't have to figure out which class is going to need different values sent to it.

Thank you hype261 for your reply. It looks like I am on to the next phase.
Sep 21 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: ABinBoston | last post by:
I have a form in a .adp with some values on it that are derived from a lookup I would like to click a Command Button and Add the Data in the textboxes to a Table the form is named...
1
by: Pratik Gupte | last post by:
I have created a database in .mdf format, but I am unable to insert data into its tables. Can anybody help how to insert data using ASP.Net 2.0 using SQL Server 2005 Express edition in windows...
1
by: christine0207 | last post by:
i still new in using Viusal Studio 2005..
1
by: sugumar | last post by:
i create two table one is bill ,another one is billdetail . particular bill have a many book one to many relationship i want to create master detail form (ex orderform) using gridview, or datagrid...
0
by: danishce | last post by:
Hello, I want to insert data directly into my windows form data grid and load a combobox(userid) in the 1st column of data grid,a textbox(password) in 2nd column of datagrid. The code for insert...
2
by: freddy windey | last post by:
Hi, this my 1st time i join discussion. im just a new programmer. i need help from your expert on this "Insert data using 1 form to 2 different table"- ASP VBscript. example- name: age: DOB:...
11
by: TechnoAtif | last post by:
INSERT AND UPDATE MULTIPLE CHECKBOX DATA USING PHPMYSQL OR JAVASCRIPT Hi All I want to check the multiple checkboxes update them after revisiting that page. I am taking the name as...
1
by: ghjk | last post by:
I want to insert data through my web application. I have dropdown box (have 2 values Yes and No)and when i select yes insert record will be 5 and when i select no insert record will be 3. So i cant...
2
by: S_K | last post by:
Hi, I have a problem in which I have to insert data from an ASP.NET form into an Adobe (.pdf) form. How can I do this? Thanks. Steve
0
by: brianrpsgt1 | last post by:
I am attempting to insert data from a HTML form using a .psp script. I can not find how to link the data that is inserted into the form to the variables in the .psp script to then insert into the...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.