473,405 Members | 2,373 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,405 software developers and data experts.

C# OO concept and SQL Server Table

Hi,

My project is .Net 1.1 C# Windows Form project, and the database server is
SQL Server 2000.
In one of the database's datatable MyTable, the Primary Key is a Join Key
[Name, Number].
Now in my C# Windows form MyForm, it is designed mainly for manipulating the
datatable MyTable.
I am thinking if we apply the OO concept, do we need to have public function
like:

public string[,] GetMyTable(string aName,string aNumber)

Since I am thinking the [Name, Number] will indicate a unique row in the
MyTable in SQL Server.
Also, do I need to build a contsructor for pass value [Name, Number] for
other forms?
Thanks for help.
Jason

Jan 25 '06 #1
2 1219
First of all, why don't u use single primary key instead of using Join
Key (according term u used). U can create it manually or
uniqueidentifier with default value - newid()

Secondly, u can use DataSet or DataTable object when u need pass data
to other forms by overloading constructor or using property.

Hope that help u

Jan 25 '06 #2
Jason Huang wrote:
Hi,

My project is .Net 1.1 C# Windows Form project, and the database server is
SQL Server 2000.
In one of the database's datatable MyTable, the Primary Key is a Join Key
[Name, Number].
Now in my C# Windows form MyForm, it is designed mainly for manipulating the
datatable MyTable.
I am thinking if we apply the OO concept, do we need to have public function
like:

public string[,] GetMyTable(string aName,string aNumber)

Since I am thinking the [Name, Number] will indicate a unique row in the
MyTable in SQL Server.
Also, do I need to build a contsructor for pass value [Name, Number] for
other forms?
Thanks for help.


If you REALLY want to practice good OO, you would use some kind of Data
Access Object pattern. There is was a good couple of articles posted to
code project about this recently.

http://www.codeproject.com/dotnet/ADONETOOP.asp
http://www.codeproject.com/dotnet/AdoNetForOopPart2.asp

It may seem overly complicated at first, but with a reasonably small
amount of code, you can have a true OO model which happens to have a
database underneath.
--
Jay R. Wren
Jan 25 '06 #3

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

Similar topics

10
by: nop90 | last post by:
Proof of concept: Currently I have a web hosting service and it does support php. Can the following be done in php? Explanations or examples would be appreciated. Create 2 applications, app-1...
1
by: Dick | last post by:
Before going in to details i like to understand more about concept and design of this database. Most books go directly in to details. Please, can a current admistrator gife me information on...
5
by: strutsng | last post by:
I want to clarify the concept of submitting the form to the web server. PHP is just an example here, it applies to any web programming languages. On page1.php, <form name="myform"...
7
by: srinivas | last post by:
Hi, I am a asp programmer.I am displaying the db records in the html pages in a web page.I have 500 columns and 1000 rows in that html table.Here i am planning to implement the "MS-Excel Freeze...
2
by: Howard | last post by:
I need to write a web page that outputs a table from database. ( i want to write my own code, don't want to use the built-in control) I came up with two ways of doing this (i use c# 2.0) 1....
1
by: sj | last post by:
I need to write an application to perform Quotations, and confrimed Quotations information can later extracted and print a Delivery Order, and finally an Invoice. Note that, ammendments maybe made...
1
by: John | last post by:
AJAX is a rich client-side technology that makes the web pages more interactive. In practice, the same AJAX client-side code should be unchanged, regardless of what server-side web technologies we...
0
by: Raj | last post by:
Hi All.., I have a VB.Net Windows Application.. I need to Run this Exe From Some Other System(Client) and I need to Upload some specified files to the Server System.. Now my doubts are.. ...
2
by: suganthy | last post by:
Hi, Can any one tell the merits and demerits of table concept in integrating a html layout when compared with DIV concept Thanks
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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,...

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.