Last post Nov 09, 2007 04:26 PM by Raitasar
Aug 23, 2007 02:02 PM|rjbudz|LINK
Aug 23, 2007 04:06 PM|AlecWhittington|LINK
This is a very common problem and the answer is actually very easy. There are several ways to accomplish what are are wanting to do, please see below:
Aug 29, 2007 01:10 AM|rjbudz|LINK
I suppose in some far away land, the answer is actually very easy. However, in this reality, it isn't.
I downloaded and installed all the needed software from your post and associated links. I attempted option 1, but couldn't get it to locate the database. Not that it mattered, because ...
I then tried option 2. Got all the way to running the Create Database part. Oh well.
I sent my Web Host this:
I still need your help to make this work. I’m not going to give up until it does.
Please see this page:
I have uploaded the SQL script to
I copied RunSQL.ASPX to the yyy folder.
I run it there and get the same error I got before regarding creation of a SQL database.
I want my ASP.NET controls to work. Microsoft designed their .NET framework so that they would.
PLEASE solve this problem!
In the RunSQL.ASPX file, I put in the connection string I think I need to make it all work. But I guessed. That may be the place to look
to get this to work.
They responded with this:
The is behaviour by design on our system. Your login will never have permissions to create databases directly on our SQL servers. The way to add an SQL db to your account is through your control panel.
Microsoft may have designed it a certain way, but we cannot allow our clients to add databases whenever they want, we need to be able to track the databases and limit accounts as per our account limits. The page you mention assumes that your account has
permissions to create databases, which it does not on our system.
If you want us to run D:\Clients\xxx.com\xxx.com\yyy\App_Data\ASPNETDB.MDF.sql on an existing SQL db under your account, please let us know the details.
Didn't I say they'd find a way not to do it? I realize the whole point of your response was to bypass the whole create-on-the-fly issue. But obviously, to them, that isn't the issue at all.
So, I'm more than willing to kick these guys to the curb, this is by far not the first up-hill battle I've attempted with these guys. I checked with another Web Hosting group who have the same inane setup. Now, assuming that Microsoft thought this out
in advance, there should be Web Hosting companies out there that can do this.
Has anyone actually used these controls on their web sites? Who is your Web Host. My sites are meager but I want to be able to use all the new stuff!
Aug 29, 2007 10:28 AM|AlecWhittington|LINK
Aug 30, 2007 08:41 PM|rjbudz|LINK
So here is the latest from my web host. I asked them to create for me a SQL Server database in my App_Data directory where my web app is to run:
I need a name for the database that does not already exist on our SQL 2005 server. It doesnj''t exist under your account, it exists under a different client''s account. You will need to use a different name for your database as ASPNETDB.MDF is already in use
by another client, and we cannot create a db on the SQL server with that name twice.
Yes, it is common practice if your''re using SQL Server Express on a Server which only hosts a few websites. We don''t run SQL Server Express and our servers host many websites.
Please keep in mind you are in a shared hosting environment.
Does this make sense to you? Perhaps I'm under the mistaken assumption that the controls I've been trying to set up (for about a week now) need to reference a database named ASPNETDB.MDF in the App_Data directory?
If I'm wrong (and I hope I am), how do I go about telling my Login and CreateUserWizard to look at a different database in a different directory?
Aug 31, 2007 11:55 AM|AlecWhittington|LINK
What they are saying makes perfect sense to me. I also work at a Web Host and we do not allow SQL Express due to security issues. By chance I had to set-up membership, roles, and profiles for a new project. Here is the easiest way to get this accomplished,
but your hosting company must allow you to have Access to your MS SQL 2000 / 2005 database. We allow our customers to access the MS SQL servers with SQL Management Studio (or Enterprise Manager for older versions), so this requirement is met.
Now we need to modify your web.config to account for the changes you have made. Here is what needs to be placed there
connectionString="Data Source=ServerName;Initial Catalog=DBName;Persist Security Info=True;User ID=Username;Password=Password"
Now your providers
<membership defaultProvider="MyMembershipProvider"> <providers> <add name="MyMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=188.8.131.52, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="MyConnectionString" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" applicationName="YourAppName" requiresUniqueEmail="true" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="1" passwordAttemptWindow="10" passwordStrengthRegularExpression=""/> </providers> </membership> <profile defaultProvider="MyProfileProvider"> <providers> <add name="MyProfileProvider" connectionStringName="MyConnectionString" applicationName="YourAppName" type="System.Web.Profile.SqlProfileProvider, System.Web, Version=184.108.40.206, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/> </providers> </profile> <roleManager enabled="true" defaultProvider="MyRoleProvider"> <providers> <add name="MyRoleProvider" connectionStringName="MyConnectionString" applicationName="YourAppName" type="System.Web.Security.SqlRoleProvider, System.Web, Version=220.127.116.11, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/> </providers> </roleManager>
You should now be able to manage your providers via VS 2005 / 2008 by opening the web application and then going to
Project -> ASP.NET Configuration.
Aug 31, 2007 01:55 PM|rjbudz|LINK
Alec, you've obviously put in a lot of effort into your last post, and I very much appreciate it. I really hope to be able to use it, or someone else can. However, being at the very start of the learning curve, I have no idea how to ask my Web Host if I
can even do any of this. What does "have Access to your MS SQL 2000 / 2005 database" mean? I have no tools at my disposal to interact with any database other than creating SQL statements in my pages. If I want ot create tables and manage data (via something
like Query Manager), then I'm out of luck.
Hell, I can't even get them to help me create a viable connection string to talk to an MS Access database on the server. Use the IP address, they say.
Looking over your list of things to do, my impression is that they just don't allow me to do most of it. The told me already they would run aspnet_regsql.exe FOR me. Unfortunately, I can not get them to give me a Step-By-Step This-Is-What-You-Need-To-Do
laundry list of what needs to be done. They will only address one issue at a time, usually in the form of "We can't do that because...".
I may be just wasting time. I'm not sure they are capable of allowing me to set any of this up.
I feel like I'm missing a huge peice of the puzzle. I have several books on ASP.NET 2.0. ALL of them explain how to use the CreateUserWizard control to create and populate a database in APP_DATA. It looks pretty cut & dry, as one would expect. NONE of them
tell me about all the hoops I have to jump through, the begging I have to do, the multilpe post to message boards, or the blood, sweat and tears it takes to accomplish this. Should I have to be reinventing the CPU here?
Shouldn't they just say: "Hey look, he's creating a Web App in ASP.NET 2.0! He'll need to create a database called ASPNETDB.MDF in his APP_DATA directory! Go ahead and flip this switch and that one."
Why is this so damn difficult? Is ASP.NET worth the trouble?
I know I'm asking a lot, but for my benefit, and those that will inevitably follow, what do I need to ask of my Web Host?
Or how do I determine if a new web host will allow me to do what I need to do without jumping in with both feet first?
Aug 31, 2007 02:19 PM|AlecWhittington|LINK
No worries. Some web hosts believe that not allowing their customers to have any access to the SQL server makes them more secure, in fact that does not make them more secure. What they are really doing is creating an environment for developers that is not
conducive to getting anything done. I try not to do this, as I work for a hoster as well, but I would recommend finding a new host. There are many good hosts out there that will allow you to get done what you are trying to do. CrystalTech is one of those host,
but there are many other good ones as well. I do show that M6 allows you to remotely administer your database with SQL Management Studio. I would take a look at their Knowledge base or FAQ's to get more information on this.
I know what you mean about the books, they all seem to make sure of SQL Express, but none really showcase a real world example. The information I provided you will help you get it set up on a proper MS SQL 2000 or 2005 database and allow your CreateUserWizard
to work. It will also allow you to use Roles and Profiles if you are so inclined. I can feel your pain on the learning curve, but no matter what language you use, there is bound to be a learning curve. I have been working with .NET since 1.0 beta 1 and it
is my preferred framework for development. The inital learning curve we faced was unreal, especially coming from a legacy ASP background. I was responsible for converting all the existing ADO code to ADO.NET and at that time, all books were about beta versions,
there really were no sites up yet with a lot of content about ADO.NET. It was rough, but we persevered thru it and made a successful transition. Hang in there, it only gets better.
Aug 31, 2007 03:57 PM|rjbudz|LINK
SQL Management Studio appears to only work on local databases or on a local network, not across the internet. So I can't see how I can use it to connect to my database at M6 or anywhere else. This is the problem I ran into back on the 8/28 post.
Let's assume that I want to change Web Hosts. I might, ya know.[:)] What do I look for or ask of a potential new one, to avoid all this in the future?
Aug 31, 2007 04:25 PM|AlecWhittington|LINK
I hate to be the bearer of bad news, but SMS (SQL Management Studio) most definitely works across the internet. If you cannot connect to your DB at M6, it might be due to a firewall issue at your location. If that were not the case, I would have 60,000 pissed
In the case of changing hosters, after re-reading all the posts between us, I do not think the hoster is at fault here. I think the main problem, and please forgive me for saying this, might be your lack of understanding on how certain things work. There
is nothing wrong with that, we all had to start somewhere. In this case I believe the fact that your are starting out with ASP.NET and possible lack of experience with SQL Server (from a management perspective) have been to blame for the rift between yourself
and your host. Now with that said, I believe I might have prolonged that rift by either not fully understanding your skill level, your hosts capabilities, or both. The best thing you can do at this point is to try and increase your knowledge about ASP.NET
2.0 and MS SQL.
If you are bound and determined to leave your host, then here are the things you need to ask them:
If you were to ask these question to me, the answers would be:
Aug 31, 2007 06:28 PM|rjbudz|LINK
No worries about offending me at any level. I'm really am concerned with only two things: Getting this all to work (I will want to do this over and over, I am sure) and learning something along the way. Like you said, we have to start somewhere. I just
chose the deep end of the pool.
You're probably right about SQL Management Studio and a firewall here. I will try it at home to be sure. But that is another issue. For right now, what do I do to get to where I need to go? You actually know a heck of a lot more about what is going
on here than I do. This again is the last email I got from them:
Assuming I give them some name, say 'ThisDB', then what? How do I tell my app that the database it is looking to read and write user data (as well as other data required for this site to work) is not in the App_Data directory, but rather at some Web host
Wait! Wait! The little light came on! web.config in Configuration/conectionStrings right? So how will this string look in my webs config file?
Sep 01, 2007 12:13 AM|rjbudz|LINK
My SQL Server Management Studio Express at home does not allow me to access non-local databases (such as on my web server.)
Sep 02, 2007 04:54 AM|AlecWhittington|LINK
Look at what you are trying to connect to: ftp://.........
You cannot connect to a database server via ftp://
You need to contact M6 and have them create a MS SQL 2005 database for you. Make sure to tell them what you want it named as well as the username and password. They might in fact already have a place you can create it yourself and if that is the case you
can create it. I like the name my databases something very descriptive with all or part of the project name in it.
Sep 05, 2007 02:10 PM|rjbudz|LINK
Wow. They created the database, and I can access it from SQL Server Management Studio (from home) using the IP address they specified. Just like it is supposed to work. I think this ENTIRE episode could have been avoided if just one of the ASP.NET books
put in a paragraph explaining how it works in the REAL WORLD.
Anyway, I haven't yet tried to use the database with my Web App. I've had no time. But they did run the SQL Script I created against my local database as specified in one of the above links.
I will try to figure out how to point my app to the correct database, I suspect It's all spelled out for me in your posts above. I'll post again when things are up and running. Words of advice and encouragement are always welcome! :) And yet again, thanks
for hanging in there for me.
Sep 05, 2007 02:28 PM|AlecWhittington|LINK
No worries. I knew it was just a matter of time before we got it solved. If you have anymore questions make sure to post them here. I am subscribed to the thread so I get emails when you post here.
Nov 09, 2007 04:26 PM|Raitasar|LINK