Showing posts with label web. Show all posts
Showing posts with label web. Show all posts

Monday, March 19, 2012

Assistance with Stored Procedure

I am running SQL Server 7.0 and using a web interface. I would like
for a user to be able to input multiple values into a single field
with some sort of delimiter (such as a comma). I want to pass this
field into a Stored Procedure and have the stored procedure use the
data to generate the resutls.

Example:

Web page would ask for ID number into a field called IDNum. User
could input one or many ID numbers separated by a comma or some other
delemiter - could even be just a space (113, 114, 145).

SQL statement in Stored Procedure is something like this:

Select * from tblEmployess where IDNumber = @.IDNum

I need the SQL statement to somehow use an "or" or a "loop" to get all
of the numbers passed and use the delimiter to distinguish when the
"loop" stops.

I obtained a module from a friend that allows me to do this in access,
but have recently converted everything to SQL server and web
interface. Now, everyone in the office expects to be able to
accomplish the same results via the web.

Any help is appreciated. If you need any additional information to
provide me some assistance, please email me at
tod.thames@.nc.ngb.army.mil.

Thanks in advance.

TodTake a look at http://www.algonet.se/~sommar/arrays-in-sql.html.

--
Hope this helps.

Dan Guzman
SQL Server MVP

--------
SQL FAQ links (courtesy Neil Pike):

http://www.ntfaq.com/Articles/Index...epartmentID=800
http://www.sqlserverfaq.com
http://www.mssqlserver.com/faq
--------

"Tod Thames" <tod.thames@.nc.ngb.army.mil> wrote in message
news:5ed144f0.0310050454.369f4994@.posting.google.c om...
> I am running SQL Server 7.0 and using a web interface. I would like
> for a user to be able to input multiple values into a single field
> with some sort of delimiter (such as a comma). I want to pass this
> field into a Stored Procedure and have the stored procedure use the
> data to generate the resutls.
> Example:
> Web page would ask for ID number into a field called IDNum. User
> could input one or many ID numbers separated by a comma or some other
> delemiter - could even be just a space (113, 114, 145).
> SQL statement in Stored Procedure is something like this:
> Select * from tblEmployess where IDNumber = @.IDNum
>
> I need the SQL statement to somehow use an "or" or a "loop" to get all
> of the numbers passed and use the delimiter to distinguish when the
> "loop" stops.
> I obtained a module from a friend that allows me to do this in access,
> but have recently converted everything to SQL server and web
> interface. Now, everyone in the office expects to be able to
> accomplish the same results via the web.
> Any help is appreciated. If you need any additional information to
> provide me some assistance, please email me at
> tod.thames@.nc.ngb.army.mil.
> Thanks in advance.
> Tod|||Everytime I try to get to the website you refrenced, I get TCP_ERROR.
Some sort of communication problem. Is there any other sites that have
the same sort of information?

Thanks for the response,

Tod

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!|||I don't know if the content is mirrored elsewhere. The author, Erland
Sommarskog, frequents this newsgroup so maybe he'll jump in.

BTW, I don't have any problems accessing the site.

--
Hope this helps.

Dan Guzman
SQL Server MVP

"Tod Thames" <tod.thames@.nc.ngb.army.mil> wrote in message
news:3f803253$0$195$75868355@.news.frii.net...
> Everytime I try to get to the website you refrenced, I get TCP_ERROR.
> Some sort of communication problem. Is there any other sites that
have
> the same sort of information?
> Thanks for the response,
> Tod
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!|||[posted and mailed]

Tod Thames (tod.thames@.nc.ngb.army.mil) writes:
> Everytime I try to get to the website you refrenced, I get TCP_ERROR.
> Some sort of communication problem. Is there any other sites that have
> the same sort of information?

Too bad. If you have the complete error message, I'm interested. I'm
inclined to suspect that this might be some firewall problem at your
side, but I might get carried away of the .mil in your address.

Anyway, here is an excerpt of the part which is most relevant to
you. If you want to read the entire article, just drop me a line.

An Extravagant List-of-integers Procedure

The technique in the previous section can of course be applied to a list
of integers as well, so what comes here is not a true port of the
iter_intlist_to_table function, but a version that goes head over heels
to validate that the list items are valid numbers to avoid a conversion
error. And to be extra ambitious, the procedure permits for signed
numbers such as +98 or -83. If a list item is not a legal number, the
procedure produces a warning. The procedure fills in a temp table that
has a listpos column; this column will show a gap if there is an illegal
item in the input.

CREATE PROCEDURE intlist_to_table_sp @.list ntext AS

DECLARE @.pos int,
@.textpos int,
@.listpos int,
@.chunklen smallint,
@.str nvarchar(4000),
@.tmpstr nvarchar(4000),
@.leftover nvarchar(4000)

SET NOCOUNT ON

SELECT @.textpos = 1, @.listpos = 1, @.leftover = ''
WHILE @.textpos <= datalength(@.list) / 2
BEGIN
SELECT @.chunklen = 4000 - datalength(@.leftover) / 2
SELECT @.tmpstr = ltrim(@.leftover + substring(@.list, @.textpos, @.chunklen))
SELECT @.textpos = @.textpos + @.chunklen

SELECT @.pos = charindex(' ', @.tmpstr)
WHILE @.pos > 0
BEGIN
SELECT @.str = rtrim(ltrim(substring(@.tmpstr, 1, @.pos - 1)))
EXEC insert_str_to_number @.str, @.listpos
SELECT @.listpos = @.listpos + 1
SELECT @.tmpstr = ltrim(substring(@.tmpstr, @.pos + 1, len(@.tmpstr)))
SELECT @.pos = charindex(' ', @.tmpstr)
END

SELECT @.leftover = @.tmpstr
END

IF ltrim(rtrim(@.leftover)) <> ''
EXEC insert_str_to_number @.leftover, @.listpos
go

-- This is a sub-procedure to intlist_to_table_sp
CREATE PROCEDURE insert_str_to_number @.str nvarchar(200),
@.listpos int AS

DECLARE @.number int,
@.orgstr nvarchar(200),
@.sign smallint,
@.decimal decimal(10, 0)

SELECT @.orgstr = @.str

IF substring(@.str, 1, 1) IN ('-', '+')
BEGIN
SELECT @.sign = CASE substring(@.str, 1, 1)
WHEN '-' THEN -1
WHEN '+' THEN 1
END
SELECT @.str = substring(@.str, 2, len(@.str))
END
ELSE
SELECT @.sign = 1

IF @.str LIKE '%[0-9]%' AND @.str NOT LIKE '%[^0-9]%'
BEGIN
IF len(@.str) <= 9
SELECT @.number = convert(int, @.str)
ELSE IF len(@.str) = 10
BEGIN
SELECT @.decimal = convert(decimal(10, 0), @.str)
IF @.decimal <= convert(int, 0x7FFFFFFF)
SELECT @.number = @.decimal
END
END

IF @.number IS NOT NULL
INSERT #numbers (listpos, number) VALUES (@.listpos, @.sign * @.number)
ELSE
RAISERROR('Warning: at position %d, the string "%s" is not an legal integer',
10, -1, @.listpos, @.orgstr)
go

Here is how you would use it:

CREATE PROCEDURE get_product_names_iterproc @.ids varchar(50) AS
CREATE TABLE #numbers (listpos int NOT NULL,
number int NOT NULL)
EXEC intlist_to_table_sp @.ids
SELECT P.ProductID, P.ProductName
FROM Northwind..Products P
JOIN #numbers n ON P.ProductID = n.number
go
EXEC get_product_names_iterproc '9 12 27 37'

The validation of the list item is in the sub-procedure
insert_str_to_number. For many purposes it would be sufficient to have
the test

@.str NOT LIKE '%[^0-9]%' AND len(@.str) BETWEEN 1 AND 9

which checks that @.str only contain digits and is at most nine digits
long (that is, you disapprove ten-digit numbers as well as signed
numbers).

You might guess that there is a performance cost for this extravaganza,
and indeed the procedure needs about 50% more time than the corresponding
function. Still, for many situations, the execution time is acceptable.

One note about the warning produced with RAISERROR: with ADO, this
warning may be difficult or impossible to detect on client level. If you
change the severity from 10 to 11, it will be an error, and raise an
error in your client code.

--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||
Thanks for the response - it's a little above my abilities, but I plan
on studying it and trying to make it work for me project.

Tod

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!|||See if the following link helps..
http://tinyurl.com/6iil

--
-- Anith|||Tod,

Try this:

create procedure ListEmployees
@.IDNum char(1024)
as begin
set @.IDNum = ' ' + replace(@.IDNum, ',', ' ') + ' '
select *
from tblEmployess
where @.IDNum like ('% ' + ltrim(str(IDNumber)) + ' %')
end

Shervin

"Tod Thames" <tod.thames@.nc.ngb.army.mil> wrote in message
news:5ed144f0.0310050454.369f4994@.posting.google.c om...
> I am running SQL Server 7.0 and using a web interface. I would like
> for a user to be able to input multiple values into a single field
> with some sort of delimiter (such as a comma). I want to pass this
> field into a Stored Procedure and have the stored procedure use the
> data to generate the resutls.
> Example:
> Web page would ask for ID number into a field called IDNum. User
> could input one or many ID numbers separated by a comma or some other
> delemiter - could even be just a space (113, 114, 145).
> SQL statement in Stored Procedure is something like this:
> Select * from tblEmployess where IDNumber = @.IDNum
>
> I need the SQL statement to somehow use an "or" or a "loop" to get all
> of the numbers passed and use the delimiter to distinguish when the
> "loop" stops.
> I obtained a module from a friend that allows me to do this in access,
> but have recently converted everything to SQL server and web
> interface. Now, everyone in the office expects to be able to
> accomplish the same results via the web.
> Any help is appreciated. If you need any additional information to
> provide me some assistance, please email me at
> tod.thames@.nc.ngb.army.mil.
> Thanks in advance.
> Tod

Sunday, March 11, 2012

Assigning User / Group thru Web service?

I can't find a way to set user / group to a role thru the web service, this
functionality is availible in the Reports interface, but not thru the web
service?
Just to note i'v implemented Custom Security, agains a users data store. We
need to bulk load 1500 users.
Can this be done thru the db? that would be a solution also if the web
methods are not availible?
sql server 2000, rs 1.0Report Manager uses SetPolicies and SetSystemPolicies SOAP methods.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Nathan Myers" <Nathan Myers@.discussions.microsoft.com> wrote in message
news:69021F82-9C4B-4EE7-896D-A1C3E3C9B20B@.microsoft.com...
>I can't find a way to set user / group to a role thru the web service, this
> functionality is availible in the Reports interface, but not thru the web
> service?
> Just to note i'v implemented Custom Security, agains a users data store.
> We
> need to bulk load 1500 users.
> Can this be done thru the db? that would be a solution also if the web
> methods are not availible?
> sql server 2000, rs 1.0|||do these methods inclue seting a Role to a User / Group. I haven't seen it
in the documentation anywere. Can you show an example of setting a Role
(System Adminstrator) to a User (Nathan.Myers) via the Web services
SetPolicies or SetSystemPolicies?
"Lev Semenets [MSFT]" wrote:
> Report Manager uses SetPolicies and SetSystemPolicies SOAP methods.
> --
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "Nathan Myers" <Nathan Myers@.discussions.microsoft.com> wrote in message
> news:69021F82-9C4B-4EE7-896D-A1C3E3C9B20B@.microsoft.com...
> >I can't find a way to set user / group to a role thru the web service, this
> > functionality is availible in the Reports interface, but not thru the web
> > service?
> >
> > Just to note i'v implemented Custom Security, agains a users data store.
> > We
> > need to bulk load 1500 users.
> >
> > Can this be done thru the db? that would be a solution also if the web
> > methods are not availible?
> >
> > sql server 2000, rs 1.0
>
>|||Use SetSystemPolicies to set System Administrator role for a user.
Basically you need to get system policies using GetSystemPolicies, add
policy for user, and then call SetSystemPolicies
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Nathan Myers" <NathanMyers@.discussions.microsoft.com> wrote in message
news:86EAE013-7C63-40AE-997C-CE263A8C58BA@.microsoft.com...
> do these methods inclue seting a Role to a User / Group. I haven't seen it
> in the documentation anywere. Can you show an example of setting a Role
> (System Adminstrator) to a User (Nathan.Myers) via the Web services
> SetPolicies or SetSystemPolicies?
> "Lev Semenets [MSFT]" wrote:
>> Report Manager uses SetPolicies and SetSystemPolicies SOAP methods.
>> --
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>>
>> "Nathan Myers" <Nathan Myers@.discussions.microsoft.com> wrote in message
>> news:69021F82-9C4B-4EE7-896D-A1C3E3C9B20B@.microsoft.com...
>> >I can't find a way to set user / group to a role thru the web service,
>> >this
>> > functionality is availible in the Reports interface, but not thru the
>> > web
>> > service?
>> >
>> > Just to note i'v implemented Custom Security, agains a users data
>> > store.
>> > We
>> > need to bulk load 1500 users.
>> >
>> > Can this be done thru the db? that would be a solution also if the web
>> > methods are not availible?
>> >
>> > sql server 2000, rs 1.0
>>

Thursday, March 8, 2012

Assigning a lower priority to some users in SQL Server.

I have a production database used by a web site, and at the same time a group of read-only users who can query the database directly “without the web site”

When one of the users runs a complex query, it slows down the server, and affects the web site.

Is it possible to change the SQL User account or SQL User Group’s priority to low?

You know, the same like in the Task Manager and Windows, I can change a process to low, so it will not affect the important processes, can I do this in SQL Server, and is there any workaround.

in my humble opinion

its the query that needs to be changed

or if your using 2005 you can implement HA feature

such as database snapshot, mirroring etc.

|||Besides the guessing, does anyone have a real solution? Are there sql execution priorities available in SQL Server? Or they are just in the deal databases, like Oracle?|||

if you are so convince that thats the best query you can write and there is no

room for improvement then you can schedule your heavy process to run

on offpeak times.

if that heavy process cross the line of tolerable performance your only option

is to kill that process.

the solution to your problem are

1. send readonly report users to a database snapshot if you are using 2k5

2. schedule the process to run on offpeak times

3. use page caching, fragment caching and most importanctly database caching in asp.net or on your website so you dont rely much on your database

By the way, what does this complex query do? if you would not mind.

how complex is it?

Saturday, February 25, 2012

Aspx with IIS6 with SQL 2000

Hi All,
I am trying to run aspx website on IIS version 6. It works locally with WEb Matrix but when I put the site into the IIS server, it cannot connect to the database. THe IIS is sonfigured and all users have full permissions but the error that is returned is:
Login failed for user '(null)'. Reason: Not associated with a treusted SQL Server connection.
SQL Server 2000 is installed and a connection is open to the database in question.
Would be very greatfull for ANY help on this, being tryin to get this workin for days!!
Collette.
Hi,
I have explained the cause and resolution for this error in the following articles.
http://harishmvp.blogspot.com/2005/05/you-may-receive-error-login-failed-for.html
http://harishmvp.blogspot.com/2005/05/you-may-receive-error-login-failed-for_25.html
One of the above should help you.
Write back if this doesnt help.
Thanks.|||

Hi!

Still having problems with the this! Done everything in the two documents and still no joy!

Error: Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection
Please help!!

Collette.

|||

Hi,

Can you let me know your scenario?

Thanks.

ASPState database transaction log out control

I am developing an Asp.Net web site which is using SQL Server session state
being held in the ASPState database. I noticed recently that the ASPState
database transaction log had grown to 7.5GB despite the face that only a
small number of users were using the web site which is still under
development. Any reason for this runaway growth? Build as below
..Net Framework 1.1
Windows Server 2003 Standard Edition SP1
Sql Server 2000 Standard Edition SP4
Scott
Hi
Your are in Full recovery mode and are not backup up your log.
http://msdn.microsoft.com/library/de...kprst_565v.asp
http://www.dbazine.com/sql/sql-artic...lins-sqlserver
Regards
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"scottrm" <scottrm@.newsgroup.nospam> wrote in message
news:36A7060E-C318-46AC-B128-DB491B883A0B@.microsoft.com...
>I am developing an Asp.Net web site which is using SQL Server session state
> being held in the ASPState database. I noticed recently that the ASPState
> database transaction log had grown to 7.5GB despite the face that only a
> small number of users were using the web site which is still under
> development. Any reason for this runaway growth? Build as below
> .Net Framework 1.1
> Windows Server 2003 Standard Edition SP1
> Sql Server 2000 Standard Edition SP4
> --
> Scott
|||"Mike Epprecht (SQL MVP)" <mike@.epprecht.net> wrote in message
news:eVSUQoL$FHA.3096@.tk2msftngp13.phx.gbl...
> Hi
> Your are in Full recovery mode and are not backup up your log.
>
You should run the ASP.NET state database in simple recovery mode unless you
are trying to do log shipping or something with it. Better yet, use the
script to create all its objects in TempDB intead of their own database.
David
|||Hi Scott,
You may also refer the articles below for more information
INF: Transaction Log Grows Unexpectedly or Becomes Full on SQL Server
http://support.microsoft.com/kb/317375/en-us
How to stop the transaction log of a SQL Server database from growing
unexpectedly
http://support.microsoft.com/kb/873235/en-us
Topic: DBCC SHRINKDATABASE / DBCC SHRINKFILE in BOL
If you have any questions or concerns, don't hesitate to let me know. We
are always here to be of assistance!
Sincerely yours,
Michael Cheng
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
================================================== ===
This posting is provided "AS IS" with no warranties, and confers no rights.

ASPState database transaction log out control

I am developing an Asp.Net web site which is using SQL Server session state
being held in the ASPState database. I noticed recently that the ASPState
database transaction log had grown to 7.5GB despite the face that only a
small number of users were using the web site which is still under
development. Any reason for this runaway growth' Build as below
.Net Framework 1.1
Windows Server 2003 Standard Edition SP1
Sql Server 2000 Standard Edition SP4
--
ScottHi
Your are in Full recovery mode and are not backup up your log.
http://msdn.microsoft.com/library/d... />
t_565v.asp
http://www.dbazine.com/sql/sql-arti...llins-sqlserver
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"scottrm" <scottrm@.newsgroup.nospam> wrote in message
news:36A7060E-C318-46AC-B128-DB491B883A0B@.microsoft.com...
>I am developing an Asp.Net web site which is using SQL Server session state
> being held in the ASPState database. I noticed recently that the ASPState
> database transaction log had grown to 7.5GB despite the face that only a
> small number of users were using the web site which is still under
> development. Any reason for this runaway growth' Build as below
> .Net Framework 1.1
> Windows Server 2003 Standard Edition SP1
> Sql Server 2000 Standard Edition SP4
> --
> Scott|||"Mike Epprecht (SQL MVP)" <mike@.epprecht.net> wrote in message
news:eVSUQoL$FHA.3096@.tk2msftngp13.phx.gbl...
> Hi
> Your are in Full recovery mode and are not backup up your log.
>
You should run the ASP.NET state database in simple recovery mode unless you
are trying to do log shipping or something with it. Better yet, use the
script to create all its objects in TempDB intead of their own database.
David|||Hi Scott,
You may also refer the articles below for more information
INF: Transaction Log Grows Unexpectedly or Becomes Full on SQL Server
http://support.microsoft.com/kb/317375/en-us
How to stop the transaction log of a SQL Server database from growing
unexpectedly
http://support.microsoft.com/kb/873235/en-us
Topic: DBCC SHRINKDATABASE / DBCC SHRINKFILE in BOL
If you have any questions or concerns, don't hesitate to let me know. We
are always here to be of assistance!
Sincerely yours,
Michael Cheng
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
========================================
=============
This posting is provided "AS IS" with no warranties, and confers no rights.

ASPState database transaction log out control

I am developing an Asp.Net web site which is using SQL Server session state
being held in the ASPState database. I noticed recently that the ASPState
database transaction log had grown to 7.5GB despite the face that only a
small number of users were using the web site which is still under
development. Any reason for this runaway growth' Build as below
.Net Framework 1.1
Windows Server 2003 Standard Edition SP1
Sql Server 2000 Standard Edition SP4
--
ScottHi
Your are in Full recovery mode and are not backup up your log.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adminsql/ad_bkprst_565v.asp
http://www.dbazine.com/sql/sql-articles/mullins-sqlserver
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"scottrm" <scottrm@.newsgroup.nospam> wrote in message
news:36A7060E-C318-46AC-B128-DB491B883A0B@.microsoft.com...
>I am developing an Asp.Net web site which is using SQL Server session state
> being held in the ASPState database. I noticed recently that the ASPState
> database transaction log had grown to 7.5GB despite the face that only a
> small number of users were using the web site which is still under
> development. Any reason for this runaway growth' Build as below
> .Net Framework 1.1
> Windows Server 2003 Standard Edition SP1
> Sql Server 2000 Standard Edition SP4
> --
> Scott|||"Mike Epprecht (SQL MVP)" <mike@.epprecht.net> wrote in message
news:eVSUQoL$FHA.3096@.tk2msftngp13.phx.gbl...
> Hi
> Your are in Full recovery mode and are not backup up your log.
>
You should run the ASP.NET state database in simple recovery mode unless you
are trying to do log shipping or something with it. Better yet, use the
script to create all its objects in TempDB intead of their own database.
David|||Hi Scott,
You may also refer the articles below for more information
INF: Transaction Log Grows Unexpectedly or Becomes Full on SQL Server
http://support.microsoft.com/kb/317375/en-us
How to stop the transaction log of a SQL Server database from growing
unexpectedly
http://support.microsoft.com/kb/873235/en-us
Topic: DBCC SHRINKDATABASE / DBCC SHRINKFILE in BOL
If you have any questions or concerns, don't hesitate to let me know. We
are always here to be of assistance!
Sincerely yours,
Michael Cheng
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=====================================================This posting is provided "AS IS" with no warranties, and confers no rights.

ASPNETDB.MDF, My Own Database and Deployment

This question has been asked before, with vague responses

I'm using Visual Web Developer 2005 Express, SQL Server 2005 Express and SQL Server Management Studio Express.

When I create an application with Login controls, VWD automaticlly creates a ASPENTDB.MDF security database. I also create my own database for my application e.g. abc.mdf. In other words, I have two databases. However, my hosting company supports only one database. What do I (we) do?

I have seen articles on:aspnet_regsql . Does this create a new database with all the security features of ASPNETDB.MDF built into my new database i.e. abc.mdf?

(A) If yes, how do you run it with SQL Server Managment Studio Express? It sounds silly, but I need instructions here please ... Also, do you run this against abc.mdf or do you use it create abc.mdf?

(B) If not, how do you achieve a single database scenario?

I'm sure this is a very common deployment question, which is very confusing for most of us hobbyists that want to deploy their web applications

As I understand, by default the data for a application will be stored in the database (ASPENTDB.MDF ) automaticlly created by VWD--you can change your connection string to connect other databases and the data will be only put into 1 database. To understand how your website using the database, you can take a look at :

http://weblogs.asp.net/scottgu/archive/2005/08/25/423703.aspx

If you want to maneger the database in Management Studio, you can detach the database from your application (right click it in Server Explorer), then attach it in Management Studio. You can refer to this article:

http://msdn2.microsoft.com/en-us/library/ms187858.aspx

|||

Thank you for the response. I have seen the first URL previously and have some questions on running theaspnet_regsql.exe utility

1. I do NOT have the full blown SQL Server 2005 version on my development machine (nor do I have it in my LAN). Do I need to have this in order for the aspnet_regsql utility to work?

2. I still want to develop and test locally and when satsified upload to the web hoster. If aspnet_regsql creates a full SQL Server 2005 database version for me locally, how do I manage it using VWD locally, because VWD works with the SQL Server 2005 Express version?

3. By running aspnet-regsql, does it fundamentally change VWD from using SQL Server 2005 Express thereafter for other new sites, projects and solutions on the same development machine? I do not want this to be the case

4. Can I undo or reverse the effects of running aspnet_regsql?

Cheers

Friday, February 24, 2012

ASPNETDB.MDF & SQL Server

When I first sign up with Visual Web Developer, Do I continue to use this database ASPNETDB.MDF or do I need to connect to the Microsoft SQL Server Database? Does Visual Web Developer Express automaticaliyy connect to SQL Server Express Edition?

Thanks

Computergirl

SQL Express only allows a single connection, and no hosting company are using this version. It depend on what your purpose, if it's only for self learning, then it's OK.

Visual Web Developer Express does not automatically connect to SQL Express.

More info on how to setup the connection string:http://msdn2.microsoft.com/en-us/library/ms247257(VS.80).aspx

ASPNETDB.mdf - setting your website to use your hosted DB instead

Hi,

I'm running Visual Web Developer 2005 and have created a small site with a log-in function. In VWD this automatically creates the database ASPNETDB.mdf which stores all the user / log-on data.

I have 1 x MS SQL Server 2005 DB which I am using to store data for my site.

Can anyone advise me on how to setup my site / the ASPNetDB so that it runs on my MS SQL Server?

I've searched the ASP.NET forums etc and this does seem to be an area where people are struggling.

I have tried running the ASP.NET SQL Server Registration Tool (Aspnet_regsql.exe) and get the following error:

"Setup failed.

Exception:
An error occurred during the execution of the SQL file 'InstallCommon.sql'. The SQL error number is 8152 and the SqlException message is: String or binary data would be truncated."

As a beginner I've struggled from downloading an online template, then uploading it to my site, and the log-on doesn't work. There didn't seem any instructions / advice on what to do with the ASPNETDB.mdf database.

Help / advice would be much appreciated!

Thanks,

Tom

Hi gilbert,

This website is a great place to start reading about security and asp.nethttp://weblogs.asp.net/scottgu/archive/2006/02/24/ASP.NET-2.0-Membership_2C00_-Roles_2C00_-Forms-Authentication_2C00_-and-Security-Resources-.aspx

The things you are probably looking for are Windows or Forms Authentication with SQL Server 2000 (or 2005). When you use the log-in control and don't change any of the settings, for example in web.config, all the default settings will be used. Maybe that's what's causing the error.

This is a link on the page mentioned above, it's about forms auth. and it tells you how to set up that aspnetdb. (http://msdn2.microsoft.com/en-us/library/ms998317.aspx)

Hope this helps!
Wim

|||

theres 8 parts to it.

but the first couple talk about what your asking. in the articles tehre are also links to different other pages which can help you configure your site to use the MSSQL database you have.

http://aspnet.4guysfromrolla.com/articles/120705-1.aspx

ASPNETDB migration

I created a website using Visual web developer express edition (including SQL Express). No the user management section of the site (the login/logout database) was created automatically and SQL Server express was installed at my computer under the instance name of SQLExpress. I uploaded it to my web host and he hooked up the ASPNETDB for me. Now the problem is that ASPNETDB has an id password and I was given theMSSQL Server IP. How do I configure my website to accommodate that? Any help will be extremely useful!!!

you need to modify the connection string in web.config

<connectionStrings>
<remove name="LocalSqlServer"/>
<add name="LocalSqlServer" connectionString="server=server ip;database=ASPNETDB;uid=youUsername;pwd=yourpassword"
providerName="System.Data.SqlClient"/>

</connectionStrings>

|||

WOW! Thats it! Thanks a bunch. One more thing. I am also using the same database to display some data(have added some tables into it manually). What should I put in the connection string to make the connection to the database? Also, can I use a MySQL database instead? If yes, what will be the connection string?

Thanks for your help.

|||

if you don't want to use the same name "LocalSqlServer", then you can add another connection with the same connectionString
like:

<add name="yourConnName" connectionString="server=server ip;database=ASPNETDB;uid=youUsername;pwd=yourpassword"
providerName="System.Data.SqlClient"/>

I am not sure if you can use MySQL as a configuration Database, but you can use it for application database.

Honestly, I didn't use it before. to get the exact connection string for MySQL, try to add a coonection from the wizard and see how vs2005 creates it in web.config

aspnetdb connection string not found

Why I don't have connection string in web.config for aspnetdb.mdf database although the site works?Help plz?

You could have connection string in web.config,and reference it in your code,take gridview for example:

<asp:SqlDataSource ID="SqlDataSourcel" Runat="server"ProviderName="System.Data.SqlClient"ConnectionString="Server=(local)\SQLExpress;Integrated Security=True;Database=Northwind;Persist Security Info=True"SelectCommand="SELECT [ProductID], [ProductName], [UnitPrice] FROM[Products]"></asp:SqlDataSource>or "SqlDataSource1" runat="server" DataSourceMode="DataReader" ConnectionString="<%$ ConnectionStrings:MyNorthwind%>" SelectCommand="SELECT FirstName, LastName, Title FROM Employees">
In your soucecode you should find ConnectionString .|||The connection string for the database file created in your application is auto generated, you may take a look at this post:http://forums.asp.net/thread/1430985.aspx

aspnetdb connection string

Hello,
I'm getting up to speed with VS2005 and use SQL Server 2005. I'm using the login control in a test web app.

When I run the app I get this error:

Cannot open database "aspnetdb" requested by the login. The login failed.
Login failed for user 'UserID\ASPNET'.

The connection string I'm using is:

data source=localhost;Integrated Security=SSPI;Initial Catalog=aspnetdb;

The AspNetSqlProvider in the web administration tool connects to the database.

My question is, Is this a connection string issue, and user ID issue, a rights issue or is it something else?

Thanks,

Gaikhe

This is a permission issue on SQL, which indicates theUserID\ASPNETlogin dose not have sufficient permission to perform specific task(access in this case) on theaspnetdb database. You should add database mapping for this account to theaspnetdb database: open ManagementStudio->Explore the SQL instance->Security->Logins->view the properties of theUserID\ASPNETlogin->switch toUser Mapping tab-> add proper mapping and permission to the login.

aspnetdb connection could not establish but database correctly created.

I installed netframework 2.0 Visual Web developer and MSSQL 2005 express edition with SQL Server management express.

I have got this configuration: 2*256 mb ram Intel Pentium 3.2Ghz Windows XP HUN SP2 latest version.

server name: localhost\SQLEXPRESS
Authentication: Windows Authentication

I run aspnet_regsql.exe and the setup wizard created aspnetdb see here, Microsoft sql server management studio can see the database:
MSSQL server management express & aspnetdb

But! When I run to the asp.net web application administration tool in Provider Configuration and choose
AspNetSqlProvider only 1
then I clickSelect a single provider for all site management data link -> then test

The Tool write this:
Could not establish a connection to the database.
If you have not yet created the SQL Server database, exit the Web SiteAdministration tool, use the aspnet_regsql command-line utility tocreate and configure the database, and then return to this tool to setthe provider.

Hi,

You application does not "know" where your database is. It is trying to find it in App_Data folder of your application. If it is not there you can specify its locaton by using connection string in web.config like this:

<connectionStrings>
<clear/>
<add name="LocalSqlServer" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/>
</connectionStrings>

|||

<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings/>
<connectionStrings>
<clear/>
<add name="LocalSqlServer" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/>
</connectionStrings>

<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.

Visual Basic options:
Set strict="true" to disallow all data type conversions
where data loss can occur.
Set explicit="true" to force declaration of all variables.
-->
<compilation debug="true" strict="false" explicit="true"/>
<pages>
<namespaces>
<clear/>
<add namespace="System"/>
<add namespace="System.Collections"/>
<add namespace="System.Collections.Specialized"/>
<add namespace="System.Configuration"/>
<add namespace="System.Text"/>
<add namespace="System.Text.RegularExpressions"/>
<add namespace="System.Web"/>
<add namespace="System.Web.Caching"/>
<add namespace="System.Web.SessionState"/>
<add namespace="System.Web.Security"/>
<add namespace="System.Web.Profile"/>
<add namespace="System.Web.UI"/>
<add namespace="System.Web.UI.WebControls"/>
<add namespace="System.Web.UI.WebControls.WebParts"/>
<add namespace="System.Web.UI.HtmlControls"/>
</namespaces>
</pages>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows"/>
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.

<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
</system.web>
</configuration>

I paste But doesn't work.Sad modify the text or not? When I run the page createuserwizard

Kiszolgálóhiba t?rtént az alkalmazásban: ?/Website".Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed.Leírás: Nem kezelt kivétel k?vetkezett be az aktuális webes kérelem végrehajtása során. A hibára és az azt okozó kódrészletre vonatkozó adatok az alábbi veremkivonatban találhatók.Hiba t?rtént az SQLExpress adatbázisfájl automatikus létrehozásakor:A kapcsolódási karakterlánc az alkalmazás App_Data k?nyvtárában található adatbázishelyet használó helyi SQL Server Express példányt ad meg. A szolgáltató megkísérelte automatikusan létrehozni az alkalmazás szolgáltatási adatbázisát, mert a szolgáltató megállapította, hogy az adatbázis nem létezik. A k?vetkez? konfigurálási k?vetelmények megléte szükséges ahhoz, hogy az alkalmazás szolgáltatási adatbázisának létezése sikeresen ellen?rizhet? legyen, és hogy az alkalmazás szolgáltatási adatbázisa automatikusan létrehozható legyen: 1. Ha még nem létezik az alkalmazás App_Data k?nyvtára, a webkiszolgálói fióknak olvasási és írási hozzáféréssel kell rendelkeznie az alkalmazás k?nyvtárához. Ez azért szükséges, mert a webkiszolgálói fiók automatikusan létre fogja hozni az App_Data k?nyvtárat, ha az még nem létezik. 2. Ha már létezik az alkalmazás App_Data k?nyvtára, a webkiszolgálói fióknak csak az alkalmazás App_Data k?nyvtárához van szüksége olvasási és írási hozzáférésre. Ez azért szükséges, mert a webkiszolgálói fiók megkísérli ellen?rizni, hogy az alkalmazás App_Data k?nyvtárában már létezik-e az SQL Server Express adatbázis. Ha visszavonja a webkiszolgálói fióktól az olvasási engedélyt az App_Data k?nyvtárhoz, a szolgáltató nem fogja tudni helyesen megállapítani, hogy már létezik-e az SQL Server Express adatbázis. Ez hibát okoz, amikor a szolgáltató megpróbálja még egyszer létrehozni a már létez? adatbázis másodpéldányát. Az írási hozzáférés azért szükséges, mert az új adatbázis létrehozásához a webkiszolgálói fiók hitelesít? adatait kell használni. 3. A számítógépen telepítve kell lennie az SQL Server Express programnak. 4. A webkiszolgálói fiók folyamatidentitásának helyi felhasználói profillal kell rendelkeznie. A mind a számítógéphez, mind a tartományi fiókokhoz készített helyi felhasználói profil létrehozásáról az információs fájl tartalmaz további tudnivalókat.Forráshiba:Az aktuális webes kérelem végrehajtása nem kezelt kivételt okozott. A kivétel okára és helyére vonatkozó adatok az alábbi veremkivonatban találhatók.Veremkivonat:[SqlException (0x80131904): Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed.] System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +735027 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188 System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1838 System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +33 System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +628 System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +170 System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +130 System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup) +27 System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +47 System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105 System.Data.SqlClient.SqlConnection.Open() +111 System.Web.Management.SqlServices.GetSqlConnection(String server, String user, String password, Boolean trusted, String connectionString) +67[HttpException (0x80004005): Nem lehet csatlakozni az SQL Server adatbázishoz.] System.Web.Management.SqlServices.GetSqlConnection(String server, String user, String password, Boolean trusted, String connectionString) +122 System.Web.Management.SqlServices.SetupApplicationServices(String server, String user, String password, Boolean trusted, String connectionString, String database, String dbFileName, SqlFeatures features, Boolean install) +89 System.Web.Management.SqlServices.Install(String database, String dbFileName, String connectionString) +26 System.Web.DataAccess.SqlConnectionHelper.CreateMdfFile(String fullFileName, String dataDir, String connectionString) +388Verzióinformáció: Microsoft .NET-keretrendszer verziója:2.0.50727.42; ASP.NET verziója:2.0.50727.42
|||

I don't understand I try to make an other database in app_data new_item anotherdatabase.mdf and I have got this message:
Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed.
I reinstall Confused everything maybe next time work normal.

|||

Where is located aspnetdb.mdf?

|||

C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\here

But I try to put them into the App_Data and doesn't work.
I install Windows Longhorn Beta (server 2008) and sites runingI try the same in my notebook windows XP HUN and workso I don't know what is the problem ,but NOW run everythingSmile and I don't care.

ASPNETDB

In response to a problem I have, my web hosting company asked me to rename aspnetdb.mdf. When I ask why, I was given this response

...it is because SQLexpless is developed for single database. If there is a same db name in the server, it cannot attach to the server. In order to prevent conflict, so that you need to change the SQLexpress's dbname into others to prevent conflict with others db name...

Does this make sense?

I think there is some confusion here in terminology.

You should store data for your application database, with a name for you, you should not store your tables, views, sp etc in the aspnetdb database, I believe that Db is reserved for use by ASP.Net itself, hence there is only one per server. SQL Express can host ltos of DBs but only one of each name.

aspnet_wp.exe could not be started.

When I launch the reporting services report server on my sql server, I
recieve the following error:
"Server Application Unavailable
The web application you are attempting to access on this web server is
currently unavailable. Please hit the "Refresh" button in your web browser
to retry your request.
Administrator Note: An error message detailing the cause of this specific
request failure can be found in the application event log of the web server.
Please review this log entry to discover what caused this error to occur."
In the event log, the details are...
"aspnet_wp.exe could not be started. The error code for the failure is
80004005. This error can be caused when the worker process account has
insufficient rights to read the .NET Framework files. Please ensure that the
.NET Framework is correctly installed and that the ACLs on the installation
directory allow access to the configured account. "
I have validated that ASPNET user account does have the appropriate
permissions.
I have ran "aspnet_regiis -i".
I have validated that ASPNET user account is not locked out.
Are there any other solutions that I can try to get my report server
functioning?Hi Rhonda,
Make sure 'ASP.Net Machine Account' has Full Control permissions to the
following folder:
"C:\WINNT\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files"
Eshoo
"Helpme Rhonda" <Helpme Rhonda@.discussions.microsoft.com> wrote in message
news:7AA4DA9E-232E-420D-A5A3-47F213B54975@.microsoft.com...
> When I launch the reporting services report server on my sql server, I
> recieve the following error:
> "Server Application Unavailable
> The web application you are attempting to access on this web server is
> currently unavailable. Please hit the "Refresh" button in your web
browser
> to retry your request.
> Administrator Note: An error message detailing the cause of this specific
> request failure can be found in the application event log of the web
server.
> Please review this log entry to discover what caused this error to occur."
> In the event log, the details are...
> "aspnet_wp.exe could not be started. The error code for the failure is
> 80004005. This error can be caused when the worker process account has
> insufficient rights to read the .NET Framework files. Please ensure that
the
> .NET Framework is correctly installed and that the ACLs on the
installation
> directory allow access to the configured account. "
> I have validated that ASPNET user account does have the appropriate
> permissions.
> I have ran "aspnet_regiis -i".
> I have validated that ASPNET user account is not locked out.
> Are there any other solutions that I can try to get my report server
> functioning?|||My 'ASP.Net Machine Account' does have full control of the directory
mentioned below. I also have a folder of
"C:\WINNT\Microsoft.NET\Framework\v1.0.3705\" from the original installation.
Could there be some conflict with that being there?
If not, are there any other suggestions? Thank you in advance.
"Eshoo" wrote:
> Hi Rhonda,
> Make sure 'ASP.Net Machine Account' has Full Control permissions to the
> following folder:
> "C:\WINNT\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files"
>
> Eshoo
> "Helpme Rhonda" <Helpme Rhonda@.discussions.microsoft.com> wrote in message
> news:7AA4DA9E-232E-420D-A5A3-47F213B54975@.microsoft.com...
> > When I launch the reporting services report server on my sql server, I
> > recieve the following error:
> >
> > "Server Application Unavailable
> > The web application you are attempting to access on this web server is
> > currently unavailable. Please hit the "Refresh" button in your web
> browser
> > to retry your request.
> >
> > Administrator Note: An error message detailing the cause of this specific
> > request failure can be found in the application event log of the web
> server.
> > Please review this log entry to discover what caused this error to occur."
> >
> > In the event log, the details are...
> >
> > "aspnet_wp.exe could not be started. The error code for the failure is
> > 80004005. This error can be caused when the worker process account has
> > insufficient rights to read the .NET Framework files. Please ensure that
> the
> > .NET Framework is correctly installed and that the ACLs on the
> installation
> > directory allow access to the configured account. "
> >
> > I have validated that ASPNET user account does have the appropriate
> > permissions.
> > I have ran "aspnet_regiis -i".
> > I have validated that ASPNET user account is not locked out.
> >
> > Are there any other solutions that I can try to get my report server
> > functioning?
>
>|||My agency is have this problem as well... I am exhaused from troubleshooting
SQL Reporting Services. Here are details of the problem:
I've been having a little trouble with an installation of SQL Reporting
Services. The installation is truly vanilla, but I can't seem to find a
resolution for the below noted problem. I have tried all of the fixes I can
find on MSDN and TechNet in the Knowledge Base that address the error
message. If you can help at all, I would greatly appreciate.
From Browser Requesting Reporting Services (http://{hostname}/Reports/ or
http://{hostname}/reportserver):
Server Application Unavailable
The web application you are attempting to access on this web server is
currently unavailable. Please hit the "Refresh" button in your web browser to
retry your request.
Administrator Note: An error message detailing the cause of this specific
request failure can be found in the application event log of the web server.
Please review this log entry to discover what caused this error to occur.
Event Log Detail:
aspnet_wp.exe could not be started. The error code for the failure is
80070545. This error can be caused when the worker process account has
insufficient rights to read the .NET Framework files. Please ensure that the
.NET Framework is correctly installed and that the ACLs on the installation
directory allow access to the configured account.
Knowledge Base/MSDN/TechNet Attempted Fixes:
317012, 315158, 323292, 833444, 811320
In one situation there were errors in the security log regarding access,
this was resolved on that installation and now works. The only errors
produced in the event log is the one noted above.
"Eshoo" wrote:
> Hi Rhonda,
> Make sure 'ASP.Net Machine Account' has Full Control permissions to the
> following folder:
> "C:\WINNT\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files"
>
> Eshoo
> "Helpme Rhonda" <Helpme Rhonda@.discussions.microsoft.com> wrote in message
> news:7AA4DA9E-232E-420D-A5A3-47F213B54975@.microsoft.com...
> > When I launch the reporting services report server on my sql server, I
> > recieve the following error:
> >
> > "Server Application Unavailable
> > The web application you are attempting to access on this web server is
> > currently unavailable. Please hit the "Refresh" button in your web
> browser
> > to retry your request.
> >
> > Administrator Note: An error message detailing the cause of this specific
> > request failure can be found in the application event log of the web
> server.
> > Please review this log entry to discover what caused this error to occur."
> >
> > In the event log, the details are...
> >
> > "aspnet_wp.exe could not be started. The error code for the failure is
> > 80004005. This error can be caused when the worker process account has
> > insufficient rights to read the .NET Framework files. Please ensure that
> the
> > .NET Framework is correctly installed and that the ACLs on the
> installation
> > directory allow access to the configured account. "
> >
> > I have validated that ASPNET user account does have the appropriate
> > permissions.
> > I have ran "aspnet_regiis -i".
> > I have validated that ASPNET user account is not locked out.
> >
> > Are there any other solutions that I can try to get my report server
> > functioning?
>
>|||Me too. This is frustrating. Is this a bug? I had a perfectly operational
install of SQLRS SP1 until I installed SP2. Anyone with ideas?
"Helpme Rhonda" wrote:
> When I launch the reporting services report server on my sql server, I
> recieve the following error:
> "Server Application Unavailable
> The web application you are attempting to access on this web server is
> currently unavailable. Please hit the "Refresh" button in your web browser
> to retry your request.
> Administrator Note: An error message detailing the cause of this specific
> request failure can be found in the application event log of the web server.
> Please review this log entry to discover what caused this error to occur."
> In the event log, the details are...
> "aspnet_wp.exe could not be started. The error code for the failure is
> 80004005. This error can be caused when the worker process account has
> insufficient rights to read the .NET Framework files. Please ensure that the
> .NET Framework is correctly installed and that the ACLs on the installation
> directory allow access to the configured account. "
> I have validated that ASPNET user account does have the appropriate
> permissions.
> I have ran "aspnet_regiis -i".
> I have validated that ASPNET user account is not locked out.
> Are there any other solutions that I can try to get my report server
> functioning?|||Just as an FYI, as a work around, I added the ASP.NET user account to the
local server's Administrators group and it started working again:
NOTE: This completely defeats the purpose of having the ASP.NET account so
we still need to find a solution to why this "just happens".
"Helpme Rhonda" wrote:
> When I launch the reporting services report server on my sql server, I
> recieve the following error:
> "Server Application Unavailable
> The web application you are attempting to access on this web server is
> currently unavailable. Please hit the "Refresh" button in your web browser
> to retry your request.
> Administrator Note: An error message detailing the cause of this specific
> request failure can be found in the application event log of the web server.
> Please review this log entry to discover what caused this error to occur."
> In the event log, the details are...
> "aspnet_wp.exe could not be started. The error code for the failure is
> 80004005. This error can be caused when the worker process account has
> insufficient rights to read the .NET Framework files. Please ensure that the
> .NET Framework is correctly installed and that the ACLs on the installation
> directory allow access to the configured account. "
> I have validated that ASPNET user account does have the appropriate
> permissions.
> I have ran "aspnet_regiis -i".
> I have validated that ASPNET user account is not locked out.
> Are there any other solutions that I can try to get my report server
> functioning?

Sunday, February 19, 2012

ASPNET Acct in SQL Server 2000

I have windows Server 2003 w/ IIS 6.0 running an asp.net
web application. The web application needs to connect to
another server, with SQL Server 2000 installed. We also
have Active Directory.
My question is how do I get the ASPNET account to show up
in the list of users on SQL Server? Do I need to add it
to Active directory? Do I need to create another user as
ASPNET on SQL Server?
Thanks for the help.
Steve M.815154 HOW TO: Configure SQL Server Security for .NET Applications
http://support.microsoft.com/?id=815154
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.

ASP2.0 INSERT into SQL2000 problems

First thanks for any help anyone can give me. Here is the environment: SQL2000 server, 2003 Web server, ASP2.0, SQL

I've banged my head around trying to get this code to insert some data into a table cell on a db table, and it simply is not working, through trial and error i've figured that I simply have wrote crappy sql code so if anyone can give it a look over and see if they notice what the devil I missed, it would be much appreciated, if you need to see more of the code give me a shout.

If (Page.IsValid = True)

' MailClient.Send(MailFrom, MailTo, MailSubject, MailBody)'

Dim SQLConn As SqlConnection = New SqlConnection()
SQLConn.ConnectionString = ConfigurationSettings.AppSettings("ConnectionString")
SQLConn.Open()
Dim strSQL As String = "INSERT INTO kittens (email) VALUES (frogger);"
SQLConn.Close()

End If
End Sub

Remove the semi-colin from ther end of the query, also 'frogger' should be encapsulated in single quotes. All text, ntext, varchar, nvarchar, etc.. need to have their values in quotes unless passed through a variable.

INSERT INTO kittens (email) VALUES ('frogger')

|||

bluemistonline:

Remove the semi-colin from ther end of the query, also 'frogger' should be encapsulated in single quotes. All text, ntext, varchar, nvarchar, etc.. need to have their values in quotes unless passed through a variable.

INSERT INTO kittens (email) VALUES ('frogger')

Did you also mean for me to take the "" from the statements as well? With those taken out I get a (BC30205: End of statement expected) error.

I guess I will post the whole code (the nonhtml stuff anyway) and see if anyone notices anything. I'm beginning to wonder if I have the sql table itself not set up right somehow. As is obvious I am very new to ASP.net and SQL as in I new nothing about how to code either until I started on this recent project so I am learning by doing :b

login.aspx code

<%@. Page Explicit="true" debug="true" language="vb" %>
<%@. Import Namespace="System.Data" %>
<%@. Import Namespace="System.Data.SqlClient" %>
<%@. Import Namespace="System.Data.Mail" %>
<%@. Import Namespace="System.Net.Mail" %>

<script runat="server">
Sub submitClick(Source as Object, E as EventArgs)

Dim eMsg as String

eMsg +="Customer Information" & vbcrlf
eMsg +="Email: " & txtEmail.Text & vbcrlf
eMsg +="Company: " & txtCompany.Text & vbcrlf
eMsg +="Last Name: " & txtLastName.Text & vbcrlf
eMsg +="First Name: " & txtFirstName.Text & vbcrlf
eMsg +="Phone Number: " & txtPhoneNumber.Text & vbcrlf

Dim MailClient = New SmtpClient("xxx.xxxx.xxx.xxxxx")
Dim MailFrom As String = "mittens@.mittens.com"
Dim MailTo As String = "scarf@.scarf.com"
Dim MailSubject As String = "New Customer Information"
Dim MailBody As String = eMsg

If (Page.IsValid = True)

' MailClient.Send(MailFrom, MailTo, MailSubject, MailBody)'

Dim SQLConn As SqlConnection = New SqlConnection()
SQLConn.ConnectionString = ConfigurationSettings.AppSettings("ConnectionString")
SQLConn.Open()
Dim strSQL As String = INSERT INTO cuinfo ('email') VALUES ('frogger')
SQLConn.Close()

End If
End Sub

</script>

And this is the web.config

<configuration>
<appSettings>
<add key="ConnectionString" value="DataSource=mittens@.mittens.com;UID=mittens;pwd=itsasecret" />
<add key="ConnectionString" value="Server=xxx.xxxx.xxx.xxxxx;database=kittens;UID=mew;pwd=mewmew;Trusted_Connection=True" />
</appSettings>
<system.web>
<sessionState cookieless="false" timeout="20" />
<customErrors mode="Off"/>
</system.web>
</configuration>

For the SQL table itself, the UID "mew" doesn't have to be owner of the table correct, the only they need is the write access. Currently what happens is the submit button on login.aspx is clicked and the screen refreshes without any errors, and the email with the data is sent (or would be if I didn't have it commented out right now), but nothing appears in the database table. I manually go to the table and right-click tell it to show all rows and it shows an empty table. The email column is empty and in this case frogger does not show up in it.

Thx for any help.

|||

No put the double quotes back. Basic .NET systax requires you to encapsulate all string values in double quotes!!!

Maybe your should brush up on .NET systax before posting absurd questions.

Here is a good link:http://authors.aspalliance.com/aspxtreme/aspnet/syntax/aspnetsyntax.aspx

|||

Change:

SQLConn.Open()
Dim strSQL As String = INSERT INTO cuinfo ('email') VALUES ('frogger')
SQLConn.Close()

to:

SQLConn.Open()

Dim cmd as new SqlCommand("INSERT INTO cuinfo(email) VALUES (@.email)",SQLConn)

cmd.Parameters.Add("@.email",sqldbtype.Varchar).Value=txtEmail.Text

cmd.ExecuteNonQuery

SQLConn.Close

|||

Thx Motley, that seemed to fix that problem, a new one cropped up, but I'm going to try and work it, before deciding whether to post for help.

Thx again for the help Motley.

ASP.NET-Report Viewer-Internet

Hi,
I am planning to use Report viewer web control in my web application and
going to use forms authenthication. What roles need to assign in RS and what
are the other settings need to be done.
Thanks & Rgds,
AruThe roles settings are no different between forms authentication and Windows
authentication. The settings for forms authentication are described here:
http://msdn.microsoft.com/library/?url=/library/en-us/dnsql2k/html/ufairs.asp?frame=true#ufairs
--
Cheers,
'(' Jeff A. Stucker
\
Business Intelligence
www.criadvantage.com
---
"Aru" <Aru@.discussions.microsoft.com> wrote in message
news:5B452DEB-E608-4814-B15B-5842E016B9F4@.microsoft.com...
> Hi,
> I am planning to use Report viewer web control in my web application and
> going to use forms authenthication. What roles need to assign in RS and
> what
> are the other settings need to be done.
> Thanks & Rgds,
> Aru

Thursday, February 16, 2012

ASP.Net, Microsoft SQL Server 2005 and XML

Hi!
I work in a web site project which uses ASP.net and Microsoft SQL
Server 2005. I use XML and XSL for my pages. My problem is:
oAs the data in the database contain some characters that are not
allowed by XML structure, I used CDATA for all my fields in order to
store them in the XML file like that :
vignettes_xml = vignettes_xml + "<transcription_texte><![CDATA[" +
reader1.GetString(47) + "]]></transcription_texte>"
oBut After I realized that with CDATA I can't access to my XML
structures inside the field (knowing that some fields in the database
stored XML data). So I changed my field to normal writing like that:
vignettes_xml = vignettes_xml + "<transcription_texte>" +
reader1.GetString(47) + "]</transcription_texte>"
oThe problem is : with both the first and the second writing I have in
my XML variable transcription_texte an empty data. But in my database
every transcription_texte contains a long XML structure. I did not
understand what the source of the problem is.
Your answers can be very helpful.
Regards,
Djamila.
Hello djamilabouzid@.gmail.com,
Its not all that clear as what is cause a problem here because we don't know
what reade1.GetString(47) is actually returning.

> Hi!
> I work in a web site project which uses ASP.net and Microsoft SQL
> Server 2005. I use XML and XSL for my pages. My problem is:
> oAs the data in the database contain some characters that are not
> allowed by XML structure, I used CDATA for all my fields in order to
> store them in the XML file like that :
> vignettes_xml = vignettes_xml + "<transcription_texte><![CDATA[" +
> reader1.GetString(47) + "]]></transcription_texte>"
> oBut After I realized that with CDATA I can't access to my XML
> structures inside the field (knowing that some fields in the database
> stored XML data). So I changed my field to normal writing like that:
> vignettes_xml = vignettes_xml + "<transcription_texte>" +
> reader1.GetString(47) + "]</transcription_texte>"
> oThe problem is : with both the first and the second writing I have
> in my XML variable transcription_texte an empty data. But in my
> database every transcription_texte contains a long XML structure. I
> did not understand what the source of the problem is.
> Your answers can be very helpful.
> Regards,
> Djamila.
>
Thanks,
Kent Tegels
http://staff.develop.com/ktegels/
|||Also instead of trying to construct your XML using string concatenations,
why don't you use FOR XML?
Best regards
Michael
"Kent Tegels" <ktegels@.develop.com> wrote in message
news:b87ad747edd8c8b87741135600@.news.microsoft.com ...
> Hello djamilabouzid@.gmail.com,
> Its not all that clear as what is cause a problem here because we don't
> know what reade1.GetString(47) is actually returning.
>
> Thanks,
> Kent Tegels
> http://staff.develop.com/ktegels/
>