Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 29th, 2004, 07:06 PM
Authorized User
 
Join Date: Mar 2004
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to frankv25
Default filling Dataset with datagrid variables

Question:

Is it possible to fill a dataset with Datagrid Variables?

Let's take a dtg with 3 tables and a select field.
If I select a new index I want t0 store the values of the selectedIndex in a dataset which i'll put in a
"Session("dts") = myDTS" which I can take to the following page so I can fill a new datagrid with the dataset of selected items from the previous datagrid.

I tried this :

dtsFullOrder = new Dataset()

dtsFullOrder.Tables(0).Rows(count - 1).Item(0) = dtgItems.SelectedItem.Cells(1).Text()
dtsFullOrder.Tables(0).Rows(count - 1).Item(1) = dtgItems.SelectedItem.Cells(2).Text()
dtsFullOrder.Tables(0).Rows(count - 1).Item(2) = dtgItems.SelectedItem.Cells(3).Text()

Session("dtsFullOrder") = dtsFullOrder
But it doesn't work like that.

any suggestions?
I don't want to store the selected data in a tempDatabase

Thank you in advance.
Frank

Frank Vandeven
Belgium
__________________
Frank Vandeven
Belgium
 
Old August 30th, 2004, 01:05 PM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post
Default

I'm not sure how you fill your dataset,when you make a dataset(datatable),it should have a structure or schema(I mean some columns should be declared within your DataTable object)
I didnt see that in your code ...
although I dont know how you have filled your datagrid(with a dataset or something else?)....
why dont you just set your Session with the SelectedItem of your grid instead of tree cells(its a DataGridItem object)so in the new page you could work with this DataGridItem easier....(you dont need any temp dataset here although if you want to work it its better to be declared as static becouse of preserving your data in Page_Load event)
Hope I didnt make you confused too much ...
HtH.

--------------------------------------------
Mehdi.:)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Filling ComboBox from Dataset dcathers C# 9 June 15th, 2013 03:31 AM
Filling out DataSet from Datagrid MAKO C# 2 May 13th, 2006 08:15 AM
filling of datagrid rahulyadav23 .NET Framework 2.0 2 June 29th, 2005 06:24 AM
filling of dataset abhimca_1 ADO.NET 1 August 6th, 2003 08:23 AM
filling of dataset abhimca_1 ADO.NET 2 August 5th, 2003 03:05 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.