473,587 Members | 2,229 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Object in session question

I'm on a project where the prevoius developer wrote code like below. I
thought stuff like this was bad? Isn't he putting a page into a session
object? And what we are trying to do is hit the db via a Stored Proc to
create a datatable in most cases. This seems like a waste to me. Is this good?

Public Shared Function getSQL(ByRef thePage As Page) As ProjectName.SQL Server

If thePage.Session ("mySQLInit" ) = "1" Then

Return thePage.Session ("mySQL")
End If

thePage.Session ("mySQL") = New ProjectName.SQL Server
thePage.Session ("mySQLInit" ) = "1"

Return thePage.Session ("mySQL")
End Function

And then shoots to the SP to create datatable:

Sub FillDataGrid(By Ref gridData As System.Web.UI.W ebControls.Data Grid, ByVal
SQL As String, Optional ByVal bAddNew As Boolean = False)

Dim cnn As SqlConnection = New
SqlConnection(C onfigurationSet tings.AppSettin gs().Item("Conn ectionString"))

Dim dt As DataTable = New DataTable("")
Dim dr As DataRow

Dim objDA As SqlClient.SqlDa taAdapter
objDA = New SqlClient.SqlDa taAdapter

dt = ExecSQLReturnDT (SQL, objDA)

If bAddNew Then
dr = dt.NewRow
dt.Rows.InsertA t(dr, 0)
gridData.EditIt emIndex = 0
End If

gridData.DataSo urce = dt
gridData.DataBi nd()

End Sub

And I see dozens of this:

page.Page.Sessi on("psedit_PSHi storyID") = ""

Nov 19 '05 #1
7 1226
Chris wrote:
I'm on a project where the prevoius developer wrote code like below. I
thought stuff like this was bad? Isn't he putting a page into a session
object? And what we are trying to do is hit the db via a Stored Proc to
create a datatable in most cases. This seems like a waste to me. Is this good?

Public Shared Function getSQL(ByRef thePage As Page) As ProjectName.SQL Server

If thePage.Session ("mySQLInit" ) = "1" Then

Return thePage.Session ("mySQL")
End If

thePage.Session ("mySQL") = New ProjectName.SQL Server
thePage.Session ("mySQLInit" ) = "1"

Return thePage.Session ("mySQL")
End Function

the "thePage" is a reference to some Page object. (I don't
think you need the "ByRef" keyword here though, you don't
need to pass the reference itself by reference)
This page is used to get at the session, where a
"ProjectName.SQ LServer" object is stored/retrieved (whatever
that may be).

A different (better?) way to get at the session would
be through HttpContent.Cur rent.Session.

And then shoots to the SP to create datatable:

Sub FillDataGrid(By Ref gridData As System.Web.UI.W ebControls.Data Grid, ByVal
SQL As String, Optional ByVal bAddNew As Boolean = False)

Dim cnn As SqlConnection = New
SqlConnection(C onfigurationSet tings.AppSettin gs().Item("Conn ectionString"))

Dim dt As DataTable = New DataTable("")
Dim dr As DataRow

Dim objDA As SqlClient.SqlDa taAdapter
objDA = New SqlClient.SqlDa taAdapter

dt = ExecSQLReturnDT (SQL, objDA)

If bAddNew Then
dr = dt.NewRow
dt.Rows.InsertA t(dr, 0)
gridData.EditIt emIndex = 0
End If

gridData.DataSo urce = dt
gridData.DataBi nd()

End Sub

This DataTable is an internal structure, not a sql table.
One problem here could be that a complete sql-string is passed.
If you use values that are entered by users, then you could
be vulnerable to sql-injection attacks.

And I see dozens of this:

page.Page.Sessi on("psedit_PSHi storyID") = ""


Again a roundabout way to get at the session. I don't
think the extra ".Page" is needed.
Is really an empty string what is wanted here? You can
also "Remove" items completely from the session.

--
Hans Kesting
Nov 19 '05 #2
I hate to embarass you, but no, he's not putting a Page into a Session
variable. If you just read the code, the Function takes a Page as a
parameter, and conditionally sets a Session variable for the Page's Session.
I wouldn't call it elegant, but I wouldn't call it wrong either, at least
without knowing what kind of class "ProjectName.SQ LServer" is.

What exactly is your problem with this code? Using Session? It wouldn't be
in the CLR if Microsoft didn't think it was useful for something at least.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"Chris" <Ch***@discussi ons.microsoft.c om> wrote in message
news:9E******** *************** ***********@mic rosoft.com...
I'm on a project where the prevoius developer wrote code like below. I
thought stuff like this was bad? Isn't he putting a page into a session
object? And what we are trying to do is hit the db via a Stored Proc to
create a datatable in most cases. This seems like a waste to me. Is this
good?

Public Shared Function getSQL(ByRef thePage As Page) As
ProjectName.SQL Server

If thePage.Session ("mySQLInit" ) = "1" Then

Return thePage.Session ("mySQL")
End If

thePage.Session ("mySQL") = New ProjectName.SQL Server
thePage.Session ("mySQLInit" ) = "1"

Return thePage.Session ("mySQL")
End Function

And then shoots to the SP to create datatable:

Sub FillDataGrid(By Ref gridData As System.Web.UI.W ebControls.Data Grid,
ByVal
SQL As String, Optional ByVal bAddNew As Boolean = False)

Dim cnn As SqlConnection = New
SqlConnection(C onfigurationSet tings.AppSettin gs().Item("Conn ectionString"))

Dim dt As DataTable = New DataTable("")
Dim dr As DataRow

Dim objDA As SqlClient.SqlDa taAdapter
objDA = New SqlClient.SqlDa taAdapter

dt = ExecSQLReturnDT (SQL, objDA)

If bAddNew Then
dr = dt.NewRow
dt.Rows.InsertA t(dr, 0)
gridData.EditIt emIndex = 0
End If

gridData.DataSo urce = dt
gridData.DataBi nd()

End Sub

And I see dozens of this:

page.Page.Sessi on("psedit_PSHi storyID") = ""

Nov 19 '05 #3
Chris,
Perhaps I misunderstood, but what do you see as the problem? Simply the use
of sessions? You said "isn't he putting a page into a session object?" not
sure what you mean by this, but no he isn't. He doesn't do
Session("Curren tPage") = Page ....

Sessions are bad only when used incorrectly. You haven't given us quite
enough scope to really pass judgement...I would guess that a lot of this
could probably be rewritten without sessions...and probably be better for it

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Chris" <Ch***@discussi ons.microsoft.c om> wrote in message
news:9E******** *************** ***********@mic rosoft.com...
I'm on a project where the prevoius developer wrote code like below. I
thought stuff like this was bad? Isn't he putting a page into a session
object? And what we are trying to do is hit the db via a Stored Proc to
create a datatable in most cases. This seems like a waste to me. Is this good?
Public Shared Function getSQL(ByRef thePage As Page) As ProjectName.SQL Server
If thePage.Session ("mySQLInit" ) = "1" Then

Return thePage.Session ("mySQL")
End If

thePage.Session ("mySQL") = New ProjectName.SQL Server
thePage.Session ("mySQLInit" ) = "1"

Return thePage.Session ("mySQL")
End Function

And then shoots to the SP to create datatable:

Sub FillDataGrid(By Ref gridData As System.Web.UI.W ebControls.Data Grid, ByVal SQL As String, Optional ByVal bAddNew As Boolean = False)

Dim cnn As SqlConnection = New
SqlConnection(C onfigurationSet tings.AppSettin gs().Item("Conn ectionString"))
Dim dt As DataTable = New DataTable("")
Dim dr As DataRow

Dim objDA As SqlClient.SqlDa taAdapter
objDA = New SqlClient.SqlDa taAdapter

dt = ExecSQLReturnDT (SQL, objDA)

If bAddNew Then
dr = dt.NewRow
dt.Rows.InsertA t(dr, 0)
gridData.EditIt emIndex = 0
End If

gridData.DataSo urce = dt
gridData.DataBi nd()

End Sub

And I see dozens of this:

page.Page.Sessi on("psedit_PSHi storyID") = ""

Nov 19 '05 #4
Well I have always used session values but have kept it to a select few. I
see in this app dozens upon dozens to control things as simple as a report
name on a single page. Setting and using them as <> "" and = "". Then I
thought that simple datagrid population could be improved using functions,
etc. but to pass the SQL statement around, etc. seemed over kill? I could be
wrong. And there is a view and SP for each activity, most occuring once (not
reused again in the app).
On a separate subject, I've been reading about keeping the logic in the
business layer and not using SP's. I wonder what the true loss in eff is?

Thanx everyone for the input. We learn something new everyday.

"Karl Seguin" wrote:
Chris,
Perhaps I misunderstood, but what do you see as the problem? Simply the use
of sessions? You said "isn't he putting a page into a session object?" not
sure what you mean by this, but no he isn't. He doesn't do
Session("Curren tPage") = Page ....

Sessions are bad only when used incorrectly. You haven't given us quite
enough scope to really pass judgement...I would guess that a lot of this
could probably be rewritten without sessions...and probably be better for it

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Chris" <Ch***@discussi ons.microsoft.c om> wrote in message
news:9E******** *************** ***********@mic rosoft.com...
I'm on a project where the prevoius developer wrote code like below. I
thought stuff like this was bad? Isn't he putting a page into a session
object? And what we are trying to do is hit the db via a Stored Proc to
create a datatable in most cases. This seems like a waste to me. Is this

good?

Public Shared Function getSQL(ByRef thePage As Page) As

ProjectName.SQL Server

If thePage.Session ("mySQLInit" ) = "1" Then

Return thePage.Session ("mySQL")
End If

thePage.Session ("mySQL") = New ProjectName.SQL Server
thePage.Session ("mySQLInit" ) = "1"

Return thePage.Session ("mySQL")
End Function

And then shoots to the SP to create datatable:

Sub FillDataGrid(By Ref gridData As System.Web.UI.W ebControls.Data Grid,

ByVal
SQL As String, Optional ByVal bAddNew As Boolean = False)

Dim cnn As SqlConnection = New

SqlConnection(C onfigurationSet tings.AppSettin gs().Item("Conn ectionString"))

Dim dt As DataTable = New DataTable("")
Dim dr As DataRow

Dim objDA As SqlClient.SqlDa taAdapter
objDA = New SqlClient.SqlDa taAdapter

dt = ExecSQLReturnDT (SQL, objDA)

If bAddNew Then
dr = dt.NewRow
dt.Rows.InsertA t(dr, 0)
gridData.EditIt emIndex = 0
End If

gridData.DataSo urce = dt
gridData.DataBi nd()

End Sub

And I see dozens of this:

page.Page.Sessi on("psedit_PSHi storyID") = ""


Nov 19 '05 #5
Again, the code you're describing is certainly not elegant. However, it does
work. As far as architecture is concerned, the architecture you described
can certainly use improvement. If you have the time, the inclination, and
the design skill, you could certainly rewrite the architecture in a much
better fashion. As for the details, if you ask here you'll get a plethora of
opinions. And as Uncle Chutney sez, "not only does everyone have one, but
they all stink." Your best bet would be to get a good hold of design
concepts and come up with your own (or leave well enough alone, it's up to
you).
On a separate subject, I've been reading about keeping the logic in the
business layer and not using SP's. I wonder what the true loss in eff is?
Sounds like an overdose of opinions. Your best information can be found in
the .Net SDK, which is a free download.from:

http://www.microsoft.com/downloads/d...displaylang=en

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"Chris" <Ch***@discussi ons.microsoft.c om> wrote in message
news:40******** *************** ***********@mic rosoft.com... Well I have always used session values but have kept it to a select few. I
see in this app dozens upon dozens to control things as simple as a report
name on a single page. Setting and using them as <> "" and = "". Then I
thought that simple datagrid population could be improved using functions,
etc. but to pass the SQL statement around, etc. seemed over kill? I could
be
wrong. And there is a view and SP for each activity, most occuring once
(not
reused again in the app).
On a separate subject, I've been reading about keeping the logic in the
business layer and not using SP's. I wonder what the true loss in eff is?

Thanx everyone for the input. We learn something new everyday.

"Karl Seguin" wrote:
Chris,
Perhaps I misunderstood, but what do you see as the problem? Simply the
use
of sessions? You said "isn't he putting a page into a session object?"
not
sure what you mean by this, but no he isn't. He doesn't do
Session("Curren tPage") = Page ....

Sessions are bad only when used incorrectly. You haven't given us quite
enough scope to really pass judgement...I would guess that a lot of this
could probably be rewritten without sessions...and probably be better for
it

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Chris" <Ch***@discussi ons.microsoft.c om> wrote in message
news:9E******** *************** ***********@mic rosoft.com...
> I'm on a project where the prevoius developer wrote code like below. I
> thought stuff like this was bad? Isn't he putting a page into a session
> object? And what we are trying to do is hit the db via a Stored Proc to
> create a datatable in most cases. This seems like a waste to me. Is
> this

good?
>
> Public Shared Function getSQL(ByRef thePage As Page) As

ProjectName.SQL Server
>
> If thePage.Session ("mySQLInit" ) = "1" Then
>
> Return thePage.Session ("mySQL")
> End If
>
> thePage.Session ("mySQL") = New ProjectName.SQL Server
> thePage.Session ("mySQLInit" ) = "1"
>
> Return thePage.Session ("mySQL")
> End Function
>
> And then shoots to the SP to create datatable:
>
> Sub FillDataGrid(By Ref gridData As System.Web.UI.W ebControls.Data Grid,

ByVal
> SQL As String, Optional ByVal bAddNew As Boolean = False)
>
> Dim cnn As SqlConnection = New
>

SqlConnection(C onfigurationSet tings.AppSettin gs().Item("Conn ectionString"))
>
> Dim dt As DataTable = New DataTable("")
> Dim dr As DataRow
>
> Dim objDA As SqlClient.SqlDa taAdapter
> objDA = New SqlClient.SqlDa taAdapter
>
> dt = ExecSQLReturnDT (SQL, objDA)
>
> If bAddNew Then
> dr = dt.NewRow
> dt.Rows.InsertA t(dr, 0)
> gridData.EditIt emIndex = 0
> End If
>
> gridData.DataSo urce = dt
> gridData.DataBi nd()
>
> End Sub
>
> And I see dozens of this:
>
> page.Page.Sessi on("psedit_PSHi storyID") = ""
>
>
>


Nov 19 '05 #6
note if you are using VS.NET the SDK is not needed, nor is it suggested you
install.

I think that listening to others opinion, help one form his own. Experience
is just as important as Education. I always say use the advise that you want
to use, that makes sense to you. No harm.

why point me to the SDK when this is more of a topic of design perference.
MS discusses both coding techniques. I was just curious as to what others do.
What MS suggests might not always be what is done. I like the idea of keeping
the code/logic on the page so you don't have to go on a hunt for it. Now what
performance hits this causes, I'm not sure. But if you code for a more
univerisal back-end then you don't have a choice.

thanx for your input.

"Kevin Spencer" wrote:
Again, the code you're describing is certainly not elegant. However, it does
work. As far as architecture is concerned, the architecture you described
can certainly use improvement. If you have the time, the inclination, and
the design skill, you could certainly rewrite the architecture in a much
better fashion. As for the details, if you ask here you'll get a plethora of
opinions. And as Uncle Chutney sez, "not only does everyone have one, but
they all stink." Your best bet would be to get a good hold of design
concepts and come up with your own (or leave well enough alone, it's up to
you).
On a separate subject, I've been reading about keeping the logic in the
business layer and not using SP's. I wonder what the true loss in eff is?


Sounds like an overdose of opinions. Your best information can be found in
the .Net SDK, which is a free download.from:

http://www.microsoft.com/downloads/d...displaylang=en

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"Chris" <Ch***@discussi ons.microsoft.c om> wrote in message
news:40******** *************** ***********@mic rosoft.com...
Well I have always used session values but have kept it to a select few. I
see in this app dozens upon dozens to control things as simple as a report
name on a single page. Setting and using them as <> "" and = "". Then I
thought that simple datagrid population could be improved using functions,
etc. but to pass the SQL statement around, etc. seemed over kill? I could
be
wrong. And there is a view and SP for each activity, most occuring once
(not
reused again in the app).
On a separate subject, I've been reading about keeping the logic in the
business layer and not using SP's. I wonder what the true loss in eff is?

Thanx everyone for the input. We learn something new everyday.

"Karl Seguin" wrote:
Chris,
Perhaps I misunderstood, but what do you see as the problem? Simply the
use
of sessions? You said "isn't he putting a page into a session object?"
not
sure what you mean by this, but no he isn't. He doesn't do
Session("Curren tPage") = Page ....

Sessions are bad only when used incorrectly. You haven't given us quite
enough scope to really pass judgement...I would guess that a lot of this
could probably be rewritten without sessions...and probably be better for
it

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Chris" <Ch***@discussi ons.microsoft.c om> wrote in message
news:9E******** *************** ***********@mic rosoft.com...
> I'm on a project where the prevoius developer wrote code like below. I
> thought stuff like this was bad? Isn't he putting a page into a session
> object? And what we are trying to do is hit the db via a Stored Proc to
> create a datatable in most cases. This seems like a waste to me. Is
> this
good?
>
> Public Shared Function getSQL(ByRef thePage As Page) As
ProjectName.SQL Server
>
> If thePage.Session ("mySQLInit" ) = "1" Then
>
> Return thePage.Session ("mySQL")
> End If
>
> thePage.Session ("mySQL") = New ProjectName.SQL Server
> thePage.Session ("mySQLInit" ) = "1"
>
> Return thePage.Session ("mySQL")
> End Function
>
> And then shoots to the SP to create datatable:
>
> Sub FillDataGrid(By Ref gridData As System.Web.UI.W ebControls.Data Grid,
ByVal
> SQL As String, Optional ByVal bAddNew As Boolean = False)
>
> Dim cnn As SqlConnection = New
>
SqlConnection(C onfigurationSet tings.AppSettin gs().Item("Conn ectionString"))
>
> Dim dt As DataTable = New DataTable("")
> Dim dr As DataRow
>
> Dim objDA As SqlClient.SqlDa taAdapter
> objDA = New SqlClient.SqlDa taAdapter
>
> dt = ExecSQLReturnDT (SQL, objDA)
>
> If bAddNew Then
> dr = dt.NewRow
> dt.Rows.InsertA t(dr, 0)
> gridData.EditIt emIndex = 0
> End If
>
> gridData.DataSo urce = dt
> gridData.DataBi nd()
>
> End Sub
>
> And I see dozens of this:
>
> page.Page.Sessi on("psedit_PSHi storyID") = ""
>
>
>


Nov 19 '05 #7
> note if you are using VS.NET the SDK is not needed, nor is it suggested
you
install.
I would have to disagree with this point. I have several versions of Visual
Studio, and I have the .Net SDK installed. I use it every day.
I think that listening to others opinion, help one form his own.
Experience
is just as important as Education. I always say use the advise that you
want
to use, that makes sense to you. No harm.
I would have to disagreee with this as well. Listening to others opinions
doesn't help anything. It only muddies the water. As Uncle Chutney sez
"Opinion is a poor substitute for fact." Not everything in the universe is a
matter of opinion. Some things, like technology, are matters of fact.

When I don't know something, I don't ask for opinions. I research.

Finally, if you follow others, you will never become better than those you
follow. And on the Internet, you have no idea who your mentors are. If you
teach yourself to teach yourself, you will fulfill your own potential to its
fullest.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"Chris" <Ch***@discussi ons.microsoft.c om> wrote in message
news:AB******** *************** ***********@mic rosoft.com... note if you are using VS.NET the SDK is not needed, nor is it suggested
you
install.

I think that listening to others opinion, help one form his own.
Experience
is just as important as Education. I always say use the advise that you
want
to use, that makes sense to you. No harm.

why point me to the SDK when this is more of a topic of design perference.
MS discusses both coding techniques. I was just curious as to what others
do.
What MS suggests might not always be what is done. I like the idea of
keeping
the code/logic on the page so you don't have to go on a hunt for it. Now
what
performance hits this causes, I'm not sure. But if you code for a more
univerisal back-end then you don't have a choice.

thanx for your input.

"Kevin Spencer" wrote:
Again, the code you're describing is certainly not elegant. However, it
does
work. As far as architecture is concerned, the architecture you described
can certainly use improvement. If you have the time, the inclination, and
the design skill, you could certainly rewrite the architecture in a much
better fashion. As for the details, if you ask here you'll get a plethora
of
opinions. And as Uncle Chutney sez, "not only does everyone have one, but
they all stink." Your best bet would be to get a good hold of design
concepts and come up with your own (or leave well enough alone, it's up
to
you).
> On a separate subject, I've been reading about keeping the logic in the
> business layer and not using SP's. I wonder what the true loss in eff
> is?


Sounds like an overdose of opinions. Your best information can be found
in
the .Net SDK, which is a free download.from:

http://www.microsoft.com/downloads/d...displaylang=en

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"Chris" <Ch***@discussi ons.microsoft.c om> wrote in message
news:40******** *************** ***********@mic rosoft.com...
> Well I have always used session values but have kept it to a select
> few. I
> see in this app dozens upon dozens to control things as simple as a
> report
> name on a single page. Setting and using them as <> "" and = "". Then
> I
> thought that simple datagrid population could be improved using
> functions,
> etc. but to pass the SQL statement around, etc. seemed over kill? I
> could
> be
> wrong. And there is a view and SP for each activity, most occuring once
> (not
> reused again in the app).
> On a separate subject, I've been reading about keeping the logic in the
> business layer and not using SP's. I wonder what the true loss in eff
> is?
>
> Thanx everyone for the input. We learn something new everyday.
>
> "Karl Seguin" wrote:
>
>> Chris,
>> Perhaps I misunderstood, but what do you see as the problem? Simply
>> the
>> use
>> of sessions? You said "isn't he putting a page into a session
>> object?"
>> not
>> sure what you mean by this, but no he isn't. He doesn't do
>> Session("Curren tPage") = Page ....
>>
>> Sessions are bad only when used incorrectly. You haven't given us
>> quite
>> enough scope to really pass judgement...I would guess that a lot of
>> this
>> could probably be rewritten without sessions...and probably be better
>> for
>> it
>>
>> Karl
>>
>> --
>> MY ASP.Net tutorials
>> http://www.openmymind.net/
>>
>>
>> "Chris" <Ch***@discussi ons.microsoft.c om> wrote in message
>> news:9E******** *************** ***********@mic rosoft.com...
>> > I'm on a project where the prevoius developer wrote code like below.
>> > I
>> > thought stuff like this was bad? Isn't he putting a page into a
>> > session
>> > object? And what we are trying to do is hit the db via a Stored Proc
>> > to
>> > create a datatable in most cases. This seems like a waste to me. Is
>> > this
>> good?
>> >
>> > Public Shared Function getSQL(ByRef thePage As Page) As
>> ProjectName.SQL Server
>> >
>> > If thePage.Session ("mySQLInit" ) = "1" Then
>> >
>> > Return thePage.Session ("mySQL")
>> > End If
>> >
>> > thePage.Session ("mySQL") = New ProjectName.SQL Server
>> > thePage.Session ("mySQLInit" ) = "1"
>> >
>> > Return thePage.Session ("mySQL")
>> > End Function
>> >
>> > And then shoots to the SP to create datatable:
>> >
>> > Sub FillDataGrid(By Ref gridData As
>> > System.Web.UI.W ebControls.Data Grid,
>> ByVal
>> > SQL As String, Optional ByVal bAddNew As Boolean = False)
>> >
>> > Dim cnn As SqlConnection = New
>> >
>> SqlConnection(C onfigurationSet tings.AppSettin gs().Item("Conn ectionString"))
>> >
>> > Dim dt As DataTable = New DataTable("")
>> > Dim dr As DataRow
>> >
>> > Dim objDA As SqlClient.SqlDa taAdapter
>> > objDA = New SqlClient.SqlDa taAdapter
>> >
>> > dt = ExecSQLReturnDT (SQL, objDA)
>> >
>> > If bAddNew Then
>> > dr = dt.NewRow
>> > dt.Rows.InsertA t(dr, 0)
>> > gridData.EditIt emIndex = 0
>> > End If
>> >
>> > gridData.DataSo urce = dt
>> > gridData.DataBi nd()
>> >
>> > End Sub
>> >
>> > And I see dozens of this:
>> >
>> > page.Page.Sessi on("psedit_PSHi storyID") = ""
>> >
>> >
>> >
>>
>>
>>


Nov 19 '05 #8

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

Similar topics

3
3173
by: VijayShankar | last post by:
Can u be more specific on your question Anyway its not like Session variables are available for sometime and not available for sometime. When your session starts it is very much available unless your session ends One more thing Session variables can very much be used in Application events
26
4039
by: Alan Silver | last post by:
Hello, I have a server running Windows Server 2003, on which two of the web sites use the MegaBBS ASP forum software. Both sites suddenly developed the same error, which seems to be connected to the dictionary object. After some tinkering, I whittled it down to the following (complete) ASP... <%@ CodePage=65001 Language="VBScript"%>
2
3445
by: Colin Basterfield | last post by:
Hi, I am confused... I have the following code in my Page_Load method private void Page_Load(object sender, System.EventArgs e) { // Put user code to initialize the page here
7
1537
by: Nikhil Patel | last post by:
Hi all, I am using a Session object in my ASP.Net application to store a value of a Database field. I can access it as ... int iProposalId = Session; The session timeout is set to 20. Now my question is if the session expires, would the above statement produce any exception? If I can't find the ProposalId value in the session object, I...
4
1320
by: Tony | last post by:
how do I check if the data in the session object is null before extracting it. The following throws an error if the Session object has not already been created. string str = System.Web.HttpContext.Current.Session.ToString(); Thanks
2
2118
by: Markus Prediger | last post by:
Hi NG, I have an asp.net project that uses an vb6 com object for some database-manipulation (I cannot rewrite it in .net, sorry, its not my decision). I want it to be instanciated seperately for each session, so that three users can connect to three different databases. But I get crazy because: -With interop all users share one...
3
1566
by: MrShovel | last post by:
I'm new to this ASP.NET caper and have the following questions. I have a TestObject that contains about 50 fields of data and 3 member procedures. Below is a simplified explanation of what I do. At the start of each session I initialise this TestObject. On entering every page I create a local TestObject and do this: TestObject =...
13
1744
by: | last post by:
Simple question, I think... I'm storing an object in the Session object. In the code behind I read that object: trx = CType(Session("Transaction"), BOCSTransaction) If I change any properties, I have to store it back into the session object to "update" it, right? Or will the changes to my object automatically be saved back into the...
12
2200
by: Anthony Jones | last post by:
Here's a question that I've not been able to get a definitive answer to. Creating an STA object (such as a typical VB6 object) and assigning to the ASP Session store is a bad thing. It's a bad thing because it forces IIS to affiliate the Session with the Thread on which the STA object is created. This means all subsequent requests for...
5
1998
by: jamie.jamazon | last post by:
I'm currently developing a small MVC framework using classic ASP (don't ask me why!) At it's core it calls the controller script which does the heavy logic and builds disconnected recordsets of the required data then transparently "includes" a page template asp script using a Server.Execute. Because of the limitations of Server.Execute and...
0
7843
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8339
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8220
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6619
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5712
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5392
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3872
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1452
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1185
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.