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

Best Practices: Table of IDs

I have a table of ID vaules that are related to lookup tables.

I created a DataAccess component from wich the ObjectDataSource gets a
typed datatable. A GridView is bound to that ObjectDataSource and
allows Edit and Delete.

On the same page is the means to add a new record (since the GridView
does not support that ... but that's another rant) via several
DropDownLists bound to other ObjectDataSources.
The issue now is, what is the best way to display the lookup values in
the table? Options are:
1) Return the lookup values with the typed datatable. This seems to
unnecessarily link the table with which I want to interact to the
lookup tables.

2) Use the value from the main table to get the values form the
ObjectDataSources that are already on the page. This seems like "the
right way to do it" but how? I can't bind the Labels in the GridView to
anything but the fields in the tabe to which that is bound. Do I have
to add a DropDownList to get the lookup value then use that for the
label? (I don't want to display a drop down list if it's not meant to
be edited)

Any advice would be much appreciated.

May 17 '06 #1
2 1114
Nevermind. I figured out an acceptable solution.

On the Label's DataBinding even, look up the value from the ddl and
replace it.

protected void lblAcctNumb_DataBinding(object sender, EventArgs e)
{
if (sender is Label)
{
//lblAcctNumb is inside the GridView
Label lbl = (Label)sender;
string txt = lbl.Text;
//ddlAccount is outside the GridView
ListItem li = ddlAccount.Items.FindByValue(txt);
lbl.Text = li.Text;
}
}
Thoughts?

May 17 '06 #2
Nope.

The next Label that needs to be changed gets its value from a drop down
lis that is not populated yet.
grrrrrrrr

May 17 '06 #3

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

Similar topics

2
by: Steve_CA | last post by:
Hello all, I just started a new job this week and they complain about the length of time it takes to load data into their data warehouse, which they do once a month. From what I can gather,...
16
by: D Witherspoon | last post by:
I am developing a Windows Forms application in VB.NET that will use .NET remoting to access the data tier classes. A very simple way I have come up with is by creating typed (.xsd) datasets. For...
2
by: byrocat | last post by:
I'm chasing after a documetn that was available on one of the Microsoft websites that was titled somethign like "MS SQL Server Best Practices" and detailed a nyumber of best practices about...
136
by: Matt Kruse | last post by:
http://www.JavascriptToolbox.com/bestpractices/ I started writing this up as a guide for some people who were looking for general tips on how to do things the 'right way' with Javascript. Their...
10
by: jojobar | last post by:
Hello, I am trying to use vs.net 2005 to migrate a project originally in vs.net 2003. I started with creation of a "web site", and then created folders for each component of the site. I read...
0
by: Louis Aslett | last post by:
I hope this is the correct newsgroup for this query (if not please give me a pointer to where is best): I understand the theory of normalisation etc and am trying to follow best practices in the...
4
by: DeepDiver | last post by:
I am developing an inventory database in SQL Server. I realize there are many commercial (as well as some non-commercial) inventory offerings, but my client has specific requirements that would...
26
by: puzzlecracker | last post by:
It'd be interesting to compare the learning practices of c++ practitioners. I'll start with mine The C++ Programming Language C++ Primer Effective C++ More Effective C++ Effective STL The...
2
by: Eddie | last post by:
I have a DataSet with relations and other constraints being populated from the backend (SQL Server 2005). I use DataSet.FillSchema to retrieve the table schema for each table in the dataset. I...
4
by: trullock | last post by:
Hi, Can anyone suggest the best way to go about the following... I'm tracking clicks (mouse down x,y coordinates) on a web page by using some javascript to create an XHR which sends the...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
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: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
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)...

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.