473,387 Members | 1,516 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,387 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 1118
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.