I have to do a homework where i have to implement user registration and login in ASP.NET.(Form-Based)
I am reading my book and it says that the first thing I should do is use aspnet_regsql.exe to configure, but when I went to pick the the database I get this error:
I keep trying to fix this problem, but I dont know how.
At this link I found a note that says:
The database elements that are
installed in the feature database will
always be owned by the SQL Server
database owner account (dbo). In order
to install the feature database, a SQL
Server login must be permitted to the
db_ddladmin and dd_securityadmin roles
for the SQL Server database. However,
you do not need to be a system
administrator for the SQL Server in
order to install the feature database.
I don't understand what I am missing.
-What should I do?
-Where can I find db_ddladmin and dd_securityadmin?
UPDATE
As the above step looks like is not able to find the database, i thought i better create it manually. so this is what i do
Step 1:
Step 2:
Why is this happening?
I just need to prepare my work enviroment to use form-based authentification. I cannot do my homework if i cant configure my working enviroment first. Can someone give me a hand to fix this? Does it have to do something with permisions or other?
You are getting the error because you're trying to connect to a server that doesn't exist. If you are using sql server express, your server name would be creator-PC/SQLEXPRESS.
I believe I remember having to do this too. http://support.microsoft.com/kb/914277. Follow the instructions under "Enable remote connections for SQL Server 2005 Express or SQL Server 2005 Developer Edition"
First thing you need to do is try to browse to the database itself. I use the sql server management studio to do this. If you are able to connect, then you will need to edit the user permissions, otherwise you probably have an issue with the sql server setup.
if you tried connecting using management studio to your DB server and if you are able to connect but you are not able to connect through asp.net application then there is a probability that the database does not have any permission for aspnet user so first create a new user in sql server for aspnet user and try again to connect using the wizard.
Generally the error comes when you not have your server started or installed on machine. Also Make sure the server instance is running and you place the right name of the server instance. if your sql server is configured to use sql server authentication then provide proper parameters i hope this all will help and get you out of it
Related
I've been searching about this on Google and I did find some useful stuff but I'm not totally sure if that's what I need so I'll ask here.
I'm trying to make a Windows Store application and I want to connect to a simple MySQL database that's on the server. What's the easiest or best way to do that? Whenever I need local databases I use Entity Framework. Is it possible to use it here and if so, are there any tutorials that cover everything that I need to install as well as some code examples?
My advice for you : read more about Database Engine :) cause once you connect you DB Engine to a Database : either it is local or on remote machine (Server) its the same thing when you look at it from your application.
1- First watch this read more about this : SQL Server Management Studio
2- watch this (how you connect to a remote database) enter link description here
3- Very important is to allow connection from Remote Machine enter link description here
4- Once you are able to connect to the remote database from your SQL Server, everythg is the same on EF.
I would like to create a new VisualStudio project with a simple SQL server db, but i want it to be portable, because several people will need to have access to the DB.
So it should be also accessible from a user with password.
The point is that when i create a Local SQL server DB i can't create a new user because it sais You can only create a user with password in a contained DB.
Is there a way to create a Local DB with password or a way to let several user access to the same DB?
Thx
Is there a way to create a Local DB with password
Yes. I'd recommend using Sql Server CE or SqlLite for a database like this. If you're only using Sql Server as a data store on the local machine, Sql Server, even Express Edition, which is still the full Sql Server engine, is usually way overkill for this. The full Sql Server engine really only makes sense when the database engine is the sole, exclusive reason that the machine where it runs exists.
Is there... a way to let several user access to the same DB?
Yes. Install Sql Server on a dedicated database machine, instead of using a Local DB, and set the appropriate connection string and permissions.
Here's the trick: you can't do both, at least not without going through all the same trouble you'd go through setting up a real Sql Server to run on the machine where this will be installed.
I have a very unusual problem. I made a project in C#.net in vs 2008 and SQL server 2005.
I have two DB to use.
Now, the problem is whenrunning the project on my PC it works fine, but when i install on users PC, through setup, im getting a exception handler error , when im trying to save any data in either of the DBs. However i tried to insert data through INSERT INTO coomand in sql it works fine. And i have no problem in retrieving data.
So any one can help please do.
Thanks in advance
How are you specifying your connection to the database(s)? If you're doing windows authentication, most likely your user's accounts don't have permissions on the database. It could also be that they can't see the database from where they are on the network.
I'd start by pinging the DB server from the user's machine to make sure they can even access the server.
I have Visual Studio 2010, Sql Server 2008, Sql Management Studio and pretty much everything installed.
I can create a local database with Sql Server Compact and Windows authentication just fine. Now I'm a little perplexed, because I still have no idea how all of this works. I didn't use any connection strings, passwords or anything. While coding, I can clearly see that the DataContext class in C# when using LINQ to SQL needs a connection string. How can I test this on my own pc? Is it unreasonable that I want to test this kind of stuff throughly while not currently having hosted services on the Internet yet? And often times, I don't have so much access to the server when using shared hosting, so I can't learn very fast and not fully.
When trying to connect to different services through SQL management studio and Windows authentication and my local pc, I just get a connection error.
Error Number: 2
Severity: 20
State: 0
I don't think that the database engine is the appropiate service to connect to anyway based on what I read, I just thought that you would like to know what I tried.
I checked, and sqlservr.exe is running in the processes in the task manager. Also SQL Server VSS writer.
Basically, I would like to learn how SQl Server databases work. The books, wikipedia and msdn on this topic just enumerate a lot of cryptic services like the database engine, analytical services etc...
I can't find any basic information on how to actally create, connect and program with a real database on my own pc. I'm not even sure whether I'm supposed to work like this?
I read that Sql server compact only supports databases up to 2mb.
Is it not possible for me to work with "the real thing" on my local pc?
I'm very very new to all this, and I'm not getting anywhere with databases...
Thanks for any help!
See: no option for a full sql database.
Server seems to run, but why does it say Server express? I'm sure I have the full one.
Installing Visual Studio generally installs a SQL Server instance on your local machine.
It is acceptable to work with "the real thing" on localhost, since when changing server, only the connection string has to change.
You will have to install the right version of SQL Server Management Studio Express (SSMSE) for your version of SQL Server so that you can start it, authenticate and work with SQL Server.
You may also connect to your SQL Server using the Server Explorer windows from within Visual Studio. Menu View|Server Explorer, or else [CTRL]+[W], [L] to view it. Then, you may connect to a data server from this window using the connection buttons on top of it.
Click View|Server Explorer, to view it;
Server Explorer, click "Connect" button located on top;
Choose a data source dialog, Data Source, click Microsoft SQL Server;
Data Provider, select .NET Framework Data Provider for SQL Server, click [Continue];
Add a connection dialog, Server name, select the server you want to connect to (your [local machine name]\SQLEXPRESS might appear, or something alike);
Server connection, choose Windows Authentication;
Database connection, select the database you want to connect to, and click [Test Connection];
If the test succeeds, click [OK], and you're done!
Disclaimer
The names of menus or window title may differ a bit, but you should get it done anyway. That is because I have off my head translated from French to English what it actually says in French, working with a French Visual Studio.
EDIT #1
After having taken an eye out your screenshot, I would simply say that you only have to select Database Engine to connect to your SQL Server instance, by selecting the right server on which you wish to work.
The full database option you're looking for is Database Engine which designates a full SQL Server.
The others are for the different services such as:
SQL Server Reporting Services (SSRS);
SQL Server Integration Services (SSIS);
SQL Server Analysis Services (SSAS).
Feel free to ask further assistance as needed. =)
How can I make a program use a SQL Server database, and have that program work on whatever computer it's installed on.
If you've been following my string of questions today, you'd know that I'm making an open source and free Help Desk suite for small and medium businesses.
The client application.
The client application is a Windows Forms app. On installation and first launch on every client machine, it'll ask for the address of the main Help Desk server.
The server.
Here I plan to handle all incoming help requests, show them to the IT guys, and provide WCF services for the Client application to consume.
My dilemma lies in that, I know how to make the program run on my local machine; but I'm really stumped on how to make this work for everyone who wants to download and install the server bit on their Windows Server.
Would I have to make an SQL Script and have it run on the MS SQL server when a user wants to install the 'server' application?
Many thanks to all for your valuable time and effort to teach me. It's really really appreciated. :)
Edit:
To clarify, each business will have their server completely separate from me. I will have no access whatsoever to them nor will they be in any way connected to me. (I don't know why I should clarify this :P )
So, assuming the have ABSOLUTELY NO DATABASE SERVER installed; what can I do?
Ok, part of the answer, dealing with the SQL Server Database (and frankly SQL Server Express will take you a long way - 4Gb of data) and the server install elements.
Firstly make installation of the SQL an SEP, make it a pre-requisite possibly tweak your installers to test (challenging) but substantially point them at the links to SQL Server express and let them get on with it).
Secondly separate installers, as suggested, for your client and your server elements.
Finally, how to build the database - I'd suggest using code to create and maintain (update) the schema i.e. once you have a connection to a server you can run code that calls DDL that does what is necessary (something like suggested here: How to create "embedded" SQL 2008 database file if it doesn't exist?)
A question - are you intending all communications from the clients to go through you WCF service?
Your install application should:
Obtain a SQL Server name, a username (with apprpriate rights to create a database) and password.
Either run SQL scripts using the locally installed command line tool or from code using SMO (for instance), against the user supplied server with the supplied credentials.
BTW, Before you expend effort writing an open-source help desk, have you checked what is already available? Also, Open Source Helpdesk
It is not so straightforward to deploy a client/server solution with an automatic installation.
You probably would then be better off to deploy your server installation together with a database engine and a skeleton database already setup according to your wishes. This is to avoid tampering too much with the existing server - who knows whats on it.
Also you say you want to install WCF services, well this would probably mean installing them on a customer server, in theory this shouldn't be a problem however in reality it could be, depending on what is previously on the server.
Do you want a single SQL Server instance running on your machine, or one on each of your customers' servers? If it's the latter, you'll want to install a SQL Server instance - anything from the (free, but limited and not open-source) SQL Server Express to a more expensive SKU - on each server. You can include this step in your server installation package; MSI installs make it very easy to bundle a MSSQL install.
Then you'll need to drop a schema, and maybe data, on the instance. You could do this as a step in your installer, or as part of your application setup process. It possible that a SQL Server instance, or more than one, might already be installed on the server, and your post-install step should allow the user to specify which instance on which to install your pieces.
Then, include a database configuration piece in your client application. Ask the user - or take from a configuration file at client install time, to allow for unattended or unprompted client installs - server connection details, like server name and authentication information.
A word on authentication - since you appear to be building Windows-based tools, use Windows integrated (domain-managed) authentication if at all possible. Don't get in the business of storing logins, but instead rely on the existing domain to manage logins. A good strategy is to use active directory groups to manage access. Grant access to a particular group in SQL Server, and defer group membership to Active Directory itself. If you can't gain the access necessary to do this, then grant permissions to AD user accounts themselves. Avoid creating SQL Server logins, the use of which open the door to some possible security problems.
I understand what you are trying to do. If I were you, I'd do the following:
Provide 2 downloads - 1 for client and 1 for server.
Forget about MS SQL Server and perhaps go with MySQL, since it really is open source. You could probably get away with using MS SQL Server Express Edition, but if your data set gets gigantic large (which is common with help desk databases), you'd be stuck.
As other people pointed out, on very first run (or at setup time), I'd have the client app locate the server.