Click here to Skip to main content
15,899,679 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, I have created an app using vb.net (webrole).

I want that this app use my database that is on the cloud, it's name is sgs, and want too, that my web security settings (asp.net configuration database) be on the cloud too.

( I don't want to use SQL Server installed on my machine)

I have read several papers about this issue.

They say that I need to create my database, whitch is already made, and that I need to create a second database that will store the user information.

This second database is also in the cloud already. I have used the tool aspnet_regsql to configure it.

So, I have a database, with the name SGS, and other database that I created and populated through the tool aspnet_regsql. This second database was named segurancas.

After creating the database I read that It was necessary to install Nuget package library and I done it.

Then, was you can see through my web.config file I changed the connection strings so they connect directly to the cloud.

The ApplicationServices is pointing to the segurancas database
and the default connection to my SGS database.

Still I can not configure security using asp.net configuration.

I keep receiving a message that my provider is not good.

Can you please help?




WebConfig file:
HTML
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
  <system.diagnostics>
    <trace>
      <listeners>
        <add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="AzureDiagnostics">
          <!--><filter type="" />-->
        </add>
      </listeners>
    </trace>
  </system.diagnostics>
  <connectionstrings>
    <!-- <add name="ApplicationServices" connectionstring="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true" providername="System.Data.SqlClient" />
    -->
    
    <add name="ApplicationServices" connectionstring="data soruce=mwjw08qhju.database.windows.net;initial catalog=segurancas;user id=pr;password=00yzw12ptag34_;encrypt=True;Trusted_Connection=false; multipleactiveresultsets=True" providername="System.Data.SqlClient" />
    <add name="aspnet_1db0ca8ec36d4ba1852e5e4ec9947660Entities" connectionstring="metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=System.Data.SqlClient;provider connection string="data source=.\SQLEXPRESS;initial catalog=aspnet_1db0ca8ec36d4ba1852e5e4ec9947660;integrated security=True;multipleactiveresultsets=True;App=EntityFramework"" providername="System.Data.EntityClient" />
    <add name="SGSEntities" connectionstring="metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=System.Data.SqlClient;provider connection string="data source=mwjw08qhju.database.windows.net;initial catalog=SGS;user id=pr;password=00yzw12ptag34_;encrypt=True;multipleactiveresultsets=True;App=EntityFramework"" providername="System.Data.EntityClient" />
    <add name="DefaultConnection" connectionstring="Data Source=Server=tcp:mwjw08qhju.database.windows.net,1433;Database=SGS;User ID=pr@mwjw08qhju;Password=myPassword;Trusted_Connection=False;Encrypt=True;multipleactiveresultsets=True" providername="System.Data.SqlClient  " />
  
  </connectionstrings>
  <system.web>
    <authorization>
      <allow roles="Administrador" />
      <deny users="?" />
    </authorization>
    <compilation debug="true" strict="false" explicit="true" targetframework="4.0">
      <assemblies>
        <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
      </assemblies>
    </compilation>
    <authentication mode="Forms">
      <forms loginUrl="~/Account/login.aspx" timeout="2880" />
    </authentication>
    <membership defaultprovider="DefaultMembershipProvider">
      <providers>
        <clear />
        <add connectionstringname="ApplicationServices" enablepasswordretrieval="false" enablepasswordreset="true" requiresquestionandanswer="false" requiresuniqueemail="false" maxinvalidpasswordattempts="5" minrequiredpasswordlength="6" minrequirednonalphanumericcharacters="0" passwordattemptwindow="10" applicationname="/" name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" />
        <add name="DefaultMembershipProvider" type="System.Web.Providers.DefaultMembershipProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionstringname="DefaultConnection" enablepasswordretrieval="false" enablepasswordreset="true" requiresquestionandanswer="false" requiresuniqueemail="false" maxinvalidpasswordattempts="5" minrequiredpasswordlength="6" minrequirednonalphanumericcharacters="0" passwordattemptwindow="10" applicationname="/" />
      </providers>
    </membership>
    <profile defaultprovider="DefaultProfileProvider">
      <providers>
        <clear />
        <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionstringname="ApplicationServices" applicationname="/" />
        <add name="DefaultProfileProvider" type="System.Web.Providers.DefaultProfileProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionstringname="DefaultConnection" applicationname="/" />
      </providers>
    </profile>
    <rolemanager enabled="true" defaultprovider="DefaultRoleProvider">
      <providers>
        <clear />

        
        
        <add connectionstringname="ApplicationServices" applicationname="/" name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" />
        <add applicationname="/" name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" />
        <add connectionstringname="DefaultConnection" applicationname="/" name="DefaultRoleProvider" type="System.Web.Providers.DefaultRoleProvider,            System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
       <!--name="DefaultRoleProvider" type="System.Web.Providers.DefaultRoleProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" applicationName="/" />
      -->
      </providers>
    </rolemanager>
    <sessionstate mode="InProc" customprovider="DefaultSessionProvider">
      <providers>
        <add name="DefaultSessionProvider" type="System.Web.Providers.DefaultSessionStateProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionstringname="DefaultConnection" applicationname="/" />
      </providers>
    </sessionstate>
  </system.web>
  <system.webserver>
    <modules runallmanagedmodulesforallrequests="true" />
  </system.webserver>
</configuration>


[Edit - removed pre tag from description, added pre tag for xml code block]
Posted
Updated 9-Mar-12 8:26am
v2

1 solution

Hi there!
Your post came up in a related search and I thought I’d give it a try and see if I can help. I don’t know which cloud service you’re trying to connect to or what your connection string is, so I can only try some general advice, which will hopefully shed some light on the issue...
I found a very similar scenario on Stackoverflow: someone wrote a vb.net/webrole app and is trying to connect it to SQL Azure (again, not sure which cloud you are connecting to). He too was having some problems, but did not mention a Provider error. First of all, maybe a look at his configuration will help. Second, he was given a tip to set up a firewall rule to be able to connect properly and some best practices, however, the latter apply only to SQL Azure.
Anyway, I see what you mean by “I don't want to use SQL Server installed on my machine”, yet “Still I can not configure/keep receiving a message...”. What I mean is, getting this so-called simple task done tends to get complicated and timely. My best bet is you let this one go just because you never had the time to unravel the web of errors. I came across this thread because I was reading up on the subject of moving an app to the cloud, and I find it’s even more complex than I thought it to be. However, taking a slightly different approach, I understand there are managed services for mirroring your db and simply connecting your app to it (not all are paid). Here’s one type of cloud-based database I came across (I think they support asp.net apps), and I would also check if Azure offer some sort of front-end or at least a transparent upload procedure.
So to conclude, I hope that if you forgot about this you still have a soft spot for this app (and you’ll find it helpful). If not, I hope someone else will :D
 
Share this answer
 
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900