Showing posts with label asp. Show all posts
Showing posts with label asp. Show all posts

Sunday, March 25, 2012

Attach an aspnet or sql2005 database on a sql2000 server

Hello

I want to attach an ASPNETDB database (generated by the asp.net login wizard system), which is a sql2005 .mdf database I think, to our SQL2000 server.

I tried to attach the file directly ; then to attach it to a sql2005 express server, "turning it" into a sql2000 database via the properties, then make a backup, then restore the backup on the 2000 server ; nothing worked out !
One of the method I tried (I don't remember which one) told me it could'nt read the sysindexes table ; of course, because there isn't such table on sql2005 databases.

So, is there a way to attach a SQL2005 database (so with no or few system tables) to a SQL2000 server (which requires those tables), or to re-generate the ASPNETDB in the SQL2000 format ?
If I re-create the syssomething tables on the SQL2005 database, will it work that simply ?

At the very last, I may have to install SQL express on the server. If there is already a SQL2000 server on the machine, will it cohabit with no problem ? Is the SQL express server ready for a production server with light or medium load ?

Thanks a lot, and sorry for so many questions ! :)

Hi,

"I want to attach an ASPNETDB database (generated by the asp.net login wizard system), which is a sql2005 .mdf database I think, to our SQL2000 server."

-That′s not working, the format is different to SQL Server 2k5, there is no backward compatibility.

""turning it" into a sql2000 database"

-Making the compatibility level to 2000 doesn't mean that the database is 2000 ready, it just behaves on a SQL2k5 machine like a SQL 2k database.

You will either have to script the object and the data out or bcp the data out or use any wizard to transfer the objects to the other SQL 2000 Server machine.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de

|||Ok, and if I export the database structure as a SQL script, will it just work ?

And for the SQL2005 Express server, is it usable along with the SQL2000 server, and does it fits for a ligt-load production server ?

thanks !
|||

Hi,

sure as long as you don′t use any new features of SQL Server 2005 and you take care of the difference of schema and owner you should be fine.

SQL 2k and SQL2k5X is working together. It can be also used as a light load production server (whatever that means in your case :-) ), it is only limited by the limitations of SQL Server Express, no query governor or anything else.

HTH, jens Suessmeyer.

http://www.sqlserver2005.de

Thursday, March 22, 2012

Asynch call DTS or Stored procedure 1.1

Hi,

I would like to trigger a DTS or a stored procedure from asp.net 1.1 BUT

I don't want to wait for it to finish. In fact the DTS/Storeproc calculates values into different tables.

Those values are not needed immediately. The calculation takes between 20 or 30 minutes.

Do you have any idea how to do it ?

Thanks

The easiest way I can think of to do it is to have a daemon sitting on the server. Tickle the daemon (either via a port, web service, or table on the DB that the daemon watches), and it'll fire off the stored procedure and keep the connection open until the SP completes.|||In this case I have to put a connection timeout to more than 5 minutes ... It's not a good solution neither|||

Valvert:

I would like to trigger a DTS or a stored procedure from asp.net 1.1 BUT

I don't want to wait for it to finish. In fact the DTS/Storeproc calculates values into different tables.

Hello, i'm not a DBA expert and have never tried this, but i guess you could define a job to be started manually; then start the job withsp_start_job and check for termination withsp_help_job.

HTH. -LV

Sunday, March 11, 2012

Assigning to multipule categories

Ok guys,
I'm realitvely new to the whole database development stuff, but I have a very important project to finish using SQL and ASP. I am to design a new links manager for a website.
Right now I have the following:
The ability to add a link, and edit it
The ability to add a category and edit it

When you go to add a link, a list of categories is provided for you, with checkboxes. What I need to do is figure out how to assign multipule categories to one link.
I have a Cross-Referencing table with three fields:
CrossRefID
LinkID
and CatID.

If you need more clarification, post here and let me know.

Thanks in Advance,
Aaron Hawn (aaron@.ionzion.net)The table structure you provided is sufficient to answer that question. Can you clarify your issue?|||Operative word being think, I think you are asking how to represent multiple relationships using the table schema you've described. One row in the table represents one cross reference from a link to a category. To represent multiple category relationships for a single link, you add multiple rows to the Cross-reference table for that LinkID.

-PatP

Thursday, March 8, 2012

Assigning a unique ID

I have an asp page in which the user completes some information and the data
is stored in an SQL database. I want to automatically assign an unique ID
number (can start with 1) to each record when the data is saved to the
database and display this number on the confirmation page.
This is probably much easier that I am making it. Any help would be
appreciated.
Thanks,CREATE TABLE dbo.CustomerData
(
CustomerDataID INT IDENTITY(1,1),
SomeData VARCHAR(32)
)
GO
CREATE PROCEDURE dbo.AddCustomerData
@.SomeData VARCHAR(32),
@.CustomerDataID INT OUTPUT
AS
BEGIN
SET NOCOUNT ON;
INSERT dbo.CustomerData(SomeData) SELECT @.SomeData;
SET @.CustomerDataID = SCOPE_IDENTITY();
END
GO
DECLARE @.id INT;
EXEC dbo.AddCustomerData 'foo', @.id OUTPUT;
SELECT new_id = @.id;
SELECT CustomerDataID, SomeData FROM dbo.CustomerData;
"Ken D." <KenD@.discussions.microsoft.com> wrote in message
news:DDAB88EE-9D62-499F-9D02-BFA99948B222@.microsoft.com...
>I have an asp page in which the user completes some information and the
>data
> is stored in an SQL database. I want to automatically assign an unique ID
> number (can start with 1) to each record when the data is saved to the
> database and display this number on the confirmation page.
> This is probably much easier that I am making it. Any help would be
> appreciated.
> Thanks,|||Do I drop this code on the asp page?
"Aaron Bertrand [SQL Server MVP]" wrote:

> CREATE TABLE dbo.CustomerData
> (
> CustomerDataID INT IDENTITY(1,1),
> SomeData VARCHAR(32)
> )
> GO
> CREATE PROCEDURE dbo.AddCustomerData
> @.SomeData VARCHAR(32),
> @.CustomerDataID INT OUTPUT
> AS
> BEGIN
> SET NOCOUNT ON;
> INSERT dbo.CustomerData(SomeData) SELECT @.SomeData;
> SET @.CustomerDataID = SCOPE_IDENTITY();
> END
> GO
> DECLARE @.id INT;
> EXEC dbo.AddCustomerData 'foo', @.id OUTPUT;
> SELECT new_id = @.id;
> SELECT CustomerDataID, SomeData FROM dbo.CustomerData;
>
>
>
> "Ken D." <KenD@.discussions.microsoft.com> wrote in message
> news:DDAB88EE-9D62-499F-9D02-BFA99948B222@.microsoft.com...
>
>|||No, this is T-SQL code, not ASP code. For some help running the stored
procedure from ASP, see an ASP newsgroup, if these articles don't clear it
up:
http://www.aspfaq.com/2201
http://www.aspfaq.com/params.htm
"Ken D." <KenD@.discussions.microsoft.com> wrote in message
news:A33184A6-09AF-4CF8-AB13-44009E40E7CB@.microsoft.com...
> Do I drop this code on the asp page?|||Gasp! No, you copy / paste it into the OnBlur event your website's flaming
logo. Please tell me this is not a e-commerce, financial, or defense related
website!
"Ken D." <KenD@.discussions.microsoft.com> wrote in message
news:A33184A6-09AF-4CF8-AB13-44009E40E7CB@.microsoft.com...
> Do I drop this code on the asp page?
> "Aaron Bertrand [SQL Server MVP]" wrote:
>|||Are you kidding. It is just an company Intranet page.
Man, if they let me program fo rthe feds, look out...lol
Just trying to automate a process.
Let me ask this on the example from Aaron.
I get that dbo.CustomerData is my DB name (Compliance). My ID field is
called RequestID so is that CustomerDataID or SomeData? What would the othe
r
one be (the name of the table?).
Sorry, not a programmer by trade but I certainly appreciate the help...
"JT" wrote:

> Gasp! No, you copy / paste it into the OnBlur event your website's flaming
> logo. Please tell me this is not a e-commerce, financial, or defense relat
ed
> website!
> "Ken D." <KenD@.discussions.microsoft.com> wrote in message
> news:A33184A6-09AF-4CF8-AB13-44009E40E7CB@.microsoft.com...
>
>|||OK, it takes me awhile to grasp the concept but here is what I got:
CREATE TABLE dbo.CommunityService
(
RefNum Int IDENTITY(1,1),
BranchDept VARCHAR(75),
Region VARCHAR(50),
EmployeeName VARCHAR(50),
CompletedBy VARCHAR(50),
Organization VARCHAR(125),
Contacts VARCHAR(50),
Phone VARCHAR(50),
Address VARCHAR(255),
CensusArea NTEXT,
ServiceType NTEXT,
ServiceDesc NTEXT,
BenefitDesc NTEXT,
MoneyEquip NTEXT,
Comments NTEXT,
TimeStamp DATETIME
)
GO
CREATE PROCEDURE dbo.AddRequestID
@.Region VARCHAR(50),
@.RefNum INT OUTPUT
AS
BEGIN
SET NOCOUNT ON;
INSERT dbo.CommunityService(Region) SELECT @.Region;
SET @.RefNum = SCOPE_IDENTITY();
END
GO
DECLARE @.id INT;
EXEC dbo.AddRequestID, @.id OUTPUT;
SELECT new_id = @.id;
SELECT RefNum, Region FROM dbo.CommunityService;
My question is that I am getting an error on Line 3 near ','. It all seems
OK so what am I missing?
********************************
"Ken D." wrote:
> Are you kidding. It is just an company Intranet page.
> Man, if they let me program fo rthe feds, look out...lol
> Just trying to automate a process.
> Let me ask this on the example from Aaron.
> I get that dbo.CustomerData is my DB name (Compliance). My ID field is
> called RequestID so is that CustomerDataID or SomeData? What would the ot
her
> one be (the name of the table?).
> Sorry, not a programmer by trade but I certainly appreciate the help...
> "JT" wrote:
>|||> My question is that I am getting an error on Line 3 near ','. It all
> seems
> OK so what am I missing?
Part of the code sample I sent. What does this mean?

> EXEC dbo.AddRequestID, @.id OUTPUT;
You forgot to include your region parameter:
EXEC dbo.AddRequestID 'NorthEast', @.id OUTPUT;|||Cool. I added 'test" and changed my seed to 0. It worked wonderful.
Thanks and so sorry for the ignorance.
Have a great day Aaron.
"Aaron Bertrand [SQL Server MVP]" wrote:

>
> Part of the code sample I sent. What does this mean?
>
> You forgot to include your region parameter:
> EXEC dbo.AddRequestID 'NorthEast', @.id OUTPUT;
>
>
>
>|||Aaron,
One last question. What is I wanted to add a prefix to the ID. Is that
possible?
"Aaron Bertrand [SQL Server MVP]" wrote:

> CREATE TABLE dbo.CustomerData
> (
> CustomerDataID INT IDENTITY(1,1),
> SomeData VARCHAR(32)
> )
> GO
> CREATE PROCEDURE dbo.AddCustomerData
> @.SomeData VARCHAR(32),
> @.CustomerDataID INT OUTPUT
> AS
> BEGIN
> SET NOCOUNT ON;
> INSERT dbo.CustomerData(SomeData) SELECT @.SomeData;
> SET @.CustomerDataID = SCOPE_IDENTITY();
> END
> GO
> DECLARE @.id INT;
> EXEC dbo.AddCustomerData 'foo', @.id OUTPUT;
> SELECT new_id = @.id;
> SELECT CustomerDataID, SomeData FROM dbo.CustomerData;
>
>
>
> "Ken D." <KenD@.discussions.microsoft.com> wrote in message
> news:DDAB88EE-9D62-499F-9D02-BFA99948B222@.microsoft.com...
>
>

Assign session variable value to update parameter

Hi, I'm trying to update a sqlserver database through vb.net in an asp.net 2.0 project. I'm using a sqldatasource and am trying to code an update parameter with a session variable.

code snippet:

<UpdateParameters><asp:ParameterName="hrs_credited"/>

<asp:ParameterName="updater_id"DefaultValue="<%$ Session("User_ID")%>"Type="Int32"/>

<asp:ParameterName="activity_id"/>

<asp:ParameterName="attendee_id"/>

</UpdateParameters>

The error message that I receive is:

Error 2 Literal content ('<asp:Parameter Name="updater_id" DefaultValue="" Type="Int32"/>') is not allowed within a 'System.Web.UI.WebControls.ParameterCollection'. C:\Development\CME\dataentry\attendance.aspx 29

Does anyone have an idea how to assign the session var value to the parameter?

Thanks!

There is a special parameter called a SessionParameter that does exactly that. Refer to this page for more information:http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.sessionparameter.aspx

Saturday, February 25, 2012

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.

AspNetSessionExpiredException - Your results may vary?

I have a custom reporting application that displays Sql Server Reporting Services reports on an ASP.NET page using Microsoft's report viewer control. The SSRS reports are local reports (they have an rdlc extension).

When a report is left inactive for a lengthy period of time it generates anAspNetSessionExpiredException when the user attempts to move to a new page. The thing that is surprising is that the formatted exception display is contained within the report viewer. The report document map remains visible as does the report toolbar. In the right pane where the report normally appears I see a standard, raw, ASP.NET exception display.

I'm surprised that the report viewer is "catching" the exception and displaying it within the report viewer. Standard events in the page that hosts the report viewer (PreInit, Init, PageLoad) are never invoked.

I have graceful error handling defined in a base page class but it does me no good because the exception never reaches the page code-behind. Puzzling.

Do any of you ASP.NET developers know if it is possible to catch theAspNetSessionExpiredExceptionso that I can handle it in my application code rather than having SSRS display a very ugly, very raw exception message.

I've included the exception message below.

Thanks.

BlackCatBone

...

Server Error in '/templatedemo' Application.

------------------------

ASP.NET session has expired

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: Microsoft.Reporting.WebForms.AspNetSessionExpiredException: ASP.NET session has expired

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[AspNetSessionExpiredException: ASP.NET session has expired]

Microsoft.Reporting.WebForms.ReportDataOperation..ctor() +683

Microsoft.Reporting.WebForms.HttpHandler.GetHandler() +553

Microsoft.Reporting.WebForms.HttpHandler.ProcessRequest(HttpContext context) +10

System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +154

System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64

------------------------

Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42

I am having exactly the same problem. If anyone knows the solution to this it would be fabulous to here from you.

|||

I had the same problem and I found the solution in this posthttp://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=170875&SiteID=1. See Brian Hartman's post regarding sessionState. I used his suggestion of using the out-of-process session state as StateServer mode and it fixed the issue for me. Good luck.

Friday, February 24, 2012

ASPNETDB.MDF is readonly

I have downloaded and installed ASP.NET Ajax Sample applications from

http://ajax.asp.net/default.aspx?tabid=47&subtabid=471

I am trying to run the AJAX TaskList example under C:\Program\Microsoft ASP.NET\ASP.NET AJAX Sample Applications\v1.0.61025\TaskList

First I moved the content of the TaskList folder to a virtual IIS directory, making it possible to debug the website on my local IIS server.

When I run the example I get prompted to Login or register as a new user. When I submit the registration form I receive the following error message:

Failed to update database "C:\INETPUB\WWWROOT\TASKLIST\APP_DATA\ASPNETDB.MDF" because the database is read-only.

How can I modify the permissions forASPNETDB.MDF in order to run the TaskList example.

Thanks

Additional information:

I have installed SQL Server Management Studio Express as I figured this tool might help me to change the permissions. It did not help. I also tried to delete ASPNETDB.mdf, and recreate it by going Website -> Asp.net configuration by adding a new user. I still receive the same error message.

When I point the connection string to a remote SQL database of mine it is possible to register users in ASPNETDB.mdf. But I havn't figured out how to add users using a local version of ASPNETDB.mdf.

I am running Visual Studio on Windows XP. In windows XP you can't just modify permissions for folders as far as I know. I have recently installed SQL Server Management Studio Express as I said before.

I read somewhere that the read/write property for ASPNETDB.mdf may be enabled by checking a box somewhere.

But in SQL Server Management Studio Express tried the following:

*Right click on databases and click attach

*Click Add and select the database ASPNETDB.mdf

*Click OK

*Right Click on the path for ASPNETDB.mdf and click properties

When I click 'Options' under select a page Database Read-Only is already set to false.

If there is not way to use a local version of ASPNETDB.mdf (App_Data folder) I simply have to put up with my remote MS SQL 2005 database. But the subscription fee for this database is outrageous, and therefore I hope that someone might help me and everyone else by providing the appropriate steps to use ASPNETDB.mdf located to the App_Data folder, both on the local IIS server and server side.

Thanks
Svenbro

|||This can be a permission ?issue. Open Management Studio Express->connect to SQL Express instance->go to Security->Logins->make?sure the 'NT AUTHORITY\NETWORK SERVICE' account is there.|||

The 'NT AUTHORITY\NETWORK SERVICE' account is not in the list, but there is a similar item: NT INSTANS\SYSTEM

Should I add 'NT AUTHORITY\NETWORK SERVICE' as a new account with the Windows authentication property checked?

Thanks,

|||NETWORK SERVICE?is?hidden, just type it and click check name in the browse text, you should get it.

ASPNETDB.mdf "...already in use..." Error and Broader Questions

When you create and host an ASP.Net 2.0 site on your local computer and then configure .Net 2.0's drop-in user registration and management system it creates a SQL file named ASPNETDB.mdf with a whole bunch of tables and stored procedures (…as most of you know). If you add your own custom tables to that database file and then try to call those tables you get an error that says that ASPNETDB.mdf is already in use. One way to get around this is to create a separate database in the form of another ".mdf" file and then put all of your own custom tables in it. You avoid the "...already in use..." errors that way but all your user accounts and the primary key structure that identifies them are in the original ASPNETDB.mdf file. This makes it impossible to do primary/foreign key relationships between those tables and those in the new separate database you created. It's kind of a catch-22 situation...unless I'm missing something that relates to releasing the ASPNETDB.mdf file from use whenever it is called so that additional tables and queries against that database file can be made without the "…already in use…" error cropping up. I am wondering if this problem is because the ASPNETDB.mdf file is not a "real" SQL database and as such imposes multiple-connectivity limitations such as those I am seeing. If this is true, migrating to a real SQL database would alleviate this? Finally, from a broader security and scalability standpoint…what are the best practices relating to use of the ASPNETDB.mdf database for all your custom tables? Should an additional database be created for all my application's custom tables (leading to the primary/foreign key problems) or should the additional tables be put into the ASPNETDB.mdf file (with some way of working around the "…already in use…" error)? A long-winded and broad question…thanks in advance for any responses.

MDCragg

The default membership provider already has an open connection to the file, which seems like the reason why you can't make your own connection. Perhaps you could extend this provider to keep its current functionality, but add your own requirements to access the other tables, as well. The default provider is the System.Web.Security.SqlMembershipProvider class. After you create this, set it as the default provider in your web.config.

Sample on how to configure a membership provider in web.config:http://msdn2.microsoft.com/en-us/library/44w5aswa.aspx

|||

That article tells how to merge the membership provider tables and stored procedures into my own database. I will try this to see if it solves the problem. I am at least a little bit doubtful if it will though because it seems like it will just shift the same persistent and exclusive connectivity problem I am having from the current user account database to my own database.

|||

This seems to have worked. I installed SQL Server Management Studio Express. I wasn't able to navigate to the existing custom database that I had created so I copied it to the default directory that SQL Server MSE utilizes. I was able to connect to it there and thus "attach" it to my PC's SQL host. Once that was done I was able to use the aspnet_regsql.exe utility to populate that database with all of .Net's Membership tables, views, stored procedures, etc. I copied the database back to the App_Data folder. I adjusted all the Membership entries in the web.config folder to "point to" the custom database instead of the ASPNETDB.mdf file (which I removed). I did some additional tweaking with things such as connection strings. Then I launched the site and everything seemed to work. I am able to connect to the .Net Membership tables as well as all my own tables...all of which exist in the one custom database file.

So, this is fixed although I don't know what the difference was between the ASPNETDB.mdf file and the custom ".mdf" file that I created. I'm sure there is a setting or two somewhere in the database instance, the connection, or something or other that led to the difficulty.

ASPNETDB.MDF - need to use SQL Server 2000

Hi,

I'm building an intranet app for a client using ASP.NET 2. The client is running SQL Server 2000 - and does not have plans to upgrade to 2005 anytime soon.

Is there a script that I can use to create the objects in the ASPNETDB database so that I can do this in SQL Server 2000?

Also, what additional changes would I have to make in order for the application to point to a SQL Server 2000 database with these objects?

Thanks in advance, Al

MDF(Microsoft data file) is only one half of a SQL Server database, the other half is the LDF(Log data file). That said the Personnal and Club starter kits comes with the membership database and Microsoft created a SQL Server 2000 version of both so I think you can install both take the membership related tables, triggers and stored procs. You know it is all manual so you just right click on the object in Object browser in Query Analyzer and click on create to generate the scripts. Hope this helps.

http://www.microsoft.com/downloads/details.aspx?FamilyId=0DD83A11-6980-4951-A192-DA6EACC6A19E&displaylang=en

http://www.microsoft.com/downloads/details.aspx?FamilyId=2EE85ED4-7613-47E2-8375-17222B150E4F&displaylang=en

|||Hi luckydog,

as alternative in clean way, you can run aspnet_regsql in command prompt and choose any database instance that you want to have membership tables inside it.

Run it in .Net Framework SDK Command Prompt

ASPNETDB to another database

Hi there readers of this post,

Do you know how to transfer the database (ASPNETDB.mdf) tables made by the ASP.NET admin tool into another database?

I want to run everything from 1 database.

regards

Sat

Hi

What you can do is

Go to folder

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727

in the above folder there is a file named "aspnet_regsql" run this file

it will ask you whether a default database or a partucular database in which you would like

to keep this. if you set it as default then it creates a new database"aspnetDB"

if you point to another databse[ say northwind] then all the tables necessary for member ship

do come in to northwind.

Try this if you still find issues let me know

With regards

Sridhar

ASPNETDB - Unable to connect to SQL Server database

Hi Eevryone:

I seem to have corrupted my ASP.netWeb Site Administration Tool some how. It worked fine a few days ago, but reloaded SQL Server 2005 Express Edition W Adv Services SP1 yesterday I can not get past the "Unable to connect to SQL Server database" error. I have run the aspnetdb.exe and created both a aspnetdb.mdf and loaded the tables to into a existing mdf. I have checked all the permissions.

So any ideas on what I am doing wrong, or can you point me to some documentation on the 'AspNetSqlProvider'

Thanks in advance, Gene

You could erase the file in the appdata directory and it should recreate one fromscratch for you. actually, all you need is

<roleManager enabled="true" />

to get it to make the appdata express file

|||Exactly were do I am this entry?|||

Here is a very simple web.config with rolemanager enabled.

<?xml version="1.0"?>
<!--
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>
<add name="FetchEmailConnectionString" connectionString="Data Source=TM8200;Initial Catalog=FetchEmail;Integrated Security=True"
providerName="System.Data.SqlClient" />
<add name="ConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ASPNETDB.MDF;Integrated Security=True;User Instance=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
<system.web>
<roleManager enabled="true"></roleManager>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true"/>
<!--
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>

|||

Thanks again for the help.

Your sample web.config helped prove what I was beginning to suspect yesterday. It is the creation of user instances under .SQLExpress that is causing my problems. This makes sense considering that it was after I switched to .SQLExpress from SQL 2000 that my problems started. Any suggestions on where to find good user instance documenation? So far I have not found any good trouble shooting articles.

Cheers, Gene

'aspnet_regiis' impact on classic ASP?

Hi,
We want to install RS on a Windows 2003 / IIS 6 server.
Does it hurt our 'classic' (pre .net) ASP aps if we run aspnet_regiis -i
on this machine?
tanx,
Derk JanWe have classic ASP and ASP.NET running on the same server just fine. Since
ASP.NET uses different file extensions (aspx), it shouldn't hurt.
Nevertheless, a system backup -- or trying it first on a dev server -- is
always a good idea.
--
Cheers,
'(' Jeff A. Stucker
\
Business Intelligence
www.criadvantage.com
---
"Derk Jan" <DerkJan@.discussions.microsoft.com> wrote in message
news:6BDE0622-F903-48D8-B419-4D6BD497FD0F@.microsoft.com...
> Hi,
> We want to install RS on a Windows 2003 / IIS 6 server.
> Does it hurt our 'classic' (pre .net) ASP aps if we run aspnet_regiis -i
> on this machine?
> tanx,
> Derk Jan
>

ASPNET user in MSDE

Hello.

I am using MSDE in an ASP .NET application using forms authentication in order to the user can visit my website anonymously but have to authenticate in some pages.

Web server and MSDE server are in the same computer.

I would like to know how role I should set for the ASPNET sql server user. I am using Microsoft SQL Web Data Administrator and when I am creating the ASPNET user, then a page with some roles is shown.

Roles like public (default), db_owner, db_accessadmin, db_datareader, db_datawriter...

I had applied db_datareader and db_datawriter but now, when I use store procedures in my code, an error is made so I have applied db_owner role for the ASPNET user.

Is this correct or db_owner is a excessive privileged role for the ASPNET user?

Thank you and sorry for my English.DONT EVER GIVE THAT USER DB_OWNER!! You're setting yourself up for sql inject attacks.

The best thing to do is create a role named WebUser and add the asp.net user to that role. Then grant execute permissions to the user.

Here's the script that you need:

exec sp_addrole 'WebUser'
go
exec sp_addrolemember 'WebUser', 'MACHINENAME\ASPNET'
go
grant execute on PROCNAME to WebUser

aspnet user can not access sql server

We have an ASP.net application that currently sits on a server that runs IIS and sql server. We are spliting IIS and SQL server into 2 seperate machines. I believe I have the connection string okay as I can see the entries in the security log on the sql server machine however it keeps saying aspnet user invalid user or invalid password. What gives with this. We put .net on the sql server however this just added the aspnet user to the machine. Do I need to create an aspnet user inside the sql server and give it control of the dbases as well? I am running this using the personal web server not IIS on a server. I have a project on my desktop and am using the "local" IIS or personal web server that comes with visual studio out of the box. What kills me is that when I put the project on a real IIS server that has sql server on the same machine I have no issues. However when I split the dbase and the IIS apart onto 2 servers I get this aspnet invalid user or invalid password.
HELPtry giving database permission to the aspnet user on the other machine (IIS). ex. IISMachine\ASPNET
cheers
Shane Sukul
|Bsc|Mcsd.Net|Mcsd|Mcad|
|||

In SQL Server you can use Windows Authentication or SQL Server Authentication. If in connection string you don't spec. which user and password to use it tries to use Windows Authentication and the user which ASP.NET process runs should have permissions in the SQL Machine.
I normally use SQL Server authentication, put in my web.config (with only permission to the ASP.NET process) the ConnectionString with user and password.
HH
NeuralC

|||

neuralc wrote:

In SQL Server you can use Windows Authentication or SQL Server Authentication. If in connection string you don't spec. which user and password to use it tries to use Windows Authentication and the user which ASP.NET process runs should have permissions in the SQL Machine.
I normally use SQL Server authentication, put in my web.config (with only permission to the ASP.NET process) the ConnectionString with user and password.
HH
NeuralC


Of course you wouldn't actually put that in clear text!
|||

None of this works. The application currently sits on my desktop which is running xp professional. The web server is local to my machine whatever ships with visual studio. The dbase is on a server that has the .net environment running on it. Why can I not see the dbase information when I have the correct connection string.

If I take the same application on my machine and go and hit a server that has IIS adn sql server installed on the same machine it works fine
What gives

|||Also have a look at your firewall settings on the server that hosts your database.

Sunday, February 19, 2012

ASPNET permissions error when trying to open an Oracle connectin from a custom assembly.

Hello:
I'm receiving the following error while trying to open an Oracle connection
from a custom assembly; it seems that ASP.NET has insufficient permissions.
OracleConnection oc = null;
// v-- creating connection object, this
is where the exception throws..
oc = new OracleConnection(Def.ConnectString +
";User Id=" + Def.UserName + ";Password=pwdtxt");
I've assigned "FullTrust" to all the CodeGroup entries on my config files,
and I can execute the code in the custom assembly but I can not open a
database connection.
Is there any security setting related with this?
Thanks,
Daniel Bello.
<ErrorCode
xmlns="http://www.microsoft.com/sql/reportingservices">rsAccessDenied</ErrorCode><HttpStatus
xmlns="http://www.microsoft.com/sql/reportingservices">400</HttpStatus><Message
xmlns="http://www.microsoft.com/sql/reportingservices">The permissions
granted to user 'WCORPTWJTCCPB1\ASPNET' are insufficient for performing this
operation.</Message><HelpLink
xmlns="http://www.microsoft.com/sql/reportingservices">http://go.microsoft.com/fwlink/?LinkId=20476&EvtSrc=Microsoft.ReportingServices.Diagnostics.Utilities.ErrorStrings&EvtID=rsAccessDenied&ProdName=Microsoft%20SQL%20Server%20Reporting%20Services&ProdVer=9.00.1399.00</HelpLink><ProductName
xmlns="http://www.microsoft.com/sql/reportingservices">Microsoft SQL Server
Reporting Services</ProductName><ProductVersion
xmlns="http://www.microsoft.com/sql/reportingservices">9.00.1399.00</ProductVersion><ProductLocaleId
xmlns="http://www.microsoft.com/sql/reportingservices">127</ProductLocaleId><OperatingSystem
xmlns="http://www.microsoft.com/sql/reportingservices">OsIndependent</OperatingSystem><CountryLocaleId
xmlns="http://www.microsoft.com/sql/reportingservices">1033</CountryLocaleId><MoreInformation
xmlns="http://www.microsoft.com/sql/reportingservices"><Source>ReportingServicesLibrary</Source><Message
msrs:ErrorCode="rsAccessDenied"
msrs:HelpLink="http://go.microsoft.com/fwlink/?LinkId=20476&EvtSrc=Microsoft.ReportingServices.Diagnostics.Utilities.ErrorStrings&EvtID=rsAccessDenied&ProdName=Microsoft%20SQL%20Server%20Reporting%20Services&ProdVer=9.00.1399.00"
xmlns:msrs="http://www.microsoft.com/sql/reportingservices">The permissions
granted to user 'WCORPTWJTCCPB1\ASPNET' are insufficient for performing this
operation.</Message></MoreInformation><Warnings
xmlns="http://www.microsoft.com/sql/reportingservices" />I added the ASPNET user to HOME with Browser and Content Manager permissions
and it works now.
Does anyoune has an explanation for this?
Thanks,
Daniel Bello.
"Daniel Bello" <dburizarri@.yahoo.es> wrote in message
news:OzjxxzYRHHA.4000@.TK2MSFTNGP04.phx.gbl...
> Hello:
> I'm receiving the following error while trying to open an Oracle
> connection from a custom assembly; it seems that ASP.NET has insufficient
> permissions.
> OracleConnection oc = null;
> // v-- creating connection object, this
> is where the exception throws..
> oc = new OracleConnection(Def.ConnectString +
> ";User Id=" + Def.UserName + ";Password=pwdtxt");
> I've assigned "FullTrust" to all the CodeGroup entries on my config files,
> and I can execute the code in the custom assembly but I can not open a
> database connection.
> Is there any security setting related with this?
> Thanks,
> Daniel Bello.
> <ErrorCode
> xmlns="rsAccessDenied</ErrorCode><HttpStatus">http://www.microsoft.com/sql/reportingservices">rsAccessDenied</ErrorCode><HttpStatus
> xmlns="400</HttpStatus><Message">http://www.microsoft.com/sql/reportingservices">400</HttpStatus><Message
> xmlns="The">http://www.microsoft.com/sql/reportingservices">The permissions
> granted to user 'WCORPTWJTCCPB1\ASPNET' are insufficient for performing
> this operation.</Message><HelpLink
> xmlns="http://go.microsoft.com/fwlink/?LinkId=20476&EvtSrc=Microsoft.ReportingServices.Diagnostics.Utilities.ErrorStrings&EvtID=rsAccessDenied&ProdName=Microsoft%20SQL%20Server%20Reporting%20Services&ProdVer=9.00.1399.00</HelpLink><ProductName">http://www.microsoft.com/sql/reportingservices">http://go.microsoft.com/fwlink/?LinkId=20476&EvtSrc=Microsoft.ReportingServices.Diagnostics.Utilities.ErrorStrings&EvtID=rsAccessDenied&ProdName=Microsoft%20SQL%20Server%20Reporting%20Services&ProdVer=9.00.1399.00</HelpLink><ProductName
> xmlns="Microsoft">http://www.microsoft.com/sql/reportingservices">Microsoft SQL
> Server Reporting Services</ProductName><ProductVersion
> xmlns="9.00.1399.00</ProductVersion><ProductLocaleId">http://www.microsoft.com/sql/reportingservices">9.00.1399.00</ProductVersion><ProductLocaleId
> xmlns="127</ProductLocaleId><OperatingSystem">http://www.microsoft.com/sql/reportingservices">127</ProductLocaleId><OperatingSystem
> xmlns="OsIndependent</OperatingSystem><CountryLocaleId">http://www.microsoft.com/sql/reportingservices">OsIndependent</OperatingSystem><CountryLocaleId
> xmlns="1033</CountryLocaleId><MoreInformation">http://www.microsoft.com/sql/reportingservices">1033</CountryLocaleId><MoreInformation
> xmlns="<Source>ReportingServicesLibrary</Source><Message">http://www.microsoft.com/sql/reportingservices"><Source>ReportingServicesLibrary</Source><Message
> msrs:ErrorCode="rsAccessDenied"
> msrs:HelpLink="http://go.microsoft.com/fwlink/?LinkId=20476&EvtSrc=Microsoft.ReportingServices.Diagnostics.Utilities.ErrorStrings&EvtID=rsAccessDenied&ProdName=Microsoft%20SQL%20Server%20Reporting%20Services&ProdVer=9.00.1399.00"
> xmlns:msrs="The">http://www.microsoft.com/sql/reportingservices">The
> permissions granted to user 'WCORPTWJTCCPB1\ASPNET' are insufficient for
> performing this operation.</Message></MoreInformation><Warnings
> xmlns="http://www.microsoft.com/sql/reportingservices" />
>

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.

ASPNET & NETWORK SERVICE accounts hitting SQL Server from IIS

Hello All,
Running IIS 6 and ASP.NET, the only way an application can access SQL Server
seems to be as "NT AUTHORITY / NETWORK SERVICE" (or an alias specified in
the <identity> element within "web.config"). This is analagous to the
"ASPNET" user for IIS 5 and ASP.NET.
In a secure (SSL) web running in IIS 6 with authentication, we're interested
in getting from ASP.NET the behavior we get from ASP 3.0. When the ASP
application logs onto the SQL Server database, it does so under the logon of
the actual user. There does not appear to me to be a way to make this
happen. And, as a result, we feel as though we have lost a layer of
security--the security of the database!
Any ideas or suggestions are welcome.
Thanks a lot!
JimInside
<system.web>
I added
<identity impersonate="true" />
It worked like a charm!
Jim
"Jim Moon" <jmoon()at()uab.edu> wrote in message
news:ec4zWdtXEHA.3596@.tk2msftngp13.phx.gbl...
> Hello All,
> Running IIS 6 and ASP.NET, the only way an application can access SQL
Server
> seems to be as "NT AUTHORITY / NETWORK SERVICE" (or an alias specified in
> the <identity> element within "web.config"). This is analagous to the
> "ASPNET" user for IIS 5 and ASP.NET.
> In a secure (SSL) web running in IIS 6 with authentication, we're
interested
> in getting from ASP.NET the behavior we get from ASP 3.0. When the ASP
> application logs onto the SQL Server database, it does so under the logon
of
> the actual user. There does not appear to me to be a way to make this
> happen. And, as a result, we feel as though we have lost a layer of
> security--the security of the database!
> Any ideas or suggestions are welcome.
> Thanks a lot!
> Jim
>