473,387 Members | 1,585 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.

is this too heavy

hey all,

i was wondering if the following code, in general, if it wouldn't always be
a good idea or if there's a better way to do it.

Private Sub DataGrid2_ItemDataBound(ByVal sender As Obj...
If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType =
ListItemType.AlternatingItem Then
Dim lnb As LinkButton
lnb = e.Item.Cells(1).FindControl("LinkButton1")
lnb.Text = e.Item.DataItem("OrderID")
End If

All i'm trying to do is take a field in each row of the datasource and
assign it to the text of a link button so users can click it.

Thanks,
rodchar
Nov 18 '05 #1
4 973
This looks like perfectly good code to me.
I've used similar code successfully before.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"rodchar" <ro*****@discussions.microsoft.com> wrote in message
news:CB**********************************@microsof t.com...
hey all,

i was wondering if the following code, in general, if it wouldn't always
be
a good idea or if there's a better way to do it.

Private Sub DataGrid2_ItemDataBound(ByVal sender As Obj...
If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType =
ListItemType.AlternatingItem Then
Dim lnb As LinkButton
lnb = e.Item.Cells(1).FindControl("LinkButton1")
lnb.Text = e.Item.DataItem("OrderID")
End If

All i'm trying to do is take a field in each row of the datasource and
assign it to the text of a link button so users can click it.

Thanks,
rodchar

Nov 18 '05 #2
Good god, I hope not!!
I use code like that all the time. <g>
--
Joe Fallon

"rodchar" <ro*****@discussions.microsoft.com> wrote in message
news:CB**********************************@microsof t.com...
hey all,

i was wondering if the following code, in general, if it wouldn't always
be
a good idea or if there's a better way to do it.

Private Sub DataGrid2_ItemDataBound(ByVal sender As Obj...
If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType =
ListItemType.AlternatingItem Then
Dim lnb As LinkButton
lnb = e.Item.Cells(1).FindControl("LinkButton1")
lnb.Text = e.Item.DataItem("OrderID")
End If

All i'm trying to do is take a field in each row of the datasource and
assign it to the text of a link button so users can click it.

Thanks,
rodchar

Nov 18 '05 #3
Thank you everyone for your feedback. This helps a lot.

"Joe Fallon" wrote:
Good god, I hope not!!
I use code like that all the time. <g>
--
Joe Fallon

"rodchar" <ro*****@discussions.microsoft.com> wrote in message
news:CB**********************************@microsof t.com...
hey all,

i was wondering if the following code, in general, if it wouldn't always
be
a good idea or if there's a better way to do it.

Private Sub DataGrid2_ItemDataBound(ByVal sender As Obj...
If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType =
ListItemType.AlternatingItem Then
Dim lnb As LinkButton
lnb = e.Item.Cells(1).FindControl("LinkButton1")
lnb.Text = e.Item.DataItem("OrderID")
End If

All i'm trying to do is take a field in each row of the datasource and
assign it to the text of a link button so users can click it.

Thanks,
rodchar


Nov 18 '05 #4
Pretty nice code!
Patrick

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #5

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

Similar topics

0
by: Kayra Otaner | last post by:
Hi all, I want to get your opinions on how to increase available/free memory and performance on a heavy volume database server. I have MySQL 4.0.13 running on RH 7.2 replicated to another RH...
0
by: kayra | last post by:
Hi all, I want to get your opinions on how to increase available/free memory and performance on a heavy volume database server. I have MySQL 4.0.13 running on RH 7.2 replicated to another RH...
3
by: John Wells | last post by:
A manager friend of mine sent me the following concern. He's preparing to shift to Postgresql from a proprietary DB and 4gl system: ----------- To that end, I've also started studying up on...
6
by: Innuendo | last post by:
Hello, I'm not a specialist with Access - so I hope that you can give me some input. I've to import xml data (about 15 different data fields) into an access-database each night. As scripting...
13
by: Manuel Lopez | last post by:
I have a puzzling form timer problem that I didn't experience prior to Access 2003 (though I'm not sure access 2003 is to blame). Here's the situation: a computer has two access 2003 databases on...
4
by: Michiel Alsters | last post by:
Hello everybody, I hope anybody can help me. I'll try to give a brief overview of my problem. I have running a program that performs a heavy calculation. To give the user feedback what the...
13
by: mloichate | last post by:
I must read a very heavy-weight text plain file (usually .txt extension) )and replace a given character with another given character in all text inside the file. My application was working pretty...
19
by: Alex Madon | last post by:
Hello, I am testing a web application (using the DBX PHP function to call a Postgresql backend). I have 375Mb RAM on my test home box. I ran ab (apache benchmark) to test the behaviour of the...
6
by: Chris Burnley | last post by:
We're seeing very strange behaviour with db2 under heavy load. We're running our system in GMT and the timezone never changes for British Summer Time. Basically the thing we're doing is (using...
3
by: Imre | last post by:
Hi! I've got some questions regarding heavy use of virtual inheritance. First, let's see a theoretical situation, where I might feel tempted to use a lot of virtual inheritance. Let's...
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:
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: 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
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...

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.