ADO.NET :: The Underlying Provider Failed On Open
Nov 20, 2010i dont why it suddenly started blowin this error...whenever o insert or delete or view...what i have to do
View 3 Repliesi dont why it suddenly started blowin this error...whenever o insert or delete or view...what i have to do
View 3 RepliesI was using .mdf for connect to DB and entityClient. Now i want to change connection string that trehe will be no .mdfIs this conectionstring correct
[Code]....
becouse i always get error !The underlying provider failed on Open!
When I try to insert a record, I get this error : The underlying provider failed on Open.
This error occurs only with IIS and not with VWD 2008's webserver. In the EventViewer I get this Application Error : 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. [CLIENT: ]
<add name="ASPNETDBEntities" connectionString="metadata=res://*/Models.FriendList.csdl|res://*/Models.FriendList.ssdl|res://*/Models.FriendList.msl;provider=System.Data.SqlClient;provider connection
string="Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|ASPNETDB.MDF;Integrated Security=True;Connect Timeout=30;User Instance=True;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient" />
I am using aspnetdb.mdf file, and not any external database.I have searched enough for this, but no use.
I using System.Transactions on webservices hosted on different domains.Transaction on same domain works fine.But problem is with the distributed/different domains.
I ve tested with the dtctester and the output is as follows...
Initializing DTC
Beginning DTC Transaction
Enlisting Connection in Transaction
Error:
SQLSTATE=25S12,Native error=-2147168242,msg='[Microsoft][ODBC SQL Server Driver]
Distributed transaction error'
Error:
SQLSTATE=24000,Native error=0,msg=[Microsoft][ODBC SQL Server Driver]Invalid cur
sor state
Typical Errors in DTC Output When
a. Firewall Has Ports Closed
-OR-
b. Bad WINS/DNS entries
-OR-
c. Misconfigured network
-OR-
d. Misconfigured SQL Server machine that has multiple netcards.
Aborting DTC Transaction
Releasing DTC Interface Pointers
Successfully Released pTransaction Pointer.
Ok this one might be a bit tough to figure out, but each day when users open their application the following error is generated and they can not enter the application: "Failed to decrypt using provider 'EncryptionProvider'. Error message from the provider: The RSA key container could not be opened." Guess what fixes it... I have to open the application 1 time and then all of the users can being to open the application. This is not an issue with the encryption/decryption of the .config never having worked; it works just fine - but not all of the time. It sounds like a permissions issue to me, like me opening the app grants access to the key file for a time period, and the next day the issue starts all over again. Here is what I have already done (actually when I set up encryption originally), as the many, many posts with this issue are resolved with, but none have worked:
- aspnet_regiis -pa "MyWebKeys" "NT AuthorityNETWORK SERVICE"
- aspnet_regiis -pa "MyWebKeys" "ASPNET"
- Gave ASPNET account read access to "C:Documents and SettingsAll UsersApplication DataMicrosoftCryptoRSAMachineKeys" folder
- Gave NETWORK SERVICE account read access to "C:Documents and SettingsAll UsersApplication DataMicrosoftCryptoRSAMachineKeys" folder
I did not do the following, since I am not using the deafult machinekeys, but rather the imported "MyWebKeys" container
- aspnet_regiis -pa "NetFrameworkConfigurationKey" "NT AuthorityNETWORK SERVICE"
- aspnet_regiis -pa "NetFrameworkConfigurationKey" "ASPNET"
Here is how the file is encrypted:
aspnet_regiis -pef "appSettings" "C:MyProject" -prov "MyEncryptionProvider"
"MyWebKeys" are an imported key container on the server, that upon importing reside in the default "C:Documents and SettingsAll UsersApplication DataMicrosoftCryptoRSAMachineKeys" directory. So it appears I have covered everything, right? What am I missing? Do I have to add individual users or groups with the pa command that use my application to allow access to the container? Remember the encryption/decryption does work 95% of the time. It just seems that each day in the morning, I must open the app once prior to the users being able to open the application, which tells me it is a permissions issue because I am an Admin on the server and they are not, but I thought all of this runs under the NETWORK SERVICE account anyways?)
Parser Error Message: Failed to decrypt using provider 'WSConfigProvider'. Error message from the provider: The RSA key container could not be opened.
I am trying to copy a website from one server to another, however I am getting the error above
<connectionStrings configProtectionProvider="WSConfigProvider">
Line 51: <EncryptedData Type="http://www.w3.org/2001/04/xmlenc#Element"
Line 52: xmlns="http://www.w3.org/2001/04/xmlenc#">
Line 53: <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc" />
I have copied the entire site so cant think what file it could be missing, however looking at the article [URL] .... I cannot seem to find the location Documents and Settings{UserName}Application DataMicrosoftCryptoRSA on the server, where would this be on a 2008r2 server? And is there some files in there missing which could be causing this error?
Cannot open user default database. Login failed. Login failed for user X
View 3 RepliesI'm using this for connection to SQL Server 2005 [Windows authentication]
<add key="ConnectionString" value="Data Source=MALIKsqlexpress;Initial Catalog=gainpeace;Integrated Security=SSPI"></add>
but it generates an error
Cannot open database "gainpeace"
requested by the login. The login
failed. Login failed for user
'MALIKASPNET'.
I am writing a page for creating a new user for a website. After the user fills out the form and click the "Create User" button, the information provided is supposed to be sent for storage to the database. I have been getting the same error message for a couple of days now and I've ran out of things to try. The message doesn't seem like a complicated issue, in fact it's quite common and found a great deal of information on how to resolve it. However, nothing I've tried works. I'm using VS 2010, and SQL Server Express 2005. The message I get is the following:Cannot open database "[database]" requested by the login. The login failed.Login failed for user "[MACHINE_NAMEUSER]".I have added my current Windows account to the Users folder under the Security folder through Management Studio and granted it all the role memberships. I'm also using Windows authentication. If there's any information I'm not providing to figure out what's the issue, let me know and I'll post it.Stack Trace:
[Code]....
Currently using VS 2005 & MS SQL 2005 Server with a Windows 7 OS and I am unable to generate Update/Insert/Delete queries when using the TableAdapter wizard. I am able to create the Select statament. This is the error message that is displayed in the TableAdapter wizard on completion for each of the Update/Insert/Delete queries "failed to find or load the registered .net framework data provider"
I have seached the web but no one seems to have seen this same issue.
If you know what is causing this let me know. I didn't have this issue while running a XP or Vista OS.
I have created a set up of website using the template WebSetUp project in VS 2008/.net 3.5 and sql server 2005.
I get the following error after i install the set up.
Cannot open database "Project_Tracking" requested by the login. The login failed.Login failed for user 'NT AUTHORITYNETWORK SERVICE'.
I have created an ASP.Net website and tested it using the default server. I used the integrated membership provider for the users login and everything worked fine.
Now I moved to IIS 7 and nothing works anymore. I disabled the read-only feature but every time I try to either register a new user or add an item to the chart I get this error
Cannot open user default database. Login failed.
Login failed for user 'NT AUTHORITYNETWORK SERVICE'.
Whenever I have my database open in Visual Studio 2010 Express, I get this error:
Cannot open user default database. Login failed.
Login failed for user 'IIS APPPOOLDefaultAppPool'.
Cannot open user default database. Login failed.
Login failed for user 'IIS APPPOOLDefaultAppPool'.
I want to open FolderBrowserDialog,
I am getting error as
"Current thread must be set to single thread apartment (STA) mode before OLE calls can be made. Ensure that your Main function has STAThreadAttribute marked on it. This exception is only raised if a debugger is attached to the process."
Then I added
System.Threading.Thread.CurrentThread.SetApartmentState(System.Threading.ApartmentState.STA)
And I got error as "Failed to set the specified COM apartment state."
Here is code
Private Sub btnBrowse_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim MyFolderBrowser As New System.Windows.Forms.FolderBrowserDialog
' Description that displays above the dialog box control.
System.Threading.Thread.CurrentThread.SetApartmentState(System.Threading.ApartmentState.STA)
MyFolderBrowser.Description = "Select the Folder"
[Code] ....
I have watched the how to video on Creating a Custom Membership provider. So far it works great. My login control interacts well with it etc. Now i've created a Custom Role Provider. I've created a class that inherits the RoleProvider base class and i've added code to each Sub. My question is, what is the best way to implement the role provider, considering I get the Roles etc from the database?
View 11 RepliesI am trying to build an application that
1. user can login by their AD account and password.
2. AD account can be assigned to different group.
I know there is a training video - [URL] to teach how to use the tool to provision the membership schema to SQL server for Forms authentication. but how can I use AD authentication with this?
I try to get the user profile settings with this code. But all items in it are empty, in the database they are not empty. So there is going something wrong. First of oll how can i add a provider to the ProfileCommon ? Maybe i'm there then... the usrInfo is filled well...
MembershipUser usrInfo = Membership.Providers["MyMembershipProvider"].GetUser(UserName,false);
ProfileCommon prf = (ProfileCommon)Profile.GetProfile(UserName);
LitNaam.Text = prf.Voorletters.ToString() + " " + prf.Achternaam.ToString();
i have implemented custom role provider and membership provider .
login page : SignIn.aspx
on successful login it redirects to (index-Homepage.aspx)
now PROBLEM is when it successfully logged in ,and redirects to 'index-Homepage.aspx' it gives Anornymoustemplate ..while its verifying the role correctly in index-Homepage.aspx.cs
1 - whats the difference between Role Provider and Membership provider ??
2- If we implement Custom Role Provider or Custom Membership provider then what does this means ? and which Provider do we use when we apply custom role provider or custom membership provider
i'm building an application and i need to manage roles, users and more things so i tought to use the membership provider but i have some questions about it: can i full extend it and can i override the functions to use a database table to store infos about config or i need to build my own provider?
View 4 RepliesI am not used to work with SQL Server(usually I just use express). I run it on windows server 2008, iis7.
I have attached the database to my sql server. I made a web site in iis7 but I get this error message.
Cannot open database "Phaeton.mdf" requested by the login. The login failed.
Login failed for user 'NT AUTHORITYNETWORK SERVICE'.
Connectionstring I use
<add key="PhaetonConnectionString" value="Data Source=.;Initial Catalog=Phaeton.mdf;Integrated Security=True"/>
i have gridview in my asp.net web application under framework 3.5. I am binding the gridview with List. Inside the grid there is update and delete functionalities which are running fine. But my save functionality, for which i decided to extract the list back from the datasource and then through loop i will insert the new list to database. But when i tried to get it conventional way it returned me null.
I tried the following ways to retrieve the List back.
1. List<MyClass> list = (List<MyClass>gv.DataSource);
2. List<MyClass> list = gv.DataSource as List<MyClass>;
3. IDataSource idt = (IDataSource)gv.Datasource;
List<MyClass> list = (List<MyClass>)idt;
But no luck, each time i got null.
I am building an MVC application with C# as my language which is hosted on Widows 7 IIS. A call to Add a new member to the database works, but when attempting to save the change I get the following error:
Cannot open user default database. Login failed.
Login failed for user 'IIS APPPOOLmyApplication'
The SQL table was added just by adding it within VS.
I have created a webservice which is saving some data into to db. But i am getting this error
Cannot open database "test" requested by the login. The login failed. Login failed for user 'xyzASPNET'.
my connection string is
add name="ConnectionString1" connectionString="Data Source=.SQLExpress;Initial Catalog=IFItest;Integrated Security=True" providerName="System.Data.SqlClient"
<profile>
<providers>
<clear/>
<add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/"/>
</providers>
<properties>
<add name="FirstName"/>
<add name="LastName"/>
</properties>
</profile>
I have the code snippet above in my webconfig file. I am attempting to set the FirstName property in codebehind on a register.aspx page. Like this:
Profile.FirstName = ((TextBox)RegisterUser.CreateUserStep.ContentTemplateContainer.FindControl("FirstName")).Text;
VS says Profile is in System.Web.Profile Namespace. I then use it like this "System.Web.Profile.FirstName", but says first name does not exist in System.Web.Profile.FirstName namespace.
How do I set the property and later retrieve it?