473,666 Members | 2,713 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Survey - implementing CRUD with "foreign name" instead of foreign key.

hi all

it's extremely common scenario, so I would like to ask you how do you
usually implement CRUD functionality for following structure. Basically
it's all about displaying "foreign name" (ie. some textual description)
instead of foreign key.
GUI:

Table1ID
Info1
Table2.Name [Join on table2ID, DropDownList in Edit mode]
Database:

table1 table2
----------------- ------------------
PK table1ID PK table2ID
info1 Name
FK table2ID

this structure can describe for example some entity and it's category.
I'm using .net 2.0 typed datasets with TableAdapter Wizard, and I think
that, considering how ubiqitous is this structure, optimal solution
should be simpler than mine:

My way to do it:

It uses 2 objectDataSourc es and 2 corresponding TableAdapters:

---- one for displaying table1 with table2.name instead of table2ID

dataset uses JOIN on table2.id.

the drawback is that TableAdapterWiz ard cannot automatically generate
update/insert/delete statements. since it's multitable query
--- second ODS and tableAdapter to feed DropDownList in DetailsView's
edit mode
(simple select table2ID,name from table2)

dropdownlist works thanks to it's useful Text/Value parameters:
DataSourceID="o dsTable2"
DataTextField=" Name"
DataValueField= "CourseCategory ID"
SelectedValue=' <%# Bind("Table2ID" , "{0}")


So, there must be 2 dataSources, and 2 tableAdapters, including one
with multiTable query which is a drawback in TAW.
One simpler solution comes to my mind - using the same DDList in
ItemTemplate as in EditItemTemplat e, but then it has do be disabled
(and hence greyed out) to disallow it's changing - isn't there any way
to use a Label (or other read-only) control in such way (text/value)?
thanks for thoughts

May 3 '06 #1
0 1091

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

Similar topics

6
2301
by: Java script Dude | last post by:
We just discovered another IE bug. When an html form contains an element with a name of `name` IE's internal index screws up the .name property of the containing form to point to the bad element object instead of containing the string name property of the form. Here is the simplified test case: <html>
4
3958
by: Marc Elser | last post by:
Hi Everybody, Can someone please tell me how to access the form name if there's a form field named "name", for example: <form name="myform"> <input type="text" name="name" value="Marc"> <input type="button" onClick="alert(this.form.name);"> </form>
3
2688
by: Pavils Jurjans | last post by:
Hello, I have bumped upon this problem: I do some client-side form processing with JavaScript, and for this I loop over all the forms in the document. In order to identify them, I read their "name" property (which sources from "name" HTML attribue). The problem is, that if the form contains form control named "name", it overwrites the form name property. In fact, I'm quite surprised that it's so easy to spoil any of the form object...
6
7048
by: Mason A. Clark | last post by:
LAST WORD(s): 1. MSIE6 and Firefox will go to the top of the page on command <a href="#top">go upsy</a> even if there is NO name="top" or id="top" They know what a "top" is :-) Opera does not.
14
3763
by: spike | last post by:
Im trying to write a program that should read through a binary file searching for the character sequence "\name\" Then it should read the characters following the "\name\" sequence until a NULL character is encountered. But when my program runs it gets a SIGSEGV (Segmentation vioalation) signal. Whats wrong? And is there a better way than mine to solve this task (most likely)
2
5351
by: Murphy | last post by:
Our website contains subdirectories for each subsidiary company, each company has it's own look and feel to the pages in their subdirectory although they are all part of the main website. The code below in the Web.Config file defines the authentication as forms and the aspx file required for login if the user is unauthenticated... this works well for the root level company web pages however when a user viewing the website of SubCompanyA...
0
2552
by: Joeyej | last post by:
Hi - I'm trying to move/use a web form (containing some javascript field checks) previously hosted on a Windows 2000 server. However, the FORM METHOD="post..." command in the form (shown below) now renders "Page not Found" when launched on the new Windows 2003 server (ws-server1). The form is designed to use the write.asp program to write to an Acccess database and is successful on any Windows 2000 server. This is frustrating because...
2
1615
by: mirandacascade | last post by:
I am prompted to make these inquiries after seeing the following link to ctypes: http://docs.python.org/lib/module-ctypes.html in which ctypes is described as a foreign function library. What is the definition of "foreign function library"? Is the concept different from a "package"? Is the concept different from a "module"?
1
2234
by: chrisli | last post by:
Hello, i'm trying to make an Application which can get every Calendar entry from a FOREIGN User in Outlook on a Exchange 2003 Server. At the moment i can only get my own calender entries. But i need to get the Entries from another User. Here's my actually code: Dim osession As New MAPI.Session
0
8438
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8348
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8863
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8779
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8636
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6187
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5660
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4356
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2004
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.