I had done my project in vb.net with sql server 2000 but it's installer doesn't work properly as it displays the message unexcepted error while connecting to the database.I know setup and deployment in vb.net but doesn't working please help me.I am stuck in here.thanks in advance.
Software/Hardware used:
ASKED:
February 3, 2009 11:32 AM
UPDATED:
February 10, 2009 6:03 AM
Is the client computer able to connect to the SQL Server outside of your application?
You really shouldn’t use the sa account to connect to the SQL Server. It’s a security risk.
Dear Denny ,
I am new to vb.net , I have just started the vb.net and now I have to create an installer. But how can I do that so that it would be install in any computer without any problem even in those computers which doesn’t have .net framework. I am really in trouble, Actually the connection between the database and application cann’t be established after installation in any computer. And if I should not use sa then wht could be appropriate. Plz do write to me every step by step. Thankyou
Hi Denny,
Please reply to my question becoz I am in big trouble
thanks in advance
Someone with more experience with .NET will need to address the question about putting the .NET installer in your package.
If your workstations are even close to fully patched then the .NET framework will already be installed on the machine.
As for the connection string problem no workstations can connect to the server, then you either have something wrong with the connection string, there is a firewall blocking access to the server from the workstations, or SQL Server isn’t configured to listen for remote connections (as this is SQL 2000 that probably isn’t it).
This FAQ that I wrote should be able to help you figure out what the connection problem is.
As for not using the SA account you should create an account on the SQL Server specifically for this application to use, and only grant that login the minimum set of permissions needed to function. Otherwise you will be opening your database server up for attack by the people that use the application.
I’ll refer you to my blog post on Logins and Users for some general information about the two. You can look in Books OnLine (the SQL Server Help docs) on the steps to create a new login on the SQL Server. The basic jist is connect to the server in Enterprise Manager, then open the Security folder. In there you can create a new login, and map it to your database named “staff”. Create a role within the staff database which has the rights needed for your application to run, and put the user within the staff database into that role.
If you are in a hurry (which it appears that you are) add the user to the dbo role which will give it access to everything, but be sure to correct the permissions otherwise your users will still have the ability to delete all the data in your database.