Urgent Help Needed !!! Cannot Generate SSPI Context Error
Dec 12, 2006
Dear Sir,
I tried installing sql server using mixed mode authentication but i am constantly receiving a error as follows and its getting shutting down
A connection could not be established to AICRR
Reason :Cannot generate SSPI context
Please verify sql server is running and check your sql server registeration properties(by right clicking on the AICRR node) and try again.
Please give me the resolution as soon as possible.
Regards
Arif
View 1 Replies
ADVERTISEMENT
Sep 14, 2007
We are runnig Windows server 2003 R2 and SQL Server 2005 Standard on the same computer.
We have workstations that log into our domain with Windows Authentication. The software loads just fine and then later up pops the error noted above.
Any help you can give me is greatly appreciated.
Thanks
Paul
View 1 Replies
View Related
Nov 11, 2007
hi,
While trying to connect to SQLSever 2000 or SQLSever 2005 from a vb.net application ,
a user is getting the error "Cannot generate SSPI context" while other users
can still connect to the server.
and moreover, this user were able to connect before.
and if he restarts his computer, then try to connect after a lap of time, it will connect.
but if he waits and opens other applications,and then tries to open the application,it will not work.
so how to resolve this problem?
Regards,
View 3 Replies
View Related
May 22, 2013
I regularly (every month or so) get the error "The target principle name is incorrect. Cannot generate SSPI context" when trying to remotely connect to my SQL 2012 instance. The SQL service is running using a managed service account. I understand this error can occur when the service account cannot authenticate with AD properly. Looking at the properties of the managed service account, the password for the account was automatically changed this morning - just when the error started.
View 9 Replies
View Related
Apr 20, 2007
Hi,
I am working on sql server 2005 .
when I am trying to connect to server:
following error is occuring:
TITLE: Connect to Server
------------------------------
Cannot connect to servername
------------------------------
ADDITIONAL INFORMATION:
Cannot generate SSPI context. (Microsoft SQL Server, Error: 0)
Could any one help What might be the problem ? for this ?
Thanks,
Ramki
View 1 Replies
View Related
Jan 3, 2008
Hi-I have a program that I am developing on a laptop, then deploying it on a server.I have the prgram running passing a username and PW in the connection object, but like the idea of using windows authentication MUCH better.I just joined the domain, so I am domain/me for example.If I log into the server, and look at securities, logins and added domain/me to the logins.I then try and set up a sql connection via both visual studio, and sql server magt studio, and get the dreaded "Cannot generate SSPI context" error. Anyone else have this problem? SHOULD V.S. be using domain/me to connect? TIA dan
View 6 Replies
View Related
Sep 21, 2004
I was trying out the Building an End-to-End Application (VB.Net) exercises on Web Matrix Guided Tour and encountered the mentioned errors. Please help. Thanks.
The code is as follows :
<%@ Page Language="VB" Debug="true"%>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.SqlClient" %>
<script runat="server">
Sub Page_Load(Sender As Object, E As EventArgs)
Welcome.Text = "Hello, " + User.Identity.Name
If Not Page.IsPostBack Then
' Databind the master grid on the first request only
' (viewstate will restore these values on subsequent postbacks).
MasterGrid.SelectedIndex = 0
BindMasterGrid()
BindDetailGrid()
End If
End Sub
Sub MasterGrid_Select(Sender As Object, E As EventArgs)
BindDetailGrid()
End Sub
Sub MasterGrid_Page(Sender As Object, E As DataGridPageChangedEventArgs)
If MasterGrid.SelectedIndex <> -1 Then
' unset the selection, details view
MasterGrid.SelectedIndex = -1
BindDetailGrid()
End If
MasterGrid.CurrentPageIndex = e.NewPageIndex
BindMasterGrid()
End Sub
Sub BindMasterGrid()
' TODO: Update the ConnectionString and CommandText values for your application
Dim ConnectionString As String = "server='WRPBI'; user id='sa'; password='sa';database=MatrixOrders;Integrated Security=SSPI"
Dim CommandText As String = "select OrderID, OrderDate, CustomerName from Orders"
Dim myConnection As New SqlConnection(ConnectionString)
Dim myCommand As New SqlDataAdapter(CommandText, myConnection)
Dim ds As New DataSet()
myCommand.Fill(ds)
MasterGrid.DataSource = ds
MasterGrid.DataBind()
End Sub
Sub BindDetailGrid()
' get the filter value from the master Grid's DataKeys collection
If MasterGrid.SelectedIndex <> -1 Then
' TODO: update the ConnectionString value for your application
Dim ConnectionString As String = "server='WRPBI'; user id='sa'; password='sa';database=MatrixOrders;Integrated Security=SSPI"
' TODO: update the CommandText value for your application
Dim filterValue As String = CStr(MasterGrid.DataKeys(MasterGrid.SelectedIndex)).Replace("'", "''")
Dim CommandText As String = "select OrderDetailID, ProductName, Quantity, UnitPrice from OrderDetails where OrderID = '" & filterValue & "'"
Dim myConnection As New SqlConnection(ConnectionString)
Dim myCommand As New SqlCommand(CommandText, myConnection)
myConnection.Open()
DetailsGrid.DataSource = myCommand.ExecuteReader(CommandBehavior.CloseConnection)
End If
DetailsGrid.DataBind()
End Sub
</script>
And this is the compilation error :
Cannot generate SSPI context.
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.Data.SqlClient.SqlException: Cannot generate SSPI context.
Source Error:
Line 49:
Line 50: Dim ds As New DataSet()
Line 51: myCommand.Fill(ds)
Line 52:
Line 53: MasterGrid.DataSource = ds
Source File: C:WorksWebWISHDefault.aspx Line: 51
Stack Trace:
[SqlException: Cannot generate SSPI context.]
System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction) +472
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction) +311
System.Data.SqlClient.SqlConnection.Open() +383
System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState) +44
System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +304
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +77
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) +38
ASP.Default_aspx.BindMasterGrid() in C:WorksWebWISHDefault.aspx:51
ASP.Default_aspx.Page_Load(Object Sender, EventArgs E) in C:WorksWebWISHDefault.aspx:14
System.Web.UI.Control.OnLoad(EventArgs e) +55
System.Web.UI.Control.LoadRecursive() +27
System.Web.UI.Page.ProcessRequestMain() +731
View 1 Replies
View Related
Feb 5, 2007
All of a sudden I cannot connect to sql server from Visual Studio. Nor I can't conenct to Sql server through IIS and it gives me the same error saying "Login failed: Cannot Generate SSPI Context". Lots of my development projects got stuck because of the SSPI Issue. I know there was a network upgrade from Windows NT (users) to Active directory. I can only access the sql server from the host machine.if someone can guide or give me a quick run down on things to look for that would be wonderful.
View 2 Replies
View Related
Jul 23, 2005
HiMy company uses a Windows 2000 server with MS SQL Server 2000.We have many clients with administrative software that use the MS SQLserver, the problem is that we experimented randomly the error"Cannot Generate SSPI Context" and the only way to work with DB is logout the client.I'm looking the MS Technical sheet but there's no resolving hints thatcan help.Anyone has a similar problem ?Thanks.
View 1 Replies
View Related
Feb 6, 2007
Win Server 2003
SQL Server 2000 SP4
SharePoint Server
Win Server 2000 (Domain Controller / Active Drectory)
Clients: Win XP / Access XP
I have two clients that can access the SQL Server and one that can not. All clients can access SharePoint (SLQ Server Back end) and directories controlled by AD.
The one that cannot access the SQL Server errors: "Cannot Generate SSPI Context". I have verified:
1) date and time
2) occurances of Security.DLL (win/system32; program file/common files/AOL...; Service Pack Files/i386 (x2))
3) Not using cached credentials
we recently moved our network and did not change any settings on any of the computers. I read KB811889; those suggestions did not resolve the issue.
Please assist me in touble shooting this connection problem. Also, how does changing the SQL Server Port on the server affect SharePoints connection to its database?
View 1 Replies
View Related
Jul 27, 2006
I have a SQL Server 2000 in a specific W2K server, that belongs to a domain that is administered by a W2003 server.
There is a client that has a new computer with WXP in the same domain. It used to have an old machine with W2K pro. and with the same user it worked OK.
When accesing SQL from the client with an Office2003 application via ODBC with windows authentication, after several minutes working OK, suddenly it gets this message:
Conection error. SQL state: S1000
Cannot generate SSPI context.
In the client I have executed cliconfg.exe and created a piped name protocol, but still it won't work.
View 6 Replies
View Related
Jul 3, 2007
Howdy,
Firstly, I have read through so much information on this, that my eyes are starting to bleed and I am right at the end of my rope with it all..
This issue has only started showing since I re-installed my dev box, so my server has not changed at all..
Server is 2003 with SQL 2005.
Dev box is
Vista (Ultimate)
Visual Studio Pro 2005..
A quick but painful solution is for me to log out of my box and then back in, but this is unworkable at times... about the only difference I can think of this install from the last is that now I have also installed SQLExpress on the dev box. I have gone into services and made sure that the service does not start auto. I have connection to the server and am running as administrator on both until such time as I can sort this out, but the error still occurs.
Authentication for the dbase is both windows and credential.
Can someone please give me a stratight out solution for this.
Cheers
View 5 Replies
View Related
Mar 12, 2008
I'm signing into a sqlexpress 2005 local server using windows integration and it fails with a "Cannot generate SSPI context". After 2 years of working with this, it just started to happen after I installed a new piece of software to test. My colleague thinks it hosed our domain names. I've read all the articles and most of them have to do with a non-local server. I also read that this is caused with TCP/IP so I disabled it for sqlexpress and tried again. Then I get "An error has occurred while establishing a connection to the server. When connecting to the sql server 2005, this failure may be caused by the fact that under the default settings sql server does not allow remote connections." I know I have remote enabled so that isn't true. If it uses VIA, "Login failed for user '(null)'. Not a trusted sql connection" or something like that. Anyway, I think something is hosed in my domain and my colleague fixed it by downloading some xp tool that he can't remember where it came from. Any chance anyone else knows about this tool?
View 2 Replies
View Related
Jan 27, 2015
Our end users is getting below error, when they try to connect to our database:
"Cannot generate SSPI Context."
That is Windows based application and we have done everything like restart our DB Server , reinstall exe in users system, but still issue is same.The issue has occured from when DB Server has restarted and at the same time few users are connected. before that it was working fine. we could not find what is issue.
View 1 Replies
View Related
Jun 2, 2006
Hi,
I have a MSSQL database running in a Microsoft cluster. I was working on troubleshooting for another SAP problem when they suggested I change the setting using hte SQL Server Client Network Utility to 'named pipes' from 'tcp/ip'. Every since, despite changing it back I'm unable to start the database in the cluster.
I'm kind of a newbie at this so I'd really appreciate any help in getting this database up and running.
Here is the error message from the event log:
sqsrvres] checkODBCConnectError: sqlstate = HY000; native error = 0; message = [Microsoft][ODBC SQL Server Driver]Cannot generate SSPI context
View 2 Replies
View Related
Dec 7, 2005
Please can anybody help me in fixing this error I am getting on ASP page while accessing ASP database page using an SQL server database.
View 4 Replies
View Related
Oct 26, 2015
I have 2 servers. On one server i install sql server 2014 and its working fine, i am able to get connected with sql with domain account.
From second machine i want to connect my sql server, for that i create udl file when i give sql server address and click refresh getting following error: Connection failed cannot generate SSPI context
Firewall is off, created fire rule too, i am able to get ping first machine by ip and servername but still getting issue.
View 3 Replies
View Related
Aug 1, 2007
Hi,
I have gone through so many kb articles to understanding the problem, but no luck as yet.
Here is the situation:
I have two dev servers : Server A and Server B. Both are set up in an identical fashion. Windows 2003 sp2, Sql Server 2005 sp1 Developer Edition, both are on the same domain, Both have all the three protocols enabled: Shared Memory, Tcpip, and Named Pipes in that order. I can ping both servers, and telnet using the default port. Both have only default instances. Both use the same domain user account for sql service. Both have the error in the log saying that spn could not be registered so authentication may fall back to NTLM.
Here is the issue: When I try to register Server A specifying tcp-ip connection, I am successful and I can see that the authentication is NTLM - is as expected. since the spn registration did not happen and since the sqlservice account is not a domain admin, the authentication used NTLM over tcp-ip. However, I try to register Server B specifying tcpip, I get a cannot generate sspi context error. Why did the authentication not fall back to NTLM as in Server A? From what I read in the KB articles, I asked our network admin to check up the spn, but he assures me that spn were never manually registered.
Can somebody throw more light on this issue?
Thanks
KRSE
View 1 Replies
View Related
May 24, 2007
Hi,
I am using .net 2 to connect to sql server 2005 - All works fine. When I move the sql server machine date forward (to test the application) the above message is returned.
Any ideas as to why this message is generated when I move the clock forward will be gratefully received.
Thanks
Pete Clements
View 1 Replies
View Related
May 29, 2007
We are looking at developing an SQL Server 2005 Database and I would like to use Windows Authentication rather than SQL Server Authentication to connect our client app.
In our development environment, we have two Servers, one being used as a file server and the other as an SQL Server. We have now set up a domain using the file server as the domain controller. (We had previously been set up to use a workgroup).
I have set up an active directory group called SqlDevelopers and added an active directory user called Jonathan to it.
On the SQL Sever, in management studio, I have set up a new server login which uses windows authentication called DomainSqlDevelopers. I used the GUI to verify I could see the domain and the group.
The default database is set to a test database on the server. A user in the test database is mapped to the DomainSqlDevelopers and given the Roles dbo, db_datareader, db_datawriter.
To test the log in, on the server, I logged out as administrator and in as Jonathan. I could successfully access the server through management studio using windows authentication.
However, if I log in as Jonathan on my client PC and try to access the SQL Server using management studio and windows authentication, I have problems.
The first time I try I will get a timeout error. If I try again will get either:
Login failed for user ''. The user is not associated with a trusted SQL Server connection
Or
Cannot generate SSPI context
I can€™t determine any pattern to which of the above errors I get.
However, if I log in as administrator on my client PC, I can connect to the server using management studio and windows authentication.
Sounds like Active Directory/Domain or other Network issue (Not really my area). I would be grateful for any help.
Thanks,
Jon
View 9 Replies
View Related
Oct 3, 2007
Hai,
I'm having Windows XP SP2 version and I have installed SQL server 2005. Whenever I'm opening SQL server management studio in Windows Authentication Mode I get a pop message indicating that "SSPI context error message". What may be the problem and how to sort it out?
Narayanamoorthy
View 1 Replies
View Related
Oct 5, 2007
Hai,
I usually connect SQL Server 2005 using Windows authentication mode (trusted connection). I have one server to which four client machines are connected and all the clients are windows XP SP2. The SQL Server 2005 I have installed is Standard Edition. When I'm connecting I get a pop message indicating that "SSPI context error message". I have seen the Troubleshooting Article ID : 811889. I was'nt able to resolve it. What may be the problem and how to sort it out ?
Narayanamoorthy
View 3 Replies
View Related
Jul 25, 2007
Hai,
I usually connect SQL Server 2005 using Windows authentication mode (trusted connection). I have one server to which four client machines are connected and all the clients are windows XP SP2. The SQL Server 2005 I have installed is Standard Edition. When I'm connecting I get a pop message indicating that "SSPI context error message". I have seen the Troubleshooting Article ID : 811889. I was'nt able to resolve it. What may be the problem and how to sort it out ?
View 3 Replies
View Related
Dec 28, 2006
Hello together,
since over a week I've been looking to
find out the reason for two error messages I get from our users and
servers, unfortunately without success up to now.
I really hope you can help me.
We are using Win 2k servers with active directory and SQL Server 2000,
clients are all Win XP with SP2. Versions of access are 2002 &
2003. The errors are userspecific and occur in both versions. The
SQL-Servers are accessed with an adp-file in 2002-format.
We have one usergroup which is member of specially many groups. This
affects the size of their windows access token which becomes constantly
larger. In order to enable those users to still access their mailboxes
on our Exchange servers, the DWORD entry "MaxTokenSize" with the
decimal value "65535" was made to the newly created key "Parameters" of
their registry branch
"HKLMSYSTEMCurrentControlSetControlLsaKerberos ".
Since then those users can not access any of our SQL Servers using the
windows authentification. One of them gets the error
"[DBNETLIB][ConnectionRead(recv().] General network error. Check your
network documentation.", the others the error "Check connection:
Failed: Cannot generate SSPI context".
In case of resetting the registry entries (by deleting them), the one
user receives the same error message as the rest while it doesn't make
any difference to those (but at least they can't connect to their
mailboxes).
After having researched the web, I realised in one of the SQL-Servers
logfiles the entry "Invalid buffer received from client.." which lead
me to start to believe it could have to do something with the kerberos
encryption in the first place. Therefore I asked if changes to the
tokensize had been made. I applied the change with "EXEC sp_configure
'network packet size', 65535 RECONFIGURE" on our testsystem and "EXEC
sp_configure" confirms that the value is run.
Consequence: The entry in the SQL Server log doesn't appear any longer, but the users still receive their error messages.
Do you have any hints?
Your comments will be highly appreciated!
Regards,
caracol
View 10 Replies
View Related
Jul 26, 2005
Hello,
I have an XP box with SQL 2k working without any problems. I am trying to install SQL 2005 CTP April on the same machine. Installation goes fine, but when I try to connect, I am getting an error "Can not Create SSPI Context". Why am getting this error ? DOes the machine needs to be on a domain to get connected? If yes, is there a work around? Can I use mixed mode? WhereHow do I specify password for sa?
View 4 Replies
View Related
Dec 3, 2005
It makes no difference if I'm working with Enterprise Manager, QueryAnalyzer, Access, self written app with OleDb or Visual studio 2003builtin DB manager.Everything is fine but aufter some time - about 30 minutes I getmessage "cannot create SSPI context"After rebooting my machine I can work for another few minutes.Configuration:NB01 is my notebook with Windows XP ProSQL01 is another Windows XP Pro machine with SQL Server 2000 desktopDC01 is the domain controllerall machins within the same domain DOMAIN01The user is a domain admin and has every rightI'v seen some postings for this problem but not one useful idea how toresolve.As it runs perfectly for some time I don't thint it is a DNS problem orsomething like this.As there is no useful error message it must be some kind of bug.Has anybody resolved such a problem?
View 3 Replies
View Related
Jan 7, 2004
I am getting error once in a while. It can be while either updating/inserting/selecting a record. I may have about 100000 hits give or take a few to the database.
The VB Application identified by the event source logged this Application MODE: Thread ID: 3300 ,Logged: ------------------------------------------------------------------------------------ Error Number :-2147467259 Error Description :Invalid connection string attribute Error Source :Microsoft OLE DB Provider for SQL Server ------------------------------------------------------------------------------------ System Error Number: 0 System Error Description: System Error Source: ------------------------------------------------------------------------------------ Context/Detail Error Description : :: updateOpsRecord :: ADO Error :: Error #-2147467259 Cannot generate SSPI context (Source: Microsoft OLE DB Provider for SQL Server) (SQL State: HY000) (NativeError: 0) No Help file available
This is intresting to see. I tried looking up in all the forums and help file but no ansewers. Help would be appreciated.
Thanks,
Karan
View 1 Replies
View Related
Sep 14, 2004
We run a site through asp.net (programmed in visual studio.net) and the site's beginning to get a lot of problems (as the site grows)
Here is the latest error message. I was wondering if someone could help me troubleshoot this.
Server Error in '/' Application.
--------------------------------------------------------------------------------
Transaction (Process ID 145) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
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.Data.SqlClient.SqlException: Transaction (Process ID 145) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
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:
[SqlException: Transaction (Process ID 145) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.]
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream) +723
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior) +44
System.Data.SqlClient.SqlCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) +5
System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +304
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +77
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +36
Saltwaterfishing.Components.DB.RankResults.SearchAllSites(String query, Int32 currentPage, Int32 pageSize) in
***************ComponentsDBRankResults.cs:43
***************.Controls.RankResultsGrid.BindDataGrid() in ***************\ControlsRankResultsGrid.ascx.cs:82
***************.Controls.RankResultsGrid.ShowResults() in ***************ControlsRankResultsGrid.ascx.cs:68
***************.Main.ShowPage() in
***************\saltwaterfishingmain.aspx.cs:75
***************.Main.Page_Load(Object sender, EventArgs e) in ***************\main.aspx.cs:43
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731
Thank you
View 1 Replies
View Related
Oct 25, 2007
Hi i am trying to transfer the contents of a dbf file to sql server 2005 and this is my error message
'C:Documents and SettingsKarenMy DocumentsVisual Studio 2005WebSitesASC1pdfclientAS.DBF' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.
This is my code
If (FlAS.PostedFile.FileName.ToLower.EndsWith(".dbf")) Then
FlAS.PostedFile.SaveAs(location)
Try
'Connection string to a dbase file
Dim dbfConnectionString As String = String.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source ={0};Extended Properties= dBase IV", location)
'create connection to the DBF file
Using connection As Data.OleDb.OleDbConnection = New Data.OleDb.OleDbConnection(dbfConnectionString)
Dim command As Data.OleDb.OleDbCommand = New Data.OleDb.OleDbCommand("Select * from AS.DBF", connection)
connection.Open()
'Create a dbDatareader to the dbf file
Using dr As Data.Common.DbDataReader = command.ExecuteReader()
Dim sqlConnectionString As String = System.Configuration.ConfigurationManager.AppSettings(APPSETTINGS_CONNECTION)
Dim myConnection As New SqlConnection(System.Configuration.ConfigurationManager.AppSettings(APPSETTINGS_CONNECTION))
Dim query As String = "Truncate table ASDBF"
myConnection.Open()
Dim cmd As New SqlCommand(query, myConnection)
cmd.CommandType = CommandType.Text
cmd.ExecuteScalar()
myConnection.Close()
'bulk copy of sql server
Using BulkCopy As SqlBulkCopy = New SqlBulkCopy(sqlConnectionString)
BulkCopy.DestinationTableName = "ASDBF"
BulkCopy.WriteToServer(dr)
End Using
End Using
connection.Close()
End Using
Catch ex As Exception
Throw ex
End Try
End If
Any help will be appreciated.
Regards
Karen
View 12 Replies
View Related
Jun 29, 2001
Msg 2503, Level 16, State 1
Table Corrupt: Page Linkage is not consistent; check the following pages: (Current page#=298065; page pointing to this page =286585; previous page# indicated in this page=283321).
Can somebody urgently help? Any help will be appreciated.
View 1 Replies
View Related
Jun 5, 2006
I get the following error when I try to access the database from my web application
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.
The application works when I run it on my local machine, but when I move the application to a remote server, I get the above error.
Below is the connection string section in my web.config file.
<connectionStrings> <remove name="LocalSqlServer"/> <add name="LocalSqlServer" connectionString="Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|CiaaASPNETDB.MDF;user instance=true;Integrated Security=True;Initial Catalog=CiaaASPNETDB;Integrated Security=True;user instance=true;Connection Timeout = 0" providerName="System.Data.SqlClient"/> <!--Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|CiaaASPNETDB.MDF;user instance=true;Integrated Security=True;Initial Catalog=CiaaASPNETDB --> </connectionStrings>
Can anyone help me with this.
View 1 Replies
View Related
Jan 20, 2007
Hi, I'm trying to do insert some data to the database through typing the a number in a textbox. But i will get this error message whenever i tried putting a number that will be inserted to the database.
Sorry that the codes are quite messy. Please do let me know which part of the coding contains the errors.
Please help me. Thanks.
Server Error in '/WSD Project - Cam-Mart' Application.
String or binary data would be truncated.The statement has been terminated. 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.Data.SqlClient.SqlException: String or binary data would be truncated.The statement has been terminated.Source Error:
Line 26:
Line 27: Protected Sub add_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles add.Click
Line 28: SqlDataSource2.Insert()
Line 29: Response.Redirect("Checkout.aspx")
Line 30: Source File: C:Documents and SettingsAdministratorDesktopWSD Project - Cam-MartOrder.aspx.vb Line: 28 Stack Trace:
[SqlException (0x80131904): String or binary data would be truncated.
The statement has been terminated.]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +177
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +68
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +199
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2300
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +147
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +1021
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +314
System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) +413
System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +115
System.Web.UI.WebControls.SqlDataSourceView.ExecuteDbCommand(DbCommand command, DataSourceOperation operation) +392
System.Web.UI.WebControls.SqlDataSourceView.ExecuteInsert(IDictionary values) +405
System.Web.UI.WebControls.SqlDataSource.Insert() +13
Order.add_Click(Object sender, EventArgs e) in C:Documents and SettingsAdministratorDesktopWSD Project - Cam-MartOrder.aspx.vb:28
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +75
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +97
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4921
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210
The codes that i have is in Order.aspx:
<%@ Page Language="VB" MasterPageFile="~/MainMasterPage.master" AutoEventWireup="false" CodeFile="Order.aspx.vb" Inherits="Order" title="Cam-Mart - Your Cart" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:TextBox ID="ProductID" runat="server" Visible="False"></asp:TextBox>
<asp:TextBox ID="ProductPrice" runat="server" Visible="False"></asp:TextBox><br />
<span style="font-family: Verdana; color: lightsteelblue;">Product Name: </span>
<asp:Label ID="prodName" runat="server" Text="Label" ForeColor="Black"></asp:Label><br />
<span style="font-family: Verdana; color: lightsteelblue;">Product Price: </span><asp:Label ID="price"
runat="server" Text="Label" ForeColor="Black"></asp:Label><br />
<span style="font-family: Verdana"><span style="color: lightsteelblue">Quantity:</span>
</span><asp:TextBox ID="tbQuantity" runat="server" AutoPostBack="True"></asp:TextBox>
<asp:Label ID="lblqty" runat="server" Text="Label"></asp:Label><br />
<asp:TextBox ID="ProductName" runat="server" Visible="False"></asp:TextBox><br />
<br />
<asp:Label ID="Label1" runat="server" Text="Label" Visible="False"></asp:Label><br />
<span style="color: lightsteelblue; font-family: Verdana">Your Order Date is: </span>
<asp:Label ID="lblOrderDate" runat="server"></asp:Label><br />
<span style="color: lightsteelblue; font-family: Verdana">Your Delivery Date will be:</span>
<asp:Label ID="lblDeliveryDate" runat="server"></asp:Label><br />
<asp:TextBox ID="dtorderdate" runat="server" Visible="False"></asp:TextBox>
<br />
<asp:TextBox ID="dtdeliverydate" runat="server" Visible="False"></asp:TextBox><br />
<br />
<asp:Button ID="add" runat="server" Text="Add to Cart" /><br />
<asp:Button ID="Back" runat="server" Text="Back" /><br />
<asp:Button ID="checkout" runat="server" Text="Checkout" /><br />
<asp:FormView ID="FormView1" runat="server" DataKeyNames="CustID" DataSourceID="SqlDataSource1">
<EditItemTemplate>
CustID:
<asp:Label ID="CustIDLabel1" runat="server" Text='<%# Eval("CustID") %>'></asp:Label><br />
<asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update"
Text="Update">
</asp:LinkButton>
<asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False" CommandName="Cancel"
Text="Cancel">
</asp:LinkButton>
</EditItemTemplate>
<InsertItemTemplate>
<asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert"
Text="Insert">
</asp:LinkButton>
<asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel"
Text="Cancel">
</asp:LinkButton>
</InsertItemTemplate>
<ItemTemplate>
CustID:
<asp:Label ID="CustIDLabel" runat="server" Text='<%# Eval("CustID") %>'></asp:Label><br />
</ItemTemplate>
</asp:FormView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:List Product %>"
SelectCommand="SELECT [CustID] FROM [CustInfo] WHERE ([CustName] = @CustName)">
<SelectParameters>
<asp:ControlParameter ControlID="Label1" Name="CustName" PropertyName="Text" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConflictDetection="CompareAllValues"
ConnectionString="<%$ ConnectionStrings:List Product %>" DeleteCommand="DELETE FROM [OrderDetail] WHERE [OrderID] = @original_OrderID AND [CustID] = @original_CustID AND [CustName] = @original_CustName AND [OrderDate] = @original_OrderDate AND [TotalValue] = @original_TotalValue AND [Quantity] = @original_Quantity AND [DeliveryDate] = @original_DeliveryDate AND [ProductID] = @original_ProductID AND [ProductName] = @original_ProductName"
InsertCommand="INSERT INTO [OrderDetail] ([CustID], [CustName], [OrderDate], [TotalValue], [Quantity], [DeliveryDate], [ProductID], [ProductName]) VALUES (@CustID, @CustName, @OrderDate, @TotalValue, @Quantity, @DeliveryDate, @ProductID, @ProductName)"
OldValuesParameterFormatString="original_{0}" SelectCommand="SELECT * FROM [OrderDetail] WHERE ([CustID] = @CustID)"
UpdateCommand="UPDATE [OrderDetail] SET [CustID] = @CustID, [CustName] = @CustName, [OrderDate] = @OrderDate, [TotalValue] = @TotalValue, [Quantity] = @Quantity, [DeliveryDate] = @DeliveryDate, [ProductID] = @ProductID, [ProductName] = @ProductName WHERE [OrderID] = @original_OrderID AND [CustID] = @original_CustID AND [CustName] = @original_CustName AND [OrderDate] = @original_OrderDate AND [TotalValue] = @original_TotalValue AND [Quantity] = @original_Quantity AND [DeliveryDate] = @original_DeliveryDate AND [ProductID] = @original_ProductID AND [ProductName] = @original_ProductName">
<DeleteParameters>
<asp:Parameter Name="original_OrderID" Type="Int32" />
<asp:Parameter Name="original_CustID" Type="Int32" />
<asp:Parameter Name="original_CustName" Type="String" />
<asp:Parameter Name="original_OrderDate" Type="DateTime" />
<asp:Parameter Name="original_TotalValue" Type="Decimal" />
<asp:Parameter Name="original_Quantity" Type="Int32" />
<asp:Parameter Name="original_DeliveryDate" Type="DateTime" />
<asp:Parameter Name="original_ProductID" Type="Int32" />
<asp:Parameter Name="original_ProductName" Type="String" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="CustID" Type="Int32" />
<asp:Parameter Name="CustName" Type="String" />
<asp:Parameter Name="OrderDate" Type="DateTime" />
<asp:Parameter Name="TotalValue" Type="Decimal" />
<asp:Parameter Name="Quantity" Type="Int32" />
<asp:Parameter Name="DeliveryDate" Type="DateTime" />
<asp:Parameter Name="ProductID" Type="Int32" />
<asp:Parameter Name="ProductName" Type="String" />
<asp:Parameter Name="original_OrderID" Type="Int32" />
<asp:Parameter Name="original_CustID" Type="Int32" />
<asp:Parameter Name="original_CustName" Type="String" />
<asp:Parameter Name="original_OrderDate" Type="DateTime" />
<asp:Parameter Name="original_TotalValue" Type="Decimal" />
<asp:Parameter Name="original_Quantity" Type="Int32" />
<asp:Parameter Name="original_DeliveryDate" Type="DateTime" />
<asp:Parameter Name="original_ProductID" Type="Int32" />
<asp:Parameter Name="original_ProductName" Type="String" />
</UpdateParameters>
<SelectParameters>
<asp:ControlParameter ControlID="FormView1" Name="CustID" PropertyName="SelectedValue"
Type="Int32" />
</SelectParameters>
<InsertParameters>
<asp:ControlParameter Name="CustID" Type="Int32" ControlID="FormView1"/>
<asp:ControlParameter Name="OrderDate" Type="DateTime" ControlID="dtorderdate"/>
<asp:ControlParameter Name="TotalValue" Type="Decimal" ControlID="price"/>
<asp:ControlParameter Name="Quantity" Type="Int32" ControlID="lblqty"/>
<asp:ControlParameter Name="DeliveryDate" Type="DateTime" ControlID="dtdeliverydate"/>
<asp:ControlParameter Name="ProductID" Type="Int32" ControlID="ProductID"/>
<asp:ControlParameter Name="ProductName" Type="String" ControlID="prodName"/>
<asp:ControlParameter Name="CustName" Type="String" ControlID="Label1"/>
</InsertParameters>
</asp:SqlDataSource>
</asp:Content>
The text in Order.aspx.vb is :
Partial Class Order
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
'Dim sUsername As String = " "
Session("Username") = Request.ServerVariables("Auth_user")
Label1.Text = Session("Username")
ProductID.Text = Request("ProductID")
ProductPrice.Text = Request("ProductPrice")
ProductName.Text = Request("ProductName")
lblqty.Text = tbQuantity.Text
prodName.Text = ProductName.Text
price.Text = ProductPrice.Text
dtorderdate.Text = DateTime.Today
dtdeliverydate.Text = DateAdd("d", 7, Date.Today)
lblOrderDate.Text = dtorderdate.Text
lblDeliveryDate.Text = dtdeliverydate.Text
'Dim dtorderdate, dtdeliverydate As DateTime
'lblOrderDate.Text = "Order date: " & dtorderdate.ToString
'lblDeliveryDate.Text = "Delivery date: " & dtdeliverydate.ToString
End Sub
Protected Sub add_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles add.Click
SqlDataSource2.Insert()
Response.Redirect("Checkout.aspx")
End Sub
Protected Sub Back_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Back.Click
Response.Redirect("Catalogs.aspx")
End Sub
Protected Sub checkout_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles checkout.Click
Response.Redirect("Checkout.aspx")
End Sub
End Class
View 2 Replies
View Related
Mar 24, 2006
Dear all,
I am getting the message "Canot generate SSPI context",while i am working in a client system.I hope this is something related to networking.How to solve the problem.I can not connect to SQL Server once i got above mentioned message.
Please give your advice to understand and rectify the problem.
regards
Graceson
View 3 Replies
View Related