473,325 Members | 2,828 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Clearing the data....

I have created a form on the web that allows us to update a table on our SQL
server using the INSERT function.

The way the page is constructed is that the results panel refreshes with the
new data after a post has been issued. This is fine and dandy, but if we
were to refresh the browser, this would duplicate another record with the
same details.

I would there like to either:

A) Clear the input from the screen after a POST has been issued or,
B) Clear the DataSet data so that this will not duplicate the information if
a refresh was issued.

Please can you help

Thanks
Paul
Nov 18 '05 #1
7 1195
Simplest solution: After the INSERT is performed, do a Response.Redirect
back to the same page.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Paul King" <ki******@hotmail.com> wrote in message
news:eS**************@TK2MSFTNGP09.phx.gbl...
I have created a form on the web that allows us to update a table on our SQL server using the INSERT function.

The way the page is constructed is that the results panel refreshes with the new data after a post has been issued. This is fine and dandy, but if we
were to refresh the browser, this would duplicate another record with the
same details.

I would there like to either:

A) Clear the input from the screen after a POST has been issued or,
B) Clear the DataSet data so that this will not duplicate the information if a refresh was issued.

Please can you help

Thanks
Paul

Nov 18 '05 #2
Kevin

Thanks for the information - the only problem is that you can Invoke the
Response.Redirect or Server.Transfer to clear the entry of the form.

However if you hit the refresh button on a blank form this will duplicate
another entry into the SQL from the DataSet. I need to somehow also clear
the DataSet.

Regards
Paul.

"Kevin Spencer" <ks******@takempis.com> wrote in message
news:et**************@TK2MSFTNGP09.phx.gbl...
Simplest solution: After the INSERT is performed, do a Response.Redirect
back to the same page.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Paul King" <ki******@hotmail.com> wrote in message
news:eS**************@TK2MSFTNGP09.phx.gbl...
I have created a form on the web that allows us to update a table on our SQL
server using the INSERT function.

The way the page is constructed is that the results panel refreshes with

the
new data after a post has been issued. This is fine and dandy, but if we were to refresh the browser, this would duplicate another record with the same details.

I would there like to either:

A) Clear the input from the screen after a POST has been issued or,
B) Clear the DataSet data so that this will not duplicate the

information if
a refresh was issued.

Please can you help

Thanks
Paul


Nov 18 '05 #3
I didn't say anything about Server.Transfer. Response.Redirect tells the
browser to request a new URL. Refreshing the page redirected to does just
that: it refreshes the page that the Redirect linked to.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Paul King" <ki******@hotmail.com> wrote in message
news:eB**************@TK2MSFTNGP09.phx.gbl...
Kevin

Thanks for the information - the only problem is that you can Invoke the
Response.Redirect or Server.Transfer to clear the entry of the form.

However if you hit the refresh button on a blank form this will duplicate
another entry into the SQL from the DataSet. I need to somehow also clear
the DataSet.

Regards
Paul.

"Kevin Spencer" <ks******@takempis.com> wrote in message
news:et**************@TK2MSFTNGP09.phx.gbl...
Simplest solution: After the INSERT is performed, do a Response.Redirect
back to the same page.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Paul King" <ki******@hotmail.com> wrote in message
news:eS**************@TK2MSFTNGP09.phx.gbl...
I have created a form on the web that allows us to update a table on
our
SQL
server using the INSERT function.

The way the page is constructed is that the results panel refreshes
with the
new data after a post has been issued. This is fine and dandy, but if

we were to refresh the browser, this would duplicate another record with the same details.

I would there like to either:

A) Clear the input from the screen after a POST has been issued or,
B) Clear the DataSet data so that this will not duplicate the

information
if
a refresh was issued.

Please can you help

Thanks
Paul



Nov 18 '05 #4
No problems Kevin, I will use the Response.Redirect.

I just done a web search on Response.Redirect and it recommended to use
Server.Transfer as this was less intensive on IIS.

Regards
Paul.

"Kevin Spencer" <ks******@takempis.com> wrote in message
news:eS**************@TK2MSFTNGP09.phx.gbl...
I didn't say anything about Server.Transfer. Response.Redirect tells the
browser to request a new URL. Refreshing the page redirected to does just
that: it refreshes the page that the Redirect linked to.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Paul King" <ki******@hotmail.com> wrote in message
news:eB**************@TK2MSFTNGP09.phx.gbl...
Kevin

Thanks for the information - the only problem is that you can Invoke the
Response.Redirect or Server.Transfer to clear the entry of the form.

However if you hit the refresh button on a blank form this will duplicate
another entry into the SQL from the DataSet. I need to somehow also clear the DataSet.

Regards
Paul.

"Kevin Spencer" <ks******@takempis.com> wrote in message
news:et**************@TK2MSFTNGP09.phx.gbl...
Simplest solution: After the INSERT is performed, do a Response.Redirect back to the same page.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Paul King" <ki******@hotmail.com> wrote in message
news:eS**************@TK2MSFTNGP09.phx.gbl...
> I have created a form on the web that allows us to update a table on our SQL
> server using the INSERT function.
>
> The way the page is constructed is that the results panel refreshes with the
> new data after a post has been issued. This is fine and dandy, but

if we
> were to refresh the browser, this would duplicate another record
with the
> same details.
>
> I would there like to either:
>
> A) Clear the input from the screen after a POST has been issued or,
> B) Clear the DataSet data so that this will not duplicate the

information
if
> a refresh was issued.
>
> Please can you help
>
> Thanks
> Paul
>
>



Nov 18 '05 #5
Response.Redirect sends a Response to the Client browser, which tells it to
request another page. Yes, this does mean that the server will receive 2
requests from the client, whereas Server.Transfer transfers control to
another class without redirecting. However, there are reasons for both
methods to exist. Only Response.Redirect will ensure that a Refresh from the
browser will not cause the last PostBack to re-occur. It's not like the 2
are interchangeable. When you need to hammer nails, use a hammer, not a
screwdriver.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Paul King" <ki******@hotmail.com> wrote in message
news:eR**************@TK2MSFTNGP10.phx.gbl...
No problems Kevin, I will use the Response.Redirect.

I just done a web search on Response.Redirect and it recommended to use
Server.Transfer as this was less intensive on IIS.

Regards
Paul.

"Kevin Spencer" <ks******@takempis.com> wrote in message
news:eS**************@TK2MSFTNGP09.phx.gbl...
I didn't say anything about Server.Transfer. Response.Redirect tells the
browser to request a new URL. Refreshing the page redirected to does just
that: it refreshes the page that the Redirect linked to.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Paul King" <ki******@hotmail.com> wrote in message
news:eB**************@TK2MSFTNGP09.phx.gbl...
Kevin

Thanks for the information - the only problem is that you can Invoke the Response.Redirect or Server.Transfer to clear the entry of the form.

However if you hit the refresh button on a blank form this will duplicate another entry into the SQL from the DataSet. I need to somehow also clear the DataSet.

Regards
Paul.

"Kevin Spencer" <ks******@takempis.com> wrote in message
news:et**************@TK2MSFTNGP09.phx.gbl...
> Simplest solution: After the INSERT is performed, do a Response.Redirect > back to the same page.
>
> --
> HTH,
> Kevin Spencer
> .Net Developer
> Microsoft MVP
> Big things are made up
> of lots of little things.
>
> "Paul King" <ki******@hotmail.com> wrote in message
> news:eS**************@TK2MSFTNGP09.phx.gbl...
> > I have created a form on the web that allows us to update a table on our
> SQL
> > server using the INSERT function.
> >
> > The way the page is constructed is that the results panel
refreshes
with
> the
> > new data after a post has been issued. This is fine and dandy,
but if we
> > were to refresh the browser, this would duplicate another record with the
> > same details.
> >
> > I would there like to either:
> >
> > A) Clear the input from the screen after a POST has been issued

or, > > B) Clear the DataSet data so that this will not duplicate the
information
> if
> > a refresh was issued.
> >
> > Please can you help
> >
> > Thanks
> > Paul
> >
> >
>
>



Nov 18 '05 #6
I like your analogy.

I guess when ASP 2.0 is officially released this might include better, more
efficient classes??

Regards
Paul.

"Kevin Spencer" <ks******@takempis.com> wrote in message
news:u9**************@TK2MSFTNGP11.phx.gbl...
Response.Redirect sends a Response to the Client browser, which tells it to request another page. Yes, this does mean that the server will receive 2
requests from the client, whereas Server.Transfer transfers control to
another class without redirecting. However, there are reasons for both
methods to exist. Only Response.Redirect will ensure that a Refresh from the browser will not cause the last PostBack to re-occur. It's not like the 2
are interchangeable. When you need to hammer nails, use a hammer, not a
screwdriver.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Paul King" <ki******@hotmail.com> wrote in message
news:eR**************@TK2MSFTNGP10.phx.gbl...
No problems Kevin, I will use the Response.Redirect.

I just done a web search on Response.Redirect and it recommended to use
Server.Transfer as this was less intensive on IIS.

Regards
Paul.

"Kevin Spencer" <ks******@takempis.com> wrote in message
news:eS**************@TK2MSFTNGP09.phx.gbl...
I didn't say anything about Server.Transfer. Response.Redirect tells the browser to request a new URL. Refreshing the page redirected to does just that: it refreshes the page that the Redirect linked to.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Paul King" <ki******@hotmail.com> wrote in message
news:eB**************@TK2MSFTNGP09.phx.gbl...
> Kevin
>
> Thanks for the information - the only problem is that you can Invoke the > Response.Redirect or Server.Transfer to clear the entry of the form.
>
> However if you hit the refresh button on a blank form this will duplicate
> another entry into the SQL from the DataSet. I need to somehow also

clear
> the DataSet.
>
> Regards
> Paul.
>
> "Kevin Spencer" <ks******@takempis.com> wrote in message
> news:et**************@TK2MSFTNGP09.phx.gbl...
> > Simplest solution: After the INSERT is performed, do a

Response.Redirect
> > back to the same page.
> >
> > --
> > HTH,
> > Kevin Spencer
> > .Net Developer
> > Microsoft MVP
> > Big things are made up
> > of lots of little things.
> >
> > "Paul King" <ki******@hotmail.com> wrote in message
> > news:eS**************@TK2MSFTNGP09.phx.gbl...
> > > I have created a form on the web that allows us to update a
table on our
> > SQL
> > > server using the INSERT function.
> > >
> > > The way the page is constructed is that the results panel refreshes with
> > the
> > > new data after a post has been issued. This is fine and dandy, but
if
> we
> > > were to refresh the browser, this would duplicate another record

with
> the
> > > same details.
> > >
> > > I would there like to either:
> > >
> > > A) Clear the input from the screen after a POST has been issued

or, > > > B) Clear the DataSet data so that this will not duplicate the
> information
> > if
> > > a refresh was issued.
> > >
> > > Please can you help
> > >
> > > Thanks
> > > Paul
> > >
> > >
> >
> >
>
>



Nov 18 '05 #7
ASP 2.0 will include new features and classes. However, Response.Redirect
and Server.Transfer are not likely to be affected.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Paul King" <ki******@hotmail.com> wrote in message
news:#q**************@TK2MSFTNGP11.phx.gbl...
I like your analogy.

I guess when ASP 2.0 is officially released this might include better, more efficient classes??

Regards
Paul.

"Kevin Spencer" <ks******@takempis.com> wrote in message
news:u9**************@TK2MSFTNGP11.phx.gbl...
Response.Redirect sends a Response to the Client browser, which tells it

to
request another page. Yes, this does mean that the server will receive 2
requests from the client, whereas Server.Transfer transfers control to
another class without redirecting. However, there are reasons for both
methods to exist. Only Response.Redirect will ensure that a Refresh from

the
browser will not cause the last PostBack to re-occur. It's not like the 2
are interchangeable. When you need to hammer nails, use a hammer, not a
screwdriver.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Paul King" <ki******@hotmail.com> wrote in message
news:eR**************@TK2MSFTNGP10.phx.gbl...
No problems Kevin, I will use the Response.Redirect.

I just done a web search on Response.Redirect and it recommended to use Server.Transfer as this was less intensive on IIS.

Regards
Paul.

"Kevin Spencer" <ks******@takempis.com> wrote in message
news:eS**************@TK2MSFTNGP09.phx.gbl...
> I didn't say anything about Server.Transfer. Response.Redirect tells the > browser to request a new URL. Refreshing the page redirected to does

just
> that: it refreshes the page that the Redirect linked to.
>
> --
> HTH,
> Kevin Spencer
> .Net Developer
> Microsoft MVP
> Big things are made up
> of lots of little things.
>
> "Paul King" <ki******@hotmail.com> wrote in message
> news:eB**************@TK2MSFTNGP09.phx.gbl...
> > Kevin
> >
> > Thanks for the information - the only problem is that you can Invoke the
> > Response.Redirect or Server.Transfer to clear the entry of the
form. > >
> > However if you hit the refresh button on a blank form this will
duplicate
> > another entry into the SQL from the DataSet. I need to somehow also clear
> > the DataSet.
> >
> > Regards
> > Paul.
> >
> > "Kevin Spencer" <ks******@takempis.com> wrote in message
> > news:et**************@TK2MSFTNGP09.phx.gbl...
> > > Simplest solution: After the INSERT is performed, do a
Response.Redirect
> > > back to the same page.
> > >
> > > --
> > > HTH,
> > > Kevin Spencer
> > > .Net Developer
> > > Microsoft MVP
> > > Big things are made up
> > > of lots of little things.
> > >
> > > "Paul King" <ki******@hotmail.com> wrote in message
> > > news:eS**************@TK2MSFTNGP09.phx.gbl...
> > > > I have created a form on the web that allows us to update a

table
on
> our
> > > SQL
> > > > server using the INSERT function.
> > > >
> > > > The way the page is constructed is that the results panel

refreshes
> with
> > > the
> > > > new data after a post has been issued. This is fine and dandy, but
if
> > we
> > > > were to refresh the browser, this would duplicate another
record with
> > the
> > > > same details.
> > > >
> > > > I would there like to either:
> > > >
> > > > A) Clear the input from the screen after a POST has been

issued or,
> > > > B) Clear the DataSet data so that this will not duplicate the
> > information
> > > if
> > > > a refresh was issued.
> > > >
> > > > Please can you help
> > > >
> > > > Thanks
> > > > Paul
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Nov 18 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Jeff Levinson [mcsd] | last post by:
Not as far as I know. The easiest way is just to create a loop to set all of the controls values to "". You'll probably have to use a typeof statement to come up with specific clearing methods for...
0
by: Gary | last post by:
I have a problem with the datagrid not clearing when the datasource changes, a few fields remain on the screen and even when new data would fill those grid squares the old data remains. I wind...
3
by: Brad | last post by:
I'm working with a DataGrid in C#, and the user needs to be able add and remove columns from the DataGrid on the fly, without opening and closing the form. The scenario is this. I have a setup...
6
by: JJ_377 | last post by:
In a "Save and Quit" button on my web app form (aspx), I have the following code that is supposed to clear a session variable (an user id) and redirect to a logon page: Session.Clear()...
15
by: roberts.noah | last post by:
I ran across some code that called memset(this, 0, sizeof(*this)) in the member function of a structure in C++. This just looked wrong to me so I did some web searching and it does indeed seem...
2
by: Eytch | last post by:
Hey: I am a rookie developer so please bear with me. I want to develop a small application for my office but I am having trouble clearing a page that has required fields. If I make a textbox...
0
by: Hubert | last post by:
Hi I created XmlDataDocument synchronized with DataSet. everythingi is grat until I need to clear all data from it. I've tried Reset(), Clear(), RemoveChild etc. but nothing works. The only way I...
0
by: negmat | last post by:
Hello everyone, I have the following question: I am aware that the objects currently in the cache can be viewed by issuing the following command: SELECT * FROM master.dbo.Syscacheobjects ...
1
by: hathan | last post by:
I am using the code below to connect to a Access database and the first time roumd it works perfectly but then it errors. I think that the datatable might need clearing but i dont no how to do this....
6
by: =?Utf-8?B?R2Vv?= | last post by:
Hi, I use lots of sessions. I want to clear the unwanted sessions when I leave a page. I cant use ViewState as it will slow down the pages. Could some one help me on this?
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.