473,508 Members | 2,152 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how do i pass data table

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
3 2149
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
4583
by: Matt | last post by:
How to pass data back and forth between ASP and JSP page? Let's say I have Java objects, how to pass the data back to ASP page?? Or ASP has data, how to pass the data to JSP page?? Please...
0
2424
by: Matt | last post by:
My problem is to allow ASP to interact with JSP, and I pass JavaScript object in my approach, but I wonder if it will work in network, not just in local machine. For testing purposes, the...
7
23639
by: Matt | last post by:
In ASP, when we pass data between pages, we usually pass by query string. If we pass data by query string, that means we need to use submit button, not by regular button, and the form will pass to...
0
2494
by: Chan | last post by:
Hi, I am trying to send set of rows from my c# web service to Oracle stored procedure. I think I can get this done using OpenXML in SQL Server. How to implement this in Oracle Stored...
0
1905
by: Chan | last post by:
Hi, I am trying to send set of rows from my c# web service to Oracle stored procedure. I think I can get this done using OpenXML in SQL Server. How to implement this in Oracle Stored...
2
3001
by: Mark | last post by:
Hello - From an Access VBA module, I'm trying to pass a Table to a VB.Net class. I'm getting the following error running the VBA: "Unable to cast object of type System._ComObject to type...
2
5659
by: Anil Pundhir | last post by:
What is the best way to pass data to a web service. The client(to send data) has .net environment and also the server on which the web service is hosted also has the .net environment. Should I...
1
1715
by: ajax.sam | last post by:
hi all, i got 2 questions! i want to do these: 1. select @col1 from some_table where <some_conditions>; I can pass parameters by using Parameters.Add for <some_conditionsbut not for the @col1....
3
5444
Frinavale
by: Frinavale | last post by:
I've created a few ASP.NET Ajax Enable Server controls. There are 2 components to these controls: a server side Object that deals with the server side stuffs, and a client side Object that deals...
0
7225
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7124
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
7326
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
7385
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...
0
7498
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4707
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3195
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3182
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
766
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.