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

how do i pass data table

P: n/a
hey all,
i have a gridView with editing available. when a user clicks the update link
for a row, how do i pass the entire data table as a parameter to my business
layer?

thanks,
rodchar
Sep 22 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
i thought you could simply access GridView.DataSource but in my tests,
"this.GridView1.DataSource" is null after a postback. as a work-around, you
could add the DataTable to the Viewstate before the edit event (i.e. the
first page_load), and then access it from Viewstate for the edit postback.
Or you could just refetch the datatable.

does that make sense?
tim
"rodchar" <ro*****@discussions.microsoft.comwrote in message
news:49**********************************@microsof t.com...
hey all,
i have a gridView with editing available. when a user clicks the update
link
for a row, how do i pass the entire data table as a parameter to my
business
layer?

thanks,
rodchar

Sep 22 '06 #2

P: n/a
What I do in many circumstances, is, like the last post said, pass the
DataTable to viewstate as a property of the class:
Private Property EmployeeData() As System.Data.DataTable
Get
Dim o As Object = ViewState("EmployeeData")
If o Is Nothing Then
Return Nothing
Else
Return o
End If
End Get
Set(ByVal value As System.Data.DataTable)
ViewState("EmployeeData") = value
End Set
End Property

--
David Wier
MVP/ASPInsider
http://aspnet101.com
http://aspexpress.com

"rodchar" <ro*****@discussions.microsoft.comwrote in message
news:49**********************************@microsof t.com...
hey all,
i have a gridView with editing available. when a user clicks the update
link
for a row, how do i pass the entire data table as a parameter to my
business
layer?

thanks,
rodchar

Sep 22 '06 #3

P: n/a
thank you.

"David Wier" wrote:
What I do in many circumstances, is, like the last post said, pass the
DataTable to viewstate as a property of the class:
Private Property EmployeeData() As System.Data.DataTable
Get
Dim o As Object = ViewState("EmployeeData")
If o Is Nothing Then
Return Nothing
Else
Return o
End If
End Get
Set(ByVal value As System.Data.DataTable)
ViewState("EmployeeData") = value
End Set
End Property

--
David Wier
MVP/ASPInsider
http://aspnet101.com
http://aspexpress.com

"rodchar" <ro*****@discussions.microsoft.comwrote in message
news:49**********************************@microsof t.com...
hey all,
i have a gridView with editing available. when a user clicks the update
link
for a row, how do i pass the entire data table as a parameter to my
business
layer?

thanks,
rodchar


Sep 26 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.