DotNetcr.com
Si deseas hacer un intercambio de links con DotNetcr, escríbenos aquí
Recibe las actualizaciones vía RSS
Te invitamos a unirte en nuestras redes
   http://www.facebook.com/DotNetcr
   http://www.twitter.com/dotnetcr

How To? Almacenar variables de session de ASP.NET en SQL Server

Por androdmu | 1/28/2006 | Visitas 15,632 | Voto 5.00
Aquí vamos a aprender a como configurar nuestra aplicación ASP.NET para que pueda almacenar las variables de session en SQL, una herramienta muy práctica que podría incrementar el rendimiento de nuestra aplicación
Categorías : ASP.NET, SQL Server
1. Configururar Web.Config

<sessionState
mode="SQLServer"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;Integrated Security=SSPI"
cookieless="false"
timeout="20"
/>



2. Correr el SQL Script en el Command Prompt

cd\WINDOWS\Microsoft.NET\Framework\<Version> (Ej: v1.1.4322)

OSQL -S SQLServerName -E < InstallSqlState.sql



3. Crear un archivo .SQL con el siguiente script

USE ASPState
GO

DECLARE @s varchar(50)
SELECT @s = @@servername + '\ASPNET'
EXECUTE sp_grantlogin @s

EXECUTE sp_grantdbaccess @s, 'webuser'

GO

GRANT EXECUTE ON CreateTempTables TO webuser
GRANT EXECUTE ON DeleteExpiredSessions TO webuser
GRANT EXECUTE ON DropTempTables TO webuser
GRANT EXECUTE ON ResetData TO webuser
GRANT EXECUTE ON TempGetAppID TO webuser
GRANT EXECUTE ON TempGetStateItem TO webuser
GRANT EXECUTE ON TempGetStateItemExclusive TO webuser
GRANT EXECUTE ON TempInsertStateItemLong TO webuser
GRANT EXECUTE ON TempInsertStateItemShort TO webuser
GRANT EXECUTE ON TempReleaseStateItemExclusive TO webuser
GRANT EXECUTE ON TempRemoveStateItem TO webuser
GRANT EXECUTE ON TempResetTimeout TO webuser
GRANT EXECUTE ON TempUpdateStateItemLong TO webuser
GRANT EXECUTE ON TempUpdateStateItemLongNullShort TO webuser
GRANT EXECUTE ON TempUpdateStateItemShort TO webuser
GRANT EXECUTE ON TempUpdateStateItemShortNullLong TO webuser

GO

USE tempdb

GO

GRANT SELECT, INSERT, UPDATE, DELETE ON ASPStateTempApplications TO guest
GRANT SELECT, INSERT, UPDATE, DELETE ON ASPStateTempSessions TO guest

GO



4. Crear un .BAT con el siguitenete codigo

osql -S (local) -E -o "results.txt" -i "<ScriptName.sql> (Con el nombre del archive que fue creado)"



5. Ejecutar el archivo BAT
Area de Comentarios
Por gloria - Fecha: 2007/01/19 07:28 PM
me ha encantado todos los tutoriales y documentos todos estamuy importantes
Por Anónimo - Fecha: 2012/07/19 02:38 AM
That's an astute anwser to a tricky question
Por Anónimo - Fecha: 2012/07/20 06:45 AM
MSRJDN , [url=http://mtrrtdkgqrce.com/]mtrrtdkgqrce[/url], [link=http://lxvpiyrrjwfc.com/]lxvpiyrrjwfc[/link], http://xicegklzeamy.com/
Por Anónimo - Fecha: 2012/07/21 12:58 PM
SzMNtP , [url=http://nwcehddvlohw.com/]nwcehddvlohw[/url], [link=http://gdhgsjrwdrru.com/]gdhgsjrwdrru[/link], http://bvutfbunxnim.com/
Por Anónimo - Fecha: 2015/12/17 03:04 PM
yashar ?????:kheili jaleb bud! mamnun. omdiavram untor ke bayad betunam azash estefade konamVA:F [1.9.20_1166]please wait...(1 vote cast)VA:F [1.9.20_1166](from 1 vote)
Por Anónimo - Fecha: 2015/12/19 02:49 AM
Hi,First of all try to comment or rmevoe the lineon error resume nextin the comersus_backoffice_createHTMLPagesExc.asp file to check if a trapped error appears.If you cannot see any error, maybe you need to use two queries instead one, to retrieve the products info.Currently you have the query select * from products.You should use an additional query to retrieve few product values like price, sku, description.In the other query you should retrieve the others fields like imageURL, details, etc.Note that these modifications require advanced asp skills.If you are not a developer, contact your sales representative with your order number to send you the modified script.[] http://qycmmypjdxj.com [url=http://pflilj.com]pflilj[/url] [link=http://jkpxan.com]jkpxan[/link]
Por Anónimo - Fecha: 2015/12/20 02:22 PM
Hi Brent,I was wondering if you had any ishignt to the current state of database performance with the new Server/Sql 2008 options at Amazon EC2. You had an article a while back which criticized the performance of Sql 2005 on the 2003 servers they had, saying that the throughput was the equivalent of running your db off a thumb-drive. It appears like they're trying to address some of the previous limitations of Windows on EC2 (server version, boot drive, etc.) and I was wondering if this translated to performance benefits.Cheers,Rob http://grbsardopge.com [url=http://kcnuekavqa.com]kcnuekavqa[/url] [link=http://ofpntjb.com]ofpntjb[/link]
Ingrese su Comentario
Comentario
Para poder votar debe estar registrado en DotNetcr.com
Solo queda registrado el primer voto enviado
Voto


Últimos Recursos
ricardo leppe t
pedrojavier
CALIN
willipinru
richard
ragomez
PER 238
MEX 236
CRI 188
COL 118
ESP 105
ARG 88