freelanceprogrammers.org Forum Index » ASP

Re: How to send Datatable to datagrid to database ?


View user's profile Post To page top
peter_brunone Posted: Thu Jan 13, 2005 8:16 pm


Joined: 11 Jan 2006

Posts: 38
Re: How to send Datatable to datagrid to database ?
Hi Mario,

   First of all, why are you saving the datatable to session and recreating the
datagrid on the next page?  Wouldn`t it be a whole lot easier to let ViewState
persist the data for you?

   As for putting it into the database, how many rows are we talking about
here?  And which part is confusing you, doing an insert into a database, or
something else?

Cheers,

Peter

From: "Mario Ramos (Ext)" mario.ramos.ext@...

Hi,

I`m having a bit of trouble with an asp.net webform.

I`m using VB.NET and Oracle.

I have a form with 4 textboxes, a dropdown and a datagrid.

Users fill the form and the data fills the datagrid.

The datagrid is not bound to any database table.

What I want to do is after the users are satisfied with the data entered, insert
the data into the database.
But this should only happen in a second aspx page (confirmation page).

So I`ve saved the data entered into the datagrid to a datatable, which is saved
to a session.
In the 2nd page I fill a new datagrid with the data.

What I don`t know what to do is save at this point the data to the oracle
database.

Please help. Been over this for a week now.

Mário Ramos
SADTEAM - Siemens Archibus Development Team
Siemens Medical Solutions
Edifício Minho
Telf.: +351 22 999 22 84
Fax.: +351 22 999 22 88
Email: mario.ramos.ext@...



[Non-text portions of this message have been removed]
Reply with quote
Send private message
View user's profile Post To page top
mjpr Posted: Thu Jan 13, 2005 8:29 pm


Joined: 06 Jan 2005

Posts: 6
Re: How to send Datatable to datagrid to database ?
Hi Peter,

Never thought of using the viewstate for that...
We`re talking about something between 1 to maybe 10 rows... maybe more, but
rarely.
Yep... very confused about getting the rows from the datagrid and sending it to
the database.

Some code would help, please.

Thanks for your attention.

-----Original Message-----
From: Peter Brunone [mailto:peterlists@...]
Sent: quinta-feira, 13 de Janeiro de 2005 14:16
To: AspNetAnyQuestionIsOk@yahoogroups.com
Subject: re: [AspNetAnyQuestionIsOk] How to send Datatable to datagrid to
database ?


Hi Mario,

First of all, why are you saving the datatable to session and recreating the
datagrid on the next page? Wouldn`t it be a whole lot easier to let ViewState
persist the data for you?

As for putting it into the database, how many rows are we talking about here?
And which part is confusing you, doing an insert into a database, or something
else?

Cheers,

Peter

From: "Mario Ramos (Ext)" mario.ramos.ext@...

Hi,

I`m having a bit of trouble with an asp.net webform.

I`m using VB.NET and Oracle.

I have a form with 4 textboxes, a dropdown and a datagrid.

Users fill the form and the data fills the datagrid.

The datagrid is not bound to any database table.

What I want to do is after the users are satisfied with the data entered, insert
the data into the database.
But this should only happen in a second aspx page (confirmation page).

So I`ve saved the data entered into the datagrid to a datatable, which is saved
to a session.
In the 2nd page I fill a new datagrid with the data.

What I don`t know what to do is save at this point the data to the oracle
database.

Please help. Been over this for a week now.

Mário Ramos
SADTEAM - Siemens Archibus Development Team
Siemens Medical Solutions
Edifício Minho
Telf.: +351 22 999 22 84
Fax.: +351 22 999 22 88
Email: mario.ramos.ext@...



[Non-text portions of this message have been removed]



_____

Yahoo! Groups Links


* To visit your group on the web, go to:
http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/


* To unsubscribe from this group, send an email to:
AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com
<mailto:AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com?subject=Unsubscribe>


* Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
<http://docs.yahoo.com/info/terms/> .




[Non-text portions of this message have been removed]
Reply with quote
Send private message
View user's profile Post To page top
mjpr Posted: Thu Jan 13, 2005 8:40 pm


Joined: 06 Jan 2005

Posts: 6
Re: How to send Datatable to datagrid to database ?
At this point I`m using this code to print out the values inserted to the
datagrid:

Dim workTable As DataTable = New DataTable("mat_request_line")

workTable = Session("mat_request_line")

`

Dim myCol As DataColumn

Dim myRow As DataRow

Dim currRows() As DataRow = workTable.Select(Nothing, Nothing,
DataViewRowState.CurrentRows)

If (currRows.Length < 1) Then

Response.Write("<br>No Current Rows Found<br>")

Else

For Each myCol In workTable.Columns

Response.Write(" " & myCol.ColumnName)

Next

Response.Write("<br>")

For Each myRow In currRows

For Each myCol In workTable.Columns

Response.Write(" " & myRow(myCol).ToString())

Next

Response.Write("<br>")

Dim rowState As String = System.Enum.GetName(myRow.RowState.GetType(),
myRow.RowState)

Next

End If





-----Original Message-----
From: Mario Ramos (Ext)
Sent: quinta-feira, 13 de Janeiro de 2005 14:30
To: AspNetAnyQuestionIsOk@yahoogroups.com
Subject: RE: [AspNetAnyQuestionIsOk] How to send Datatable to datagrid to
database ?


Hi Peter,

Never thought of using the viewstate for that...
We`re talking about something between 1 to maybe 10 rows... maybe more, but
rarely.
Yep... very confused about getting the rows from the datagrid and sending it to
the database.

Some code would help, please.

Thanks for your attention.

-----Original Message-----
From: Peter Brunone [mailto:peterlists@...]
Sent: quinta-feira, 13 de Janeiro de 2005 14:16
To: AspNetAnyQuestionIsOk@yahoogroups.com
Subject: re: [AspNetAnyQuestionIsOk] How to send Datatable to datagrid to
database ?


Hi Mario,

First of all, why are you saving the datatable to session and recreating the
datagrid on the next page? Wouldn`t it be a whole lot easier to let ViewState
persist the data for you?

As for putting it into the database, how many rows are we talking about here?
And which part is confusing you, doing an insert into a database, or something
else?

Cheers,

Peter

From: "Mario Ramos (Ext)" mario.ramos.ext@...

Hi,

I`m having a bit of trouble with an asp.net webform.

I`m using VB.NET and Oracle.

I have a form with 4 textboxes, a dropdown and a datagrid.

Users fill the form and the data fills the datagrid.

The datagrid is not bound to any database table.

What I want to do is after the users are satisfied with the data entered, insert
the data into the database.
But this should only happen in a second aspx page (confirmation page).

So I`ve saved the data entered into the datagrid to a datatable, which is saved
to a session.
In the 2nd page I fill a new datagrid with the data.

What I don`t know what to do is save at this point the data to the oracle
database.

Please help. Been over this for a week now.

Mário Ramos
SADTEAM - Siemens Archibus Development Team
Siemens Medical Solutions
Edifício Minho
Telf.: +351 22 999 22 84
Fax.: +351 22 999 22 88
Email: mario.ramos.ext@...



[Non-text portions of this message have been removed]



_____

Yahoo! Groups Links


* To visit your group on the web, go to:
http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/


* To unsubscribe from this group, send an email to:
AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com
<mailto:AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com?subject=Unsubscribe>


* Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
<http://docs.yahoo.com/info/terms/> .




[Non-text portions of this message have been removed]



_____

Yahoo! Groups Links


* To visit your group on the web, go to:
http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/


* To unsubscribe from this group, send an email to:
AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com
<mailto:AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com?subject=Unsubscribe>


* Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
<http://docs.yahoo.com/info/terms/> .




[Non-text portions of this message have been removed]
Reply with quote
Send private message
View user's profile Post To page top
peter_brunone Posted: Thu Jan 13, 2005 9:35 pm


Joined: 11 Jan 2006

Posts: 38
Re: How to send Datatable to datagrid to database ?
   Here`s a good tutorial for data access with Oracle:
http://www.startvbdotnet.com/ado/oracle.aspx See the section on inserting
records (if you get a server error, try refreshing the page; I had to do this
once).

From: "Mario Ramos (Ext)" mario.ramos.ext@...

Hi Peter,

Never thought of using the viewstate for that...
We`re talking about something between 1 to maybe 10 rows... maybe more, but
rarely.
Yep... very confused about getting the rows from the datagrid and sending it to
the database.

Some code would help, please.

Thanks for your attention.

From: Peter Brunone [mailto:peterlists@...]

Hi Mario,

First of all, why are you saving the datatable to session and recreating the
datagrid on the next page? Wouldn`t it be a whole lot easier to let ViewState
persist the data for you?

As for putting it into the database, how many rows are we talking about here?
And which part is confusing you, doing an insert into a database, or something
else?

Cheers,

Peter

From: "Mario Ramos (Ext)" mario.ramos.ext@...

Hi,

I`m having a bit of trouble with an asp.net webform.

I`m using VB.NET and Oracle.

I have a form with 4 textboxes, a dropdown and a datagrid.

Users fill the form and the data fills the datagrid.

The datagrid is not bound to any database table.

What I want to do is after the users are satisfied with the data entered, insert
the data into the database.
But this should only happen in a second aspx page (confirmation page).

So I`ve saved the data entered into the datagrid to a datatable, which is saved
to a session.
In the 2nd page I fill a new datagrid with the data.

What I don`t know what to do is save at this point the data to the oracle
database.

Please help. Been over this for a week now.

Mário Ramos
SADTEAM - Siemens Archibus Development Team
Siemens Medical Solutions
Edifício Minho
Telf.: +351 22 999 22 84
Fax.: +351 22 999 22 88
Email: mario.ramos.ext@...


[Non-text portions of this message have been removed]
Reply with quote
Send private message
Post new topic Reply to topic
Display posts from previous:   
 

All times are GMT
Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Freelace Website Designer - Customer web design and software building.
China Wholesale - Electronics Products
Character Studio - Tutorials and Help