How to make installer of VB.NET including SQL Server 2000?

45 pts.
Tags:
Database connectivity
Microsoft SQL Server 2000
Setup and deployment
VB Setup File
VB.NET
Visual Basic
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.

Answer Wiki

Thanks. We'll let you know when a new response is added.

Is SQL Server already installed? What is in the connection string when you are trying to connect?

this is my connect function to connect with database, I think there is problem with this coding. Please can you help.

Public Sub connect()
sconn = "Data Source=SUJAL;Initial Catalog=staff;User ID=sa;Password=longtail"

scon = New SqlClient.SqlConnection(sconn)
scond = New SqlClient.SqlCommand
sqf = New SqlClient.SqlParameter
'sdr = SqlClient.SqlDataReader
If scon.State <> ConnectionState.Open Then
scon.Open()
'MessageBox.Show(scon.State)

End If
End Sub

Discuss This Question: 4  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Denny Cherry
    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.
    66,125 pointsBadges:
    report
  • Rebi977
    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
    45 pointsBadges:
    report
  • Rebi977
    Hi Denny, Please reply to my question becoz I am in big trouble thanks in advance
    45 pointsBadges:
    report
  • Denny Cherry
    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.
    66,125 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following