By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,197 Members | 975 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,197 IT Pros & Developers. It's quick & easy.

so close..I think

P: n/a
Hi,

I have this sub in which I am trying to get a client name from a second
table based on a clientid value in my datalist. I am having problems
grabbing the clientid value out of my datalist and putting it into my
variable curClientID. How do you grab a value out of a datalist properly
please?

Thx,Lerp

Here's my sub:

'THIS SUB HANDLES GRABBING CLIENT NAMES
Sub dlBookings_OnItemDataBound(sender As Object, e As DataListItemEventArgs)

If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType =
ListItemType.AlternatingItem Then

' Retrieve the Label control in the current DataListItem.
Dim ClientNameLabel As Label =
e.Item.FindControl("clientnamelabel")
'Trying to grab clientid here

********************************************
Dim curClientID
curClientID = e.item.FindControl("clientid")....

********************************************


' GRAB client name using ID from db here
Dim clientlabel As String
Dim strSQL as String
'SQL STATEMENT
strSQL = "SELECT fullname FROM CLIENT WHERE clientid=" & curClientID
'NEW CONNECTION OBJECT
Dim MyConn as New
SQLConnection(ConfigurationSettings.AppSettings("d bConn"))

'NEW DATAREADER
Dim objDR as SQLDataReader

'NEW COMMAND OBJECT
Dim Cmd as New SQLCommand(strSQL, MyConn)

'OPEN CONNECTION
MyConn.Open()

'EXECUTE QUERY AND RETRIEVE DATA INTO READER
objDR = Cmd.ExecuteReader(system.data.CommandBehavior.Clos eConnection)
WHILE objDR.Read
clientlabel = objDR("fullname")
END While

myConn.close

'redisplay it in the DataList.
clientnamelabel.Text = clientlabel

End If

End Sub


Nov 18 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
jm

"Lerp" <ad***@officience.ca> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi,

I have this sub in which I am trying to get a client name from a second
table based on a clientid value in my datalist. I am having problems
grabbing the clientid value out of my datalist and putting it into my
variable curClientID. How do you grab a value out of a datalist properly
please?

Thx,Lerp
Here's my sub:

'THIS SUB HANDLES GRABBING CLIENT NAMES
Sub dlBookings_OnItemDataBound(sender As Object, e As DataListItemEventArgs)
If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType =
ListItemType.AlternatingItem Then

' Retrieve the Label control in the current DataListItem.
Dim ClientNameLabel As Label =
e.Item.FindControl("clientnamelabel")
'Trying to grab clientid here

********************************************
Dim curClientID
curClientID = e.item.FindControl("clientid")....

********************************************


' GRAB client name using ID from db here
Dim clientlabel As String
Dim strSQL as String
'SQL STATEMENT
strSQL = "SELECT fullname FROM CLIENT WHERE clientid=" & curClientID
'NEW CONNECTION OBJECT
Dim MyConn as New
SQLConnection(ConfigurationSettings.AppSettings("d bConn"))

'NEW DATAREADER
Dim objDR as SQLDataReader

'NEW COMMAND OBJECT
Dim Cmd as New SQLCommand(strSQL, MyConn)

'OPEN CONNECTION
MyConn.Open()

'EXECUTE QUERY AND RETRIEVE DATA INTO READER
objDR = Cmd.ExecuteReader(system.data.CommandBehavior.Clos eConnection)
WHILE objDR.Read
clientlabel = objDR("fullname")
END While

myConn.close

'redisplay it in the DataList.
clientnamelabel.Text = clientlabel

End If

End Sub


If the curClientID is a label, can't you just get the .text of it? You only
told it to find the control. You did not access any of the properties
associated with it (unless there is something after the elipsis ...).
---

Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.677 / Virus Database: 439 - Release Date: 5/4/2004
Nov 18 '05 #2

P: n/a
Hi jm,

I am trying to display the client name on the label in the itemtemplate, but
first I have to read the clientid from the fourth field of the current row
being displayed, do a query based on that clientid, and assign the
clientname value to the label within the datalist loop. My problem is that
I am unsure how to grab the value for the fourth column of the current row
of the datalist loop. there is nothing after the elipsis. I am unsure what
to write in order to grab that column value. I am coming from asp
background into .net.

Cheers, Lerp

"jm" <jo*************@yahoo.com> wrote in message
news:BPanc.6774$z06.1276684@attbi_s01...

"Lerp" <ad***@officience.ca> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi,

I have this sub in which I am trying to get a client name from a second
table based on a clientid value in my datalist. I am having problems
grabbing the clientid value out of my datalist and putting it into my
variable curClientID. How do you grab a value out of a datalist properly please?

Thx,Lerp
Here's my sub:

'THIS SUB HANDLES GRABBING CLIENT NAMES
Sub dlBookings_OnItemDataBound(sender As Object, e As DataListItemEventArgs)

If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType =
ListItemType.AlternatingItem Then

' Retrieve the Label control in the current DataListItem.
Dim ClientNameLabel As Label =
e.Item.FindControl("clientnamelabel")
'Trying to grab clientid here

********************************************
Dim curClientID
curClientID = e.item.FindControl("clientid")....

********************************************


' GRAB client name using ID from db here
Dim clientlabel As String
Dim strSQL as String
'SQL STATEMENT
strSQL = "SELECT fullname FROM CLIENT WHERE clientid=" & curClientID
'NEW CONNECTION OBJECT
Dim MyConn as New
SQLConnection(ConfigurationSettings.AppSettings("d bConn"))

'NEW DATAREADER
Dim objDR as SQLDataReader

'NEW COMMAND OBJECT
Dim Cmd as New SQLCommand(strSQL, MyConn)

'OPEN CONNECTION
MyConn.Open()

'EXECUTE QUERY AND RETRIEVE DATA INTO READER
objDR = Cmd.ExecuteReader(system.data.CommandBehavior.Clos eConnection)

WHILE objDR.Read
clientlabel = objDR("fullname")
END While

myConn.close

'redisplay it in the DataList.
clientnamelabel.Text = clientlabel

End If

End Sub


If the curClientID is a label, can't you just get the .text of it? You

only told it to find the control. You did not access any of the properties
associated with it (unless there is something after the elipsis ...).
---

Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.677 / Virus Database: 439 - Release Date: 5/4/2004

Nov 18 '05 #3

P: n/a
jm

"Lerp" <ad***@officience.ca> wrote in message
news:eQ**************@tk2msftngp13.phx.gbl...
Hi jm,

I am trying to display the client name on the label in the itemtemplate, but first I have to read the clientid from the fourth field of the current row
being displayed, do a query based on that clientid, and assign the
clientname value to the label within the datalist loop. My problem is that I am unsure how to grab the value for the fourth column of the current row
of the datalist loop. there is nothing after the elipsis. I am unsure what to write in order to grab that column value. I am coming from asp
background into .net.

Cheers, Lerp

"jm" <jo*************@yahoo.com> wrote in message
news:BPanc.6774$z06.1276684@attbi_s01...

"Lerp" <ad***@officience.ca> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi,

I have this sub in which I am trying to get a client name from a second table based on a clientid value in my datalist. I am having problems
grabbing the clientid value out of my datalist and putting it into my
variable curClientID. How do you grab a value out of a datalist properly please?

Thx,Lerp
Here's my sub:

'THIS SUB HANDLES GRABBING CLIENT NAMES
Sub dlBookings_OnItemDataBound(sender As Object, e As DataListItemEventArgs)

If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType =
ListItemType.AlternatingItem Then

' Retrieve the Label control in the current DataListItem.
Dim ClientNameLabel As Label =
e.Item.FindControl("clientnamelabel")
'Trying to grab clientid here

********************************************
Dim curClientID
curClientID = e.item.FindControl("clientid")....

********************************************


' GRAB client name using ID from db here
Dim clientlabel As String
Dim strSQL as String
'SQL STATEMENT
strSQL = "SELECT fullname FROM CLIENT WHERE clientid=" & curClientID 'NEW CONNECTION OBJECT
Dim MyConn as New
SQLConnection(ConfigurationSettings.AppSettings("d bConn"))

'NEW DATAREADER
Dim objDR as SQLDataReader

'NEW COMMAND OBJECT
Dim Cmd as New SQLCommand(strSQL, MyConn)

'OPEN CONNECTION
MyConn.Open()

'EXECUTE QUERY AND RETRIEVE DATA INTO READER
objDR = Cmd.ExecuteReader(system.data.CommandBehavior.Clos eConnection)

WHILE objDR.Read
clientlabel = objDR("fullname")
END While

myConn.close

'redisplay it in the DataList.
clientnamelabel.Text = clientlabel

End If

End Sub


If the curClientID is a label, can't you just get the .text of it? You

only
told it to find the control. You did not access any of the properties
associated with it (unless there is something after the elipsis ...).
---

Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.677 / Virus Database: 439 - Release Date: 5/4/2004
Okay, first, just to let you know "ClientID" is a reserved word in .net for
getting the unique asp.net generated value for a given control; especially
useful in building javascript applications. It allows you to use the
objects on the client that asp.net generates a unique number for (like the
ctl1, etc. do a view source for an example.)

I believe you are using ClientID like OrderID and it looks like you want to
retrieve a value from a datalist that you generate (and is visible) and then
use that value for use in another query that those values are then sent to
the user.

Say you have a datagrid:

sub mysub(sender as Object, e as DataGridItemEventArgs)

CType(e.Items.Cells(0).Controls(0), Button).visible = false

so, in:

"Dim curClientID
curClientID = e.item.FindControl("clientid")...."
put:

Dim curClientID as String = e.Items.Cells(?).Controls(?).label).text

to retrieve the value at that location. Use the type of control you have
and its associated methods and properties (like .text).

Look here for a great primer (I know you may not be using the datagrid, but
it will still help you.):

http://aspnet.4guysfromrolla.com/art...71002-1.3.aspx

in here you will see an example close to what I have shown you. However,
you should go to the first part of the set of articles and start over:
http://aspnet.4guysfromrolla.com/articles/040502-1.aspx

However, it looks like to get your data for your first datalist that you are
sending to the client you have some SQL or data somewhere you are retrieving
to build the datalist in the first place. So, instead of printing out the
datalist first and then searching for the newly printed out value from your
new datalist, just get the value from the retrieved SQL results, save it a
variable and then use THAT value for your next query.

For example, assume that I just queried a database and retreived my results.
You could get a value at the proper point in your retrieval by:

dim curClientID as string =
datasource.tables(0).rows(0)("client_id").toString ()

Then, use curClientID below in your next set of code.

I hope I understood your problem and that this somehow helps you (also, you
may also wish to avoid top posting for reading clarity.)

For a view of what I was saying about ClientID, see:
http://msdn.microsoft.com/library/de...entIDTopic.asp

"Lerp" <ad***@officience.ca> wrote in message
news:eQ**************@tk2msftngp13.phx.gbl... Hi jm,

I am trying to display the client name on the label in the itemtemplate, but first I have to read the clientid from the fourth field of the current row
being displayed, do a query based on that clientid, and assign the
clientname value to the label within the datalist loop. My problem is that I am unsure how to grab the value for the fourth column of the current row
of the datalist loop. there is nothing after the elipsis. I am unsure what to write in order to grab that column value. I am coming from asp
background into .net.

Cheers, Lerp

"jm" <jo*************@yahoo.com> wrote in message
news:BPanc.6774$z06.1276684@attbi_s01...

"Lerp" <ad***@officience.ca> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi,

I have this sub in which I am trying to get a client name from a
second table based on a clientid value in my datalist. I am having problems
grabbing the clientid value out of my datalist and putting it into my
variable curClientID. How do you grab a value out of a datalist

properly please?

Thx,Lerp
Here's my sub:

'THIS SUB HANDLES GRABBING CLIENT NAMES
Sub dlBookings_OnItemDataBound(sender As Object, e As

DataListItemEventArgs)

If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType =
ListItemType.AlternatingItem Then

' Retrieve the Label control in the current DataListItem.
Dim ClientNameLabel As Label =
e.Item.FindControl("clientnamelabel")
'Trying to grab clientid here

********************************************
Dim curClientID
curClientID = e.item.FindControl("clientid")....

********************************************


' GRAB client name using ID from db here
Dim clientlabel As String
Dim strSQL as String
'SQL STATEMENT
strSQL = "SELECT fullname FROM CLIENT WHERE clientid=" & curClientID 'NEW CONNECTION OBJECT
Dim MyConn as New
SQLConnection(ConfigurationSettings.AppSettings("d bConn"))

'NEW DATAREADER
Dim objDR as SQLDataReader

'NEW COMMAND OBJECT
Dim Cmd as New SQLCommand(strSQL, MyConn)

'OPEN CONNECTION
MyConn.Open()

'EXECUTE QUERY AND RETRIEVE DATA INTO READER
objDR = Cmd.ExecuteReader(system.data.CommandBehavior.Clos eConnection)

WHILE objDR.Read
clientlabel = objDR("fullname")
END While

myConn.close

'redisplay it in the DataList.
clientnamelabel.Text = clientlabel

End If

End Sub


If the curClientID is a label, can't you just get the .text of it? You

only
told it to find the control. You did not access any of the properties
associated with it (unless there is something after the elipsis ...).
---

Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.677 / Virus Database: 439 - Release Date: 5/4/2004
Okay, first, just to let you know "ClientID" is a reserved word in .net for
getting the unique asp.net generated value for a given control; especially
useful in building javascript applications. It allows you to use the
objects on the client that asp.net generates a unique number for (like the
ctl1, etc. do a view source for an example.)

I believe you are using ClientID like OrderID and it looks like you want to
retrieve a value from a datalist that you generate (and is visible) and then
use that value for use in another query that those values are then sent to
the user.

Say you have a datagrid:

sub mysub(sender as Object, e as DataGridItemEventArgs)

CType(e.Items.Cells(0).Controls(0), Button).visible = false

so, in:

"Dim curClientID
curClientID = e.item.FindControl("clientid")...."


put:

Dim curClientID as String = e.Items.Cells(?).Controls(?).label).text

to retrieve the value at that location. Use the type of control you have
and its associated methods and properties (like .text).

Look here for a great primer (I know you may not be using the datagrid, but
it will still help you.):

http://aspnet.4guysfromrolla.com/art...71002-1.3.aspx

in here you will see an example close to what I have shown you. However,
you should go to the first part of the set of articles and start over:
http://aspnet.4guysfromrolla.com/articles/040502-1.aspx

However, it looks like to get your data for your first datalist that you are
sending to the client you have some SQL or data somewhere you are retrieving
to build the datalist in the first place. So, instead of printing out the
datalist first and then searching for the newly printed out value from your
new datalist, just get the value from the retrieved SQL results, save it a
variable and then use THAT value for your next query.

For example, assume that I just queried a database and retreived my results.
You could get a value at the proper point in your retrieval by:

dim curClientID as string =
datasource.tables(0).rows(0)("client_id").toString ()

Then, use curClientID below in your next set of code.

I hope I understood your problem and that this somehow helps you (also, you
may also wish to avoid top posting for reading clarity.)

For a view of what I was saying about ClientID, see:
http://msdn.microsoft.com/library/de...entIDTopic.asp
Nov 18 '05 #4

P: n/a
Thank you jm, I managed to get the name to display properly based on most
of your suggestions. Thank you again.

Thx, Lerp
"jm" <jo*************@yahoo.com> wrote in message
news:_%fnc.7930$536.1607804@attbi_s03...

"Lerp" <ad***@officience.ca> wrote in message
news:eQ**************@tk2msftngp13.phx.gbl...
Hi jm,

I am trying to display the client name on the label in the itemtemplate, but
first I have to read the clientid from the fourth field of the current row
being displayed, do a query based on that clientid, and assign the
clientname value to the label within the datalist loop. My problem is

that
I am unsure how to grab the value for the fourth column of the current row of the datalist loop. there is nothing after the elipsis. I am unsure

what
to write in order to grab that column value. I am coming from asp
background into .net.

Cheers, Lerp

"jm" <jo*************@yahoo.com> wrote in message
news:BPanc.6774$z06.1276684@attbi_s01...

"Lerp" <ad***@officience.ca> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
> Hi,
>
> I have this sub in which I am trying to get a client name from a second > table based on a clientid value in my datalist. I am having problems > grabbing the clientid value out of my datalist and putting it into my > variable curClientID. How do you grab a value out of a datalist

properly
> please?
>
> Thx,Lerp
> Here's my sub:
>
>
>
> 'THIS SUB HANDLES GRABBING CLIENT NAMES
> Sub dlBookings_OnItemDataBound(sender As Object, e As
DataListItemEventArgs)
>
> If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType =
> ListItemType.AlternatingItem Then
>
> ' Retrieve the Label control in the current DataListItem.
> Dim ClientNameLabel As Label =
> e.Item.FindControl("clientnamelabel")
>
>
> 'Trying to grab clientid here
>
> ********************************************
> Dim curClientID
> curClientID = e.item.FindControl("clientid")....
>
> ********************************************
>
>
>
>
> ' GRAB client name using ID from db here
> Dim clientlabel As String
> Dim strSQL as String
>
>
> 'SQL STATEMENT
> strSQL = "SELECT fullname FROM CLIENT WHERE clientid=" & curClientID > 'NEW CONNECTION OBJECT
> Dim MyConn as New
> SQLConnection(ConfigurationSettings.AppSettings("d bConn"))
>
> 'NEW DATAREADER
> Dim objDR as SQLDataReader
>
> 'NEW COMMAND OBJECT
> Dim Cmd as New SQLCommand(strSQL, MyConn)
>
> 'OPEN CONNECTION
> MyConn.Open()
>
> 'EXECUTE QUERY AND RETRIEVE DATA INTO READER
> objDR =

Cmd.ExecuteReader(system.data.CommandBehavior.Clos eConnection)
>
>
> WHILE objDR.Read
> clientlabel = objDR("fullname")
> END While
>
> myConn.close
>
> 'redisplay it in the DataList.
> clientnamelabel.Text = clientlabel
>
> End If
>
>
>
> End Sub

If the curClientID is a label, can't you just get the .text of it? You only
told it to find the control. You did not access any of the properties
associated with it (unless there is something after the elipsis ...).
---

Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.677 / Virus Database: 439 - Release Date: 5/4/2004
Okay, first, just to let you know "ClientID" is a reserved word in .net

for getting the unique asp.net generated value for a given control; especially
useful in building javascript applications. It allows you to use the
objects on the client that asp.net generates a unique number for (like the
ctl1, etc. do a view source for an example.)

I believe you are using ClientID like OrderID and it looks like you want to retrieve a value from a datalist that you generate (and is visible) and then use that value for use in another query that those values are then sent to
the user.

Say you have a datagrid:

sub mysub(sender as Object, e as DataGridItemEventArgs)

CType(e.Items.Cells(0).Controls(0), Button).visible = false

so, in:

"Dim curClientID > > > curClientID = e.item.FindControl("clientid")...."
put:

Dim curClientID as String = e.Items.Cells(?).Controls(?).label).text

to retrieve the value at that location. Use the type of control you have
and its associated methods and properties (like .text).

Look here for a great primer (I know you may not be using the datagrid, but it will still help you.):

http://aspnet.4guysfromrolla.com/art...71002-1.3.aspx

in here you will see an example close to what I have shown you. However,
you should go to the first part of the set of articles and start over:
http://aspnet.4guysfromrolla.com/articles/040502-1.aspx

However, it looks like to get your data for your first datalist that you are sending to the client you have some SQL or data somewhere you are retrieving to build the datalist in the first place. So, instead of printing out the
datalist first and then searching for the newly printed out value from your new datalist, just get the value from the retrieved SQL results, save it a
variable and then use THAT value for your next query.

For example, assume that I just queried a database and retreived my results. You could get a value at the proper point in your retrieval by:

dim curClientID as string =
datasource.tables(0).rows(0)("client_id").toString ()

Then, use curClientID below in your next set of code.

I hope I understood your problem and that this somehow helps you (also, you may also wish to avoid top posting for reading clarity.)

For a view of what I was saying about ClientID, see:
http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfSystemWebUIControlClassClientIDTopic.asp
"Lerp" <ad***@officience.ca> wrote in message
news:eQ**************@tk2msftngp13.phx.gbl...
Hi jm,

I am trying to display the client name on the label in the itemtemplate, but
first I have to read the clientid from the fourth field of the current row being displayed, do a query based on that clientid, and assign the
clientname value to the label within the datalist loop. My problem is

that
I am unsure how to grab the value for the fourth column of the current row of the datalist loop. there is nothing after the elipsis. I am unsure

what
to write in order to grab that column value. I am coming from asp
background into .net.

Cheers, Lerp

"jm" <jo*************@yahoo.com> wrote in message
news:BPanc.6774$z06.1276684@attbi_s01...

"Lerp" <ad***@officience.ca> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
> Hi,
>
> I have this sub in which I am trying to get a client name from a second > table based on a clientid value in my datalist. I am having
problems > grabbing the clientid value out of my datalist and putting it into my > variable curClientID. How do you grab a value out of a datalist

properly
> please?
>
> Thx,Lerp
> Here's my sub:
>
>
>
> 'THIS SUB HANDLES GRABBING CLIENT NAMES
> Sub dlBookings_OnItemDataBound(sender As Object, e As
DataListItemEventArgs)
>
> If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType =
> ListItemType.AlternatingItem Then
>
> ' Retrieve the Label control in the current DataListItem.
> Dim ClientNameLabel As Label =
> e.Item.FindControl("clientnamelabel")
>
>
> 'Trying to grab clientid here
>
> ********************************************
> Dim curClientID
> curClientID = e.item.FindControl("clientid")....
>
> ********************************************
>
>
>
>
> ' GRAB client name using ID from db here
> Dim clientlabel As String
> Dim strSQL as String
>
>
> 'SQL STATEMENT
> strSQL = "SELECT fullname FROM CLIENT WHERE clientid=" &

curClientID > 'NEW CONNECTION OBJECT
> Dim MyConn as New
> SQLConnection(ConfigurationSettings.AppSettings("d bConn"))
>
> 'NEW DATAREADER
> Dim objDR as SQLDataReader
>
> 'NEW COMMAND OBJECT
> Dim Cmd as New SQLCommand(strSQL, MyConn)
>
> 'OPEN CONNECTION
> MyConn.Open()
>
> 'EXECUTE QUERY AND RETRIEVE DATA INTO READER
> objDR =

Cmd.ExecuteReader(system.data.CommandBehavior.Clos eConnection)
>
>
> WHILE objDR.Read
> clientlabel = objDR("fullname")
> END While
>
> myConn.close
>
> 'redisplay it in the DataList.
> clientnamelabel.Text = clientlabel
>
> End If
>
>
>
> End Sub

If the curClientID is a label, can't you just get the .text of it?
You only
told it to find the control. You did not access any of the properties
associated with it (unless there is something after the elipsis ...).
---

Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.677 / Virus Database: 439 - Release Date: 5/4/2004

Okay, first, just to let you know "ClientID" is a reserved word in .net

for getting the unique asp.net generated value for a given control; especially
useful in building javascript applications. It allows you to use the
objects on the client that asp.net generates a unique number for (like the
ctl1, etc. do a view source for an example.)

I believe you are using ClientID like OrderID and it looks like you want to retrieve a value from a datalist that you generate (and is visible) and then use that value for use in another query that those values are then sent to
the user.

Say you have a datagrid:

sub mysub(sender as Object, e as DataGridItemEventArgs)

CType(e.Items.Cells(0).Controls(0), Button).visible = false

so, in:

"Dim curClientID > > > curClientID = e.item.FindControl("clientid")...."

put:

Dim curClientID as String = e.Items.Cells(?).Controls(?).label).text

to retrieve the value at that location. Use the type of control you have
and its associated methods and properties (like .text).

Look here for a great primer (I know you may not be using the datagrid,

but it will still help you.):

http://aspnet.4guysfromrolla.com/art...71002-1.3.aspx

in here you will see an example close to what I have shown you. However,
you should go to the first part of the set of articles and start over:
http://aspnet.4guysfromrolla.com/articles/040502-1.aspx

However, it looks like to get your data for your first datalist that you are sending to the client you have some SQL or data somewhere you are retrieving to build the datalist in the first place. So, instead of printing out the
datalist first and then searching for the newly printed out value from your new datalist, just get the value from the retrieved SQL results, save it a
variable and then use THAT value for your next query.

For example, assume that I just queried a database and retreived my results. You could get a value at the proper point in your retrieval by:

dim curClientID as string =
datasource.tables(0).rows(0)("client_id").toString ()

Then, use curClientID below in your next set of code.

I hope I understood your problem and that this somehow helps you (also, you may also wish to avoid top posting for reading clarity.)

For a view of what I was saying about ClientID, see:
http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfSystemWebUIControlClassClientIDTopic.asp

Nov 18 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.