Showing posts with label net. Show all posts
Showing posts with label net. Show all posts

Monday, March 26, 2012

Error: 605, Severity: 21, State: 1

Below message is frequently appearing in error log file. Before posting this
issue I searched net but I am not sure how to overcome this issue as it is
Production System and I am not much aware of SQL Server 2000. I can count on
table 'ComputerVulnerability' but cannot export the data. Your guidance will
be highly appreciated in helping and solving the issue before it become
critical.
(1:182850)/(1:182850)0/612197231
... IAM indicates that page is allocated to this object
Error: 605, Severity: 21, State: 1
Attempt to fetch logical page (1:182850)
in database 'Prod' belongs to object '0', not to object
'ComputerVulnerability'..
Hello,
As a first step execute a DBCC CHECKDB and get mofre information on the
error. To solve this you may need to try executing the DBCC with
REPAIR_REBUILD and if the issue is not solved you may need to take a backup
of database execute DBCC CHECKDB with REPAIR_ALLOW_DATA_LOSS .
If nothing works out you may need to restore from a last good backup. In
parallel you could create a Microsoft case and get the help of microsoft
product support.
Thanks
Hari
"Bini" <Bini@.discussions.microsoft.com> wrote in message
news:9EAD09C3-23F9-4F85-AC26-A9E247D3502E@.microsoft.com...
> Below message is frequently appearing in error log file. Before posting
> this
> issue I searched net but I am not sure how to overcome this issue as it is
> Production System and I am not much aware of SQL Server 2000. I can count
> on
> table 'ComputerVulnerability' but cannot export the data. Your guidance
> will
> be highly appreciated in helping and solving the issue before it become
> critical.
> (1:182850)/(1:182850) 0/612197231
> ... IAM indicates that page is allocated to this object
> Error: 605, Severity: 21, State: 1
> Attempt to fetch logical page (1:182850)
> in database 'Prod' belongs to object '0', not to object
> 'ComputerVulnerability'..

Error: 605, Severity: 21, State: 1

Below message is frequently appearing in error log file. Before posting this
issue I searched net but I am not sure how to overcome this issue as it is
Production System and I am not much aware of SQL Server 2000. I can count on
table 'ComputerVulnerability' but cannot export the data. Your guidance will
be highly appreciated in helping and solving the issue before it become
critical.
(1:182850)/(1:182850) 0/612197231
... IAM indicates that page is allocated to this object
Error: 605, Severity: 21, State: 1
Attempt to fetch logical page (1:182850)
in database 'Prod' belongs to object '0', not to object
'ComputerVulnerability'..Hello,
As a first step execute a DBCC CHECKDB and get mofre information on the
error. To solve this you may need to try executing the DBCC with
REPAIR_REBUILD and if the issue is not solved you may need to take a backup
of database execute DBCC CHECKDB with REPAIR_ALLOW_DATA_LOSS .
If nothing works out you may need to restore from a last good backup. In
parallel you could create a Microsoft case and get the help of microsoft
product support.
Thanks
Hari
"Bini" <Bini@.discussions.microsoft.com> wrote in message
news:9EAD09C3-23F9-4F85-AC26-A9E247D3502E@.microsoft.com...
> Below message is frequently appearing in error log file. Before posting
> this
> issue I searched net but I am not sure how to overcome this issue as it is
> Production System and I am not much aware of SQL Server 2000. I can count
> on
> table 'ComputerVulnerability' but cannot export the data. Your guidance
> will
> be highly appreciated in helping and solving the issue before it become
> critical.
> (1:182850)/(1:182850) 0/612197231
> ... IAM indicates that page is allocated to this object
> Error: 605, Severity: 21, State: 1
> Attempt to fetch logical page (1:182850)
> in database 'Prod' belongs to object '0', not to object
> 'ComputerVulnerability'..

Error: 605, Severity: 21, State: 1

Below message is frequently appearing in error log file. Before posting thi
s
issue I searched net but I am not sure how to overcome this issue as it is
Production System and I am not much aware of SQL Server 2000. I can count on
table 'ComputerVulnerability' but cannot export the data. Your guidance will
be highly appreciated in helping and solving the issue before it become
critical.
(1:182850)/(1:182850) 0/612197231
... IAM indicates that page is allocated to this object
Error: 605, Severity: 21, State: 1
Attempt to fetch logical page (1:182850)
in database 'Prod' belongs to object '0', not to object
'ComputerVulnerability'..Hello,
As a first step execute a DBCC CHECKDB and get mofre information on the
error. To solve this you may need to try executing the DBCC with
REPAIR_REBUILD and if the issue is not solved you may need to take a backup
of database execute DBCC CHECKDB with REPAIR_ALLOW_DATA_LOSS .
If nothing works out you may need to restore from a last good backup. In
parallel you could create a Microsoft case and get the help of microsoft
product support.
Thanks
Hari
"Bini" <Bini@.discussions.microsoft.com> wrote in message
news:9EAD09C3-23F9-4F85-AC26-A9E247D3502E@.microsoft.com...
> Below message is frequently appearing in error log file. Before posting
> this
> issue I searched net but I am not sure how to overcome this issue as it is
> Production System and I am not much aware of SQL Server 2000. I can count
> on
> table 'ComputerVulnerability' but cannot export the data. Your guidance
> will
> be highly appreciated in helping and solving the issue before it become
> critical.
> (1:182850)/(1:182850) 0/612197231
> ... IAM indicates that page is allocated to this object
> Error: 605, Severity: 21, State: 1
> Attempt to fetch logical page (1:182850)
> in database 'Prod' belongs to object '0', not to object
> 'ComputerVulnerability'..

Wednesday, March 21, 2012

Error: 18456, Severity: 14, State: 16.

I'm getting the same error trying to connect for the first time in SQL Server
2005 from a c#.NET console app. Did you figure it out?
"payyans" wrote:
[vbcol=seagreen]
> The application was able to make connections using the same credentials in
> the initial hours of run. So, I am not sure why permission is denied at a
> later point. Thanks for the response.
> -payyans
> "Russell Fields" wrote:
Not yet.
-payyans
"jt" wrote:
[vbcol=seagreen]
> I'm getting the same error trying to connect for the first time in SQL Server
> 2005 from a c#.NET console app. Did you figure it out?
> "payyans" wrote:

Wednesday, March 7, 2012

Error with membersip and roles Cannot resolve the collation conflict between

I'm getting the following errors when trying to execute the following script on the server, its part of the standard asp.net membership and roles, anybody have any ideas how I get get round this?

Msg 468,Level 16, State 9,Procedure aspnet_UsersInRoles_RemoveUsersFromRoles, Line 50Cannot resolve the collation conflictbetween "SQL_Latin1_General_CP1_CI_AS"and "Latin1_General_CI_AS"in the equalto operation.Msg 468,Level 16, State 9,Procedure aspnet_UsersInRoles_RemoveUsersFromRoles, Line 58Cannot resolve the collation conflictbetween "SQL_Latin1_General_CP1_CI_AS"and "Latin1_General_CI_AS"in the equalto operation.Msg 468,Level 16, State 9,Procedure aspnet_UsersInRoles_RemoveUsersFromRoles, Line 84Cannot resolve the collation conflictbetween "SQL_Latin1_General_CP1_CI_AS"and "Latin1_General_CI_AS"in the equalto operation.Msg 468,Level 16, State 9,Procedure aspnet_UsersInRoles_RemoveUsersFromRoles, Line 92Cannot resolve the collation conflictbetween "SQL_Latin1_General_CP1_CI_AS"and "Latin1_General_CI_AS"in the equalto operation.

/****** Object: StoredProcedure [dbo].[aspnet_UsersInRoles_RemoveUsersFromRoles] Script Date: 05/20/2007 11:23:33 ******/SET ANSI_NULLSONGOSET QUOTED_IDENTIFIEROFFGOIFNOT EXISTS (SELECT *FROM sys.objectsWHEREobject_id =OBJECT_ID(N'[dbo].[aspnet_UsersInRoles_RemoveUsersFromRoles]')AND typein (N'P', N'PC'))BEGINEXEC dbo.sp_executesql @.statement = N'CREATE PROCEDURE [dbo].[aspnet_UsersInRoles_RemoveUsersFromRoles]@.ApplicationName nvarchar(256),@.UserNames nvarchar(4000),@.RoleNames nvarchar(4000)ASBEGINDECLARE @.AppId uniqueidentifierSELECT @.AppId = NULLSELECT @.AppId = ApplicationId FROM aspnet_Applications WHERE LOWER(@.ApplicationName) = LoweredApplicationNameIF (@.AppId IS NULL)RETURN(2)DECLARE @.TranStarted bitSET @.TranStarted = 0IF( @.@.TRANCOUNT = 0 )BEGINBEGIN TRANSACTIONSET @.TranStarted = 1ENDDECLARE @.tbNames table(Name nvarchar(256) NOT NULL PRIMARY KEY)DECLARE @.tbRoles table(RoleId uniqueidentifier NOT NULL PRIMARY KEY)DECLARE @.tbUsers table(UserId uniqueidentifier NOT NULL PRIMARY KEY)DECLARE @.Num intDECLARE @.Pos intDECLARE @.NextPos intDECLARE @.Name nvarchar(256)DECLARE @.CountAll intDECLARE @.CountU intDECLARE @.CountR intSET @.Num = 0SET @.Pos = 1WHILE(@.Pos <= LEN(@.RoleNames))BEGINSELECT @.NextPos = CHARINDEX(N'','', @.RoleNames, @.Pos)IF (@.NextPos = 0 OR @.NextPos IS NULL)SELECT @.NextPos = LEN(@.RoleNames) + 1SELECT @.Name = RTRIM(LTRIM(SUBSTRING(@.RoleNames, @.Pos, @.NextPos - @.Pos)))SELECT @.Pos = @.NextPos+1INSERT INTO @.tbNames VALUES (@.Name)SET @.Num = @.Num + 1ENDINSERT INTO @.tbRoles SELECT RoleId FROM dbo.aspnet_Roles ar, @.tbNames t WHERE LOWER(t.Name) = ar.LoweredRoleName AND ar.ApplicationId = @.AppIdSELECT @.CountR = @.@.ROWCOUNTIF (@.CountR <> @.Num)BEGINSELECT TOP 1 N'''', NameFROM @.tbNamesWHERE LOWER(Name) NOT IN (SELECT ar.LoweredRoleName FROM dbo.aspnet_Roles ar, @.tbRoles r WHERE r.RoleId = ar.RoleId)IF( @.TranStarted = 1 )ROLLBACK TRANSACTIONRETURN(2)ENDDELETE FROM @.tbNames WHERE 1=1SET @.Num = 0SET @.Pos = 1WHILE(@.Pos <= LEN(@.UserNames))BEGINSELECT @.NextPos = CHARINDEX(N'','', @.UserNames, @.Pos)IF (@.NextPos = 0 OR @.NextPos IS NULL)SELECT @.NextPos = LEN(@.UserNames) + 1SELECT @.Name = RTRIM(LTRIM(SUBSTRING(@.UserNames, @.Pos, @.NextPos - @.Pos)))SELECT @.Pos = @.NextPos+1INSERT INTO @.tbNames VALUES (@.Name)SET @.Num = @.Num + 1ENDINSERT INTO @.tbUsers SELECT UserId FROM dbo.aspnet_Users ar, @.tbNames t WHERE LOWER(t.Name) = ar.LoweredUserName AND ar.ApplicationId = @.AppIdSELECT @.CountU = @.@.ROWCOUNTIF (@.CountU <> @.Num)BEGINSELECT TOP 1 Name, N''''FROM @.tbNamesWHERE LOWER(Name) NOT IN (SELECT au.LoweredUserName FROM dbo.aspnet_Users au, @.tbUsers u WHERE u.UserId = au.UserId)IF( @.TranStarted = 1 )ROLLBACK TRANSACTIONRETURN(1)ENDSELECT @.CountAll = COUNT(*)FROMdbo.aspnet_UsersInRoles ur, @.tbUsers u, @.tbRoles rWHERE ur.UserId = u.UserId AND ur.RoleId = r.RoleIdIF (@.CountAll <> @.CountU * @.CountR)BEGINSELECT TOP 1 UserName, RoleNameFROM @.tbUsers tu, @.tbRoles tr, dbo.aspnet_Users u, dbo.aspnet_Roles rWHERE u.UserId = tu.UserId AND r.RoleId = tr.RoleId AND tu.UserId NOT IN (SELECT ur.UserId FROM dbo.aspnet_UsersInRoles ur WHERE ur.RoleId = tr.RoleId) AND tr.RoleId NOT IN (SELECT ur.RoleId FROM dbo.aspnet_UsersInRoles ur WHERE ur.UserId = tu.UserId)IF( @.TranStarted = 1 )ROLLBACK TRANSACTIONRETURN(3)ENDDELETE FROM dbo.aspnet_UsersInRolesWHERE UserId IN (SELECT UserId FROM @.tbUsers) AND RoleId IN (SELECT RoleId FROM @.tbRoles)IF( @.TranStarted = 1 )COMMIT TRANSACTIONRETURN(0)END 'ENDGO
Any help appreciated thanks, 

What is your database collation set to?

You can check this in MicrosoftSQL Server Management by right clicking the database and selecting "properties".

Now check what collation you have on your aspnet tables. Right click on aspnet_Roles, and select "Script table as","Create to","New query window". Look for the collation settings on each field.

|||

Thank you for your response on the DB I have - Latin1_General_CI_AS

On the table I have -

****** Object:Table [dbo].[aspnet_Roles] Script Date: 05/22/2007 21:28:48 ******/SET ANSI_NULLSONGOSET QUOTED_IDENTIFIERONGOCREATE TABLE [dbo].[aspnet_Roles]([ApplicationId] [uniqueidentifier]NOT NULL,[RoleId] [uniqueidentifier]NOT NULLCONSTRAINT [DF__aspnet_Ro__RoleI__03F0984C]DEFAULT (newid()),[RoleName] [nvarchar](256) COLLATE SQL_Latin1_General_CP1_CI_ASNOT NULL,[LoweredRoleName] [nvarchar](256) COLLATE SQL_Latin1_General_CP1_CI_ASNOT NULL,[Description] [nvarchar](256) COLLATE SQL_Latin1_General_CP1_CI_ASNULL,CONSTRAINT [PK__aspnet_Roles__02084FDA]PRIMARY KEY NONCLUSTERED ([RoleId]ASC)WITH (PAD_INDEX =OFF, IGNORE_DUP_KEY =OFF)ON [PRIMARY])ON [PRIMARY]GOALTER TABLE [dbo].[aspnet_Roles]WITH CHECK ADD CONSTRAINT [FK__aspnet_Ro__Appli__02FC7413]FOREIGN KEY([ApplicationId])REFERENCES [dbo].[aspnet_Applications] ([ApplicationId])GOALTER TABLE [dbo].[aspnet_Roles]CHECK CONSTRAINT [FK__aspnet_Ro__Appli__02FC7413]

So what do I do to fix it?|||

Any body tell me how i can change the collation?

|||

ALTER DATABASE {DatabaseName} COLLATE {NewCollationName}

In this case ALTER DATABASE ASPNETDB COLLATE SQL_Latin1_General_CP1_CI_AS

|||

That worked, thank you.

Friday, February 24, 2012

Error while using first time!

I'm trying to learn about SQL databases and use them for my asp.net app sine I cant get the hang of MySQL in ASP. Every time I go to create a new SQL Database it saids: Would you like to place it in the App_Data folder basicly and I say yes. Then the error:

Unable to find DbProivderFactory for type System.Data.SqlClient.SqlConnection

Hi Clanstyles,

Based on the error message, I think the provider factory was not installed properly on you machine. Or the configuration files might not be written correctly.

Please try the following:

1. Open machine.config file under C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG
2. Check the nodes under configuration/system.data/DbProviderFactories to see if all the provider has been installed successfully. It has to look like this.

<DbProviderFactories>
<add name="Odbc Data Provider" invariant="System.Data.Odbc" description=".Net Framework Data Provider for Odbc" type="System.Data.Odbc.OdbcFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add name="OleDb Data Provider" invariant="System.Data.OleDb" description=".Net Framework Data Provider for OleDb" type="System.Data.OleDb.OleDbFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add name="OracleClient Data Provider" invariant="System.Data.OracleClient" description=".Net Framework Data Provider for Oracle" type="System.Data.OracleClient.OracleClientFactory, System.Data.OracleClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add name="SqlClient Data Provider" invariant="System.Data.SqlClient" description=".Net Framework Data Provider for SqlServer" type="System.Data.SqlClient.SqlClientFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</DbProviderFactories>

HTH.

Error while trying to use ReportServices 2005 WebService

I'm messing around with the SSRS 2005 WebService from a vb.net application. When calling the .ListChildren method I get the following error:

Client found response content type of '', but expected 'text/xml'. The request failed with an empty response.

Here is the code I'm using (I called the webreference ssrs)

dim rs as new ssrs.ReportingService2005()

rs.url = "http://127.0.0.1/reportserver"

rs.credentials = System.New.CredentialCache.DefaultCredentials

dim items() as ssrs.CatalogItem

items = rs.ListChildren ("/", True)

The error is coming from the Visual Studio generated proxy. The issue is that when you override the .Url property you must specify the entire URL of the Reporting Services endpoint.

Change your URL string to http://127.0.0.1/reportserver/reportservice2005.asmx and everything should work then.

All of the various designers that we ship automatically append the appropriate web service endpoint. Unfortunately we do not control the code that is generated by the proxy that VS creates. You must ensure that the URL points to the endpoint yourself if you choose to overwrite the default URL that is assigned when the proxy is generated.

|||

Check your credentials...you got a typo

rs.Credentials = System.Net.CredentialCache.DefaultCredentials;

Error while trying to use ReportServices 2005 WebService

I'm messing around with the SSRS 2005 WebService from a vb.net application. When calling the .ListChildren method I get the following error:

Client found response content type of '', but expected 'text/xml'. The request failed with an empty response.

Here is the code I'm using (I called the webreference ssrs)

dim rs as new ssrs.ReportingService2005()

rs.url = "http://127.0.0.1/reportserver"

rs.credentials = System.New.CredentialCache.DefaultCredentials

dim items() as ssrs.CatalogItem

items = rs.ListChildren ("/", True)

The error is coming from the Visual Studio generated proxy. The issue is that when you override the .Url property you must specify the entire URL of the Reporting Services endpoint.

Change your URL string to http://127.0.0.1/reportserver/reportservice2005.asmx and everything should work then.

All of the various designers that we ship automatically append the appropriate web service endpoint. Unfortunately we do not control the code that is generated by the proxy that VS creates. You must ensure that the URL points to the endpoint yourself if you choose to overwrite the default URL that is assigned when the proxy is generated.

|||

Check your credentials...you got a typo

rs.Credentials = System.Net.CredentialCache.DefaultCredentials;

Sunday, February 19, 2012

Error while running service

Hi,
I have created .net windows service for running an exe. Exe is running
fine. It is used for inserting xml data in sql server database.
My service mode is automatic. Whenevr i start my computer it is
throwing me an error below :-
"An unhandled exception of type 'system.data.sqlclient.sqlexception'
occured in system.data.dll.
Additinal information : A connection was successfully established with
the server.but then an error occured during prelogin handshake.
(provider - SSL provider , error : 0 - the messege or signature
provided for verification has been altered"
When i start service in manual mode it runs perfectly fine. Can
someone please help me in this regard?
Arati
On Jul 31, 8:33 am, JPD <nos...@.nospamplease.com> wrote:
> Hi Arati,
> I've seen a similar problem just last week. In that case we deleted all
> certificates on the server and everything worked perfectly.
> Jonathan
>
> Arati wrote:
>
>
>
> - Show quoted text -
Hi,
Are you talking about server certificates for IIS or sql server?
Regards,
Arati
|||On Aug 2, 6:30 am, Jonathan Psaila-Depasquale
<nos...@.nospamplease.com> wrote:
> Hi Arati,
> You have delete all existing certificates on the server no matter what
> purpose they are serving. In the case I encountered last week the
> problem certificate was for SharePoint.
> Jonathan
>
> Arati wrote:
>
>
>
> - Show quoted text -
Hi,
There are no certificates for IIS server. And I don't know where I can
find certificate for sql server. Do you have any idea on this?
Regards,
Arati

Error while running service

Hi,
I have created .net windows service for running an exe. Exe is running
fine. It is used for inserting xml data in sql server database.
My service mode is automatic. Whenevr i start my computer it is
throwing me an error below :-
"An unhandled exception of type 'system.data.sqlclient.sqlexception'
occured in system.data.dll.
Additinal information : A connection was successfully established with
the server.but then an error occured during prelogin handshake.
(provider - SSL provider , error : 0 - the messege or signature
provided for verification has been altered"
When i start service in manual mode it runs perfectly fine. Can
someone please help me in this regard?
AratiHi Arati,
I've seen a similar problem just last week. In that case we deleted all
certificates on the server and everything worked perfectly.
Jonathan
Arati wrote:
> Hi,
> I have created .net windows service for running an exe. Exe is running
> fine. It is used for inserting xml data in sql server database.
> My service mode is automatic. Whenevr i start my computer it is
> throwing me an error below :-
> "An unhandled exception of type 'system.data.sqlclient.sqlexception'
> occured in system.data.dll.
> Additinal information : A connection was successfully established with
> the server.but then an error occured during prelogin handshake.
> (provider - SSL provider , error : 0 - the messege or signature
> provided for verification has been altered"
> When i start service in manual mode it runs perfectly fine. Can
> someone please help me in this regard?
> Arati
>|||On Jul 31, 8:33 am, JPD <nos...@.nospamplease.com> wrote:
> Hi Arati,
> I've seen a similar problem just last week. In that case we deleted all
> certificates on the server and everything worked perfectly.
> Jonathan
>
> Arati wrote:
>
>
>
>
>
>
> - Show quoted text -
Hi,
Are you talking about server certificates for IIS or sql server?
Regards,
Arati|||Hi Arati,
You have delete all existing certificates on the server no matter what
purpose they are serving. In the case I encountered last week the
problem certificate was for SharePoint.
Jonathan
Arati wrote:
> On Jul 31, 8:33 am, JPD <nos...@.nospamplease.com> wrote:
> Hi,
> Are you talking about server certificates for IIS or sql server?
> Regards,
> Arati
>|||On Aug 2, 6:30 am, Jonathan Psaila-Depasquale
<nos...@.nospamplease.com> wrote:
> Hi Arati,
> You have delete all existing certificates on the server no matter what
> purpose they are serving. In the case I encountered last week the
> problem certificate was for SharePoint.
> Jonathan
>
> Arati wrote:
>
>
>
>
>
>
> - Show quoted text -
Hi,
There are no certificates for IIS server. And I don't know where I can
find certificate for sql server. Do you have any idea on this?
Regards,
Arati|||Hi,
Open an MMC console. Go to File | Add/Remove Snap-in. Click on Add and
select Certificates. Choose Computer Account and then Local Computer.
Click Finish, Close, OK.
In the tree on the left expand Certificates (Local Computer), then click
on Personal. You need to delete all certificates that appear in the
details pane.
Jonathan
Arati wrote:
> On Aug 2, 6:30 am, Jonathan Psaila-Depasquale
> <nos...@.nospamplease.com> wrote:
> Hi,
> There are no certificates for IIS server. And I don't know where I can
> find certificate for sql server. Do you have any idea on this?
> Regards,
> Arati
>

Error while running script on host server

I am trying to deploy my database-driven ASP.NET application to my web server. I have hosting through godaddy.com and they require that you run a script through their SQL admin Query Analyzer to create the database. After I attach the database in the Management Studio, I generate the script, copy and paste it into the QA and get the following error. Any help?

Error -2147217900

Line 18: Incorrect syntax near '('.

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Students]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Students](
[StudentID] [int] IDENTITY(1,1) NOT NULL,
[FirstName] [nvarchar](20) NULL,
[LastName] [nvarchar](20) NULL,
[PhoneNumber1] [nvarchar](15) NULL,
[PhoneNumber2] [nvarchar](15) NULL,
[Instrument] [nchar](20) NULL,
[Interests] [nvarchar](50) NULL,
[Active] [bit] NULL,
[TimeID] [int] NULL,
[UserID] [nchar](20) NULL,
CONSTRAINT [PK_Students] PRIMARY KEY CLUSTERED
(
[StudentID] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Lessons]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Lessons](
[LessonID] [int] IDENTITY(1,1) NOT FOR REPLICATION NOT NULL,
[CurrentNotes] [nvarchar](250) NULL,
[FutureNotes] [nvarchar](250) NULL,
[DateTime] [datetime] NULL,
[StudentID] [int] NOT NULL,
CONSTRAINT [PK_Lessons] PRIMARY KEY CLUSTERED
(
[LessonID] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
IFNOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id =OBJECT_ID(N'[dbo].[FK_Lessons_Students]') AND parent_object_id =OBJECT_ID(N'[dbo].[Lessons]'))
ALTER TABLE [dbo].[Lessons] WITH CHECK ADD CONSTRAINT [FK_Lessons_Students] FOREIGN KEY([StudentID])
REFERENCES [dbo].[Students] ([StudentID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[Lessons] CHECK CONSTRAINT [FK_Lessons_Students]

That's because you the script is generated for a SQL2005 table in Management Studio, so it contains some new elements in SQL2005 which do not exist in SQL2000. Then when you tried to execute it in Query Analyzer (which uses SQL2000 T-SQL rules), QA failed to parse some new T-SQL syntax (I see it is the WITH block following the CONSTRAINT definition here).

For more information about T-SQL enhancement in SQL2005, you can refer to:

http://msdn.microsoft.com/library/en-us/dnsql90/html/sql_05TSQLEnhance.asp?

BTW, system schemas also have been changed in SQL2005, so if you try to refer to 'sys.objects' as in the script in SQL2000, an 'object not exist' error will be raised. For information, please refer to:

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

Error while runnign web appication using Visual studio 2005

Hello,

I have made one application in asp.net using C#. It is running perfect in my visual studio 2005 and also on localhost.

Currently i have installed visual studio 2005 in new PC. Now that application is running fine under Localhost. But it is giving me error when i run

it through visual studio in New PC and the error is

" 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. "

One more point is that i have used DSN and so i checked the DSN also and it is also correct.

Second thing is I have two directoryadmin anduser.If I run the pages of admin directory then it is running fine. But if i run the page of user directory then it is showing

me the above eror. I have also made different config files for both directory and one general config file for whole directory.

I have also search on google for this problem and they asked me to delete SQLEXPRESS directory from C drive but it is not get deleted and it shows the error that

"it is being used by some other program please try again."

So you might have understood my problem. Please help me to get out of this problem. Thanks a lot for reading my problem.

Regards,

Hardik B.

Well if you're looking to delete that directory, you will probably have to shut down your Mircosoft SQL Server service (control panel -> admin tools -> Services). I'm not sure if that will fix your problem though.. Also, make sure to restart your service after you finish your delete.

Wednesday, February 15, 2012

Error while establishing a connection to the SQL server 2005 - Could not open a connection

Hi,

I had an old web application created during asp.net 1.1 and it have a connection problem with the sql server 2005 when it is mirgrated to a new webserver with dotnet framework 2.0 platform. I have enabled the remote access(TCP/IP and named pipes) in sql server 2005, did all the neccessary things, check whether the TCP/IP is enabled, named pipe is enabled...

I created another web application using VS 2005. The database connection works perfectly well.

This are the connectionString from the old web application.

<appSettings>
<addkey="ConnectionString"value="Server=127.0.0.1;Database=somedb;User id=user; Password=somepassword; Trusted_Connection=False; POOLING=FALSE"/>
</appSettings>

Thankyou in advance!

I am not sure but maybe try this?

<appSettings>
<addk="ConnectionString"value="Server=127.0.0.1;Database=somedb;User id=user; Password=somepassword;"/>
</appSettings>

or

<appSettings>
<addk="ConnectionString"value="workstation id="computername";packet size=4096;data source=yourserver;initial catalog=yourdatabase ;user id=user;password=password"/>
</appSettings>


|||

Thank jpazgier for your help. I have tried and tested it out. However the problem still exist.. =(

|||Could you provide code where you use your connection string? How you read it from config file and how you use it to get data?|||

Hi,

This error message is just a basic connectivity error meaning the client could not connect to the target SQL Server. So just follow the basic connectivity troubleshooting guidelines on our SQL Protocols blog, see:

SQL Server 2005 Connectivity Issue Troubleshoot - Part I
http://blogs.msdn.com/sql_protocols/archive/2005/10/22/483684.aspx

and

SQL Server 2005 Connectivity Issue Troubleshoot - Part II
http://blogs.msdn.com/sql_protocols/archive/2005/10/29/486861.aspx
This should help you debug the problem.

error while connecting

Hey all,

I am new to ASP.NET. While executing a simple code , i got the error:System.Data.SqlClient.SqlException: SQL Server does not exist or access denied.

Whats wrong?

Regards

Yasir

Maybe the problem is in your connection string or you don't open database connection when executing data manipulating.Please check this again.If you still have a problem.please paste your code here.

Error while connect to SQL Server using ADO control

The following error happens in my ASP.NET page from time to time. It will disappear after I restart the SQL Server. I guess I messed up in the garbage collection, but I really don't know what to do except using "conn=nothing" statement, can anyone help me with this?

Thanks!

[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.

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:System.Runtime.InteropServices.COMException: [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.

Source Error:

Line 39: Public Sub New()Line 40: conn = New ADODB.ConnectionLine 41: conn.Open("Provider=SQLOLEDB.1;Persist Security Info=xxxxx;User ID=xxxxx;Initial Catalog=xxxx;Data Source=xxx")Line 42: rs = New ADODB.RecordsetLine 43: my_UserID = 0

try encasing your db interaction in a using{} block - that way it will make sure that the dispose() method has been called and the objects marked for garbage collection.|||

DWesthead:

try encasing your db interaction in a using{} block - that way it will make sure that the dispose() method has been called and the objects marked for garbage collection.

I am not using C#, I am using VB, do you know the garbage collection using VB?

Thanks!

|||

In VB you can use something like this:

Using connectionAsNew SqlConnection()

connection.ConnectionString = connectionString

connection.Open()

Console.WriteLine("State: {0}", connection.State)
Console.WriteLine("ConnectionString: {0}", _
connection.ConnectionString)
End Using

|||

I tried to do that, but the "Using" tag is not recognized, maybe there is no such a thing as "USING" in VB?

|||

Using works for me:

Using connAsNew SqlConnectionEndUsing

Using turns blue, and when I finish the first line, it inserts the End using statement for me.

Curious, why are you using adodb instead of sqlconnect/sqlcommand?

|||

I am using adodb because I am used to it. I programed several ASP program using adodb.

I think I might not have to most recent asp.net sdk install then, I will try to install it now.

Could you tell me any different from sqlconnection and the adodb connection? how to use sqlconnection?

Thanks!

Alex

|||

They are very similiar. The easiest way to make a correct sqlconnection string is to drop a sqldatasource control on your page, then use the wizardBig Smile

I often do that even for connection strings that I use programmatically, I just tell the wizard to put it in web.config, and after the wizard is done, I'll delete the sqldatasource from the page, and access the connectionstring programmatically.