VS.net and SQL

Ewiz

New member
Joined
May 29, 2003
Messages
3
Hello,

Well, just purchased a copy of Visual Studio.net and I was going through some of the tutorials. And from what I see It looks like I have to have SQL server if Im going to be using a database.

Q. Do I need SQL so I can develop a database web sites or can I get around by building a database with out SQL? (this is a home PC Im working from w/XP)

Also..
What
 
Hi.

Well, just purchased a copy of Visual Studio.net and I was going through some of the tutorials. And from what I see It looks like I have to have SQL server if Im going to be using a database.
Enterprise comes with SQL Server, Professional comes with MSDE (basically a smaller version of SQL Servers that runs on your workstation), Im not sure about Standard.

Q. Do I need SQL so I can develop a database web sites or can I get around by building a database with out SQL? (this is a home PC Im working from w/XP)
If your database isnt going to be too large then Access is a perfectly viable solution. Although personally Id try and use either MSDE or SQL Server.

 
SQL and client

Hey,
I was able to install MSDE SQL server on my station. At the moment Im having the bigest problem trying to conect a client station to the workstation that has SQL. I keep getting errors when trying to conect. I have looked as much info. at the microsoft website for help but It looks like I have done everything I can.
Can some one tell me whats a good book to buy regarding this information or a website that explains All the requirements I need to run VB.net. And in shows you the proccess on how to configure you station before getting into Visual Studio?

At the moment I have a Workstation w/XP runnning IIS and SQL, then I have my other workstaion(client) which is runing VB.net to do the programing. I just need some help on how to configure my stations with SQL. (yes, they are in the network and talking to each other)
 
Im sure we could help if you show us the error message and what connection string youre using to connect to the database.
 
the problem

OK,
I have installed MSSQL on one computer. Im using VB.net on the other computer. When I make a form and try to add a sql or OleDbDataAdapter extention from the data tool bar I get the Data Adapter Configuration wizzard. When I click on new connection I get the Data Link Properties window. This is ware I try to input the information from my other computer. And when I do so. I get the following error:
"connection Faild:
SQLState: 4200
SQL Error: 18456
Login failed for user Erick"

OK, I have doble checked to make sure thats the right user on my mssql system. I have looked at micrososft website and made changes to the services and Local settings...but still nothing.

The other Problem I see in the MSSQL station is that I can not run MSSQL server as a User login because Ill get the same error. I need to run MSSQL as a Local User so in can work. (Im sure that this is the problem, It looks like I need a FULL vesion of SQL runnnig so MSSQL can login as a network user.)

Let me know what find out regarthing this matter.
Thanks a Million.
 
Lets try this;

- Open Server Explorer
- Right click on Data Connections
- Click add connection
- In step 1 "select or enter a server name" box, type in IP address (or name should work if its networked) of location where MSDE resides. Since you are networked you may be able to select your server from the drop down list.
- In step 2 click Used Windows Integrated Security
- Step 3 type the name of the database youre trying to access or pick from the drop down list if it allows you to
- Click test connection to make sure the connectoin works

If you get some error it might be because 1) You specified the wrong server or 2) Your windows login does not have access to MSDE

I cant help you with 1), but for 2) you can go through the OSQL utility to add MSDE access for windows users. Youll also need to do this for individual databases and set the users as dbo role so they can actually access and change the info on it.

For basic information on OSQL and how to add users etc.. go to
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q325003

Heres a copy/paste of the section youre most likely to be interested in;

"A user cannot connect to SQL Server without providing a valid login id. The sp_grantlogin stored procedure is used to authorize a Microsoft Windows network account (either a group or a user account) for use as a SQL Server login for connecting to an instance of SQL Server by using Windows Authentication. The following example permits a Windows NT user named Corporate\Test to connect to a SQL Server instance:

EXEC sp_grantlogin Corporate\Test

Only members of the sysadmin or the securityadmin fixed server roles can run the sp_grantlogin stored procedure. For more information about roles, see the "Roles, SQL Server Architecture" topic in SQL Server Books Online.

For more information about the sp_grantlogin stored procedure, see the "sp_grantlogin, Transact-SQL Reference" topic in SQL Server Books Online. "

"After a users connects to an instance of SQL Server, they cannot perform activities in a database until the dbo grants them access to the database. You can use the sp_grantdbaccess stored procedure to add a security account for a new user to the current database. The following example adds an account for a Microsoft Windows NT user named Corporate\BobJ to the current database and names it "Bob":

EXEC sp_grantdbaccess Corporate\BobJ, Bob

The sp_adduser stored procedure performs the same function as the sp_grantdbaccess stored procedure. Because, the sp_adduser stored procedure is included for backward compatibility, Microsoft recommends that you use the sp_grantdbacess stored procedure.

Only members of the sysadmin fixed server role, the db_accessadmin and the db_owner fixed database roles can run the sp_grantdbaccess stored procedure. For more information about the sp_grantdbaccess stored procedure, see the "sp_grantdbaccess, Transact-SQL Reference" topic in SQL Server Books Online. "

Post back here if you continue to have problems and well see if we cant figure it out.

EDIT:
I forgot to mention.. use the Sql classes (rather then OleDb) when using MSDE, that way when its time to migrate to SQL Server your program will be 100% compatible with it and you wont have to change a single line of code. Not to mention the Sql classes are far more efficient and faster then OleDb ones as they were built specifically for SQL Server and MSDE.
 
Last edited by a moderator:
Hi Ewiz,

If you are using the SP3a version of msde,

http://www.microsoft.com/downloads/...2C-0488-4E46-AFBF-ACACE5369FA3&displaylang=en

Then you can use the option
DISABLENETWORKPROTOCOLS=0

when you install to allow other machines to connect. Beginning with this version (I think) the default is to install without the Net-Libraries, unless you include this option on the installation command line ie

setup.exe DISABLENETWORKPROTOCOLS=0 SAPWD="somepwd" SECURITYMODE=SQL

Hope this helps,
Bruce
 
Back
Top