473,466 Members | 1,377 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

localhost SqlConnection error.

I have SqlServer loaded on my w2k system. The freeby I just downloaded
from MS.

Within WebMatrix I created a database. called it "WebMatrix"

In WebMatrix I connect to the database.
server: (local)
Windows authentication
Database: WebMatrix

all of my web matrix .aspx pages use the following connection string:
myConnection = New SqlConnection(
"Server='abit64';trusted_connection=true; database='WebMatrix'" )

The problem is when I use the IIS server on my w2k PC instead of web
matrix.
http://localhost/viewGuestBookGrid.aspx

I get the following error:

Server Error in '/' Application.
--------------------------------------------------------------------
Login failed for user 'ABIT64\ASPNET'.

The full page that fails follows. I am very confused.

How do I get into SQLServer and config user names and passwords? I
tried to use the system administrator login. no luck. Like I said
before, I have the freeby version that I downloaded from the WebMatrix
sit.

The basic question is why does my sql server connecting code work
using the WebMatrix server and not the IIS server?

thanks,

-Steve
<%@ Page Language="VB" %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.SqlClient" %>
<script runat="server">

sub Page_Load
dim myConnection as SqlConnection
dim myCommand as SqlCommand
myConnection = New SqlConnection(
"Server='abit64';trusted_connection=true; database='WebMatrix'" )
myCommand = New SqlCommand( "Select * from Guestbook",
myConnection )
myConnection.Open( )
myDataGrid.DataSource = myCommand.ExecuteReader( )
myDataGrid.DataBind( )
myConnection.Close( )
end Sub

</script>
<html>
<head>
<title>View the Guestbook</title>
</head>
<body>
<form runat="server">
<p>
<asp:DataGrid id="myDataGrid"
runat="server"></asp:DataGrid>
</p>
</form>
</body>
</html>

Nov 19 '05 #1
2 1860
Hi Stephen,
Check out this thread.
http://asp.net/Forums/ShowPost.aspx?...&PostID=268887
HTH
srini
"St************@gmail.com" wrote:
I have SqlServer loaded on my w2k system. The freeby I just downloaded
from MS.

Within WebMatrix I created a database. called it "WebMatrix"

In WebMatrix I connect to the database.
server: (local)
Windows authentication
Database: WebMatrix

all of my web matrix .aspx pages use the following connection string:
myConnection = New SqlConnection(
"Server='abit64';trusted_connection=true; database='WebMatrix'" )

The problem is when I use the IIS server on my w2k PC instead of web
matrix.
http://localhost/viewGuestBookGrid.aspx

I get the following error:

Server Error in '/' Application.
--------------------------------------------------------------------
Login failed for user 'ABIT64\ASPNET'.

The full page that fails follows. I am very confused.

How do I get into SQLServer and config user names and passwords? I
tried to use the system administrator login. no luck. Like I said
before, I have the freeby version that I downloaded from the WebMatrix
sit.

The basic question is why does my sql server connecting code work
using the WebMatrix server and not the IIS server?

thanks,

-Steve
<%@ Page Language="VB" %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.SqlClient" %>
<script runat="server">

sub Page_Load
dim myConnection as SqlConnection
dim myCommand as SqlCommand
myConnection = New SqlConnection(
"Server='abit64';trusted_connection=true; database='WebMatrix'" )
myCommand = New SqlCommand( "Select * from Guestbook",
myConnection )
myConnection.Open( )
myDataGrid.DataSource = myCommand.ExecuteReader( )
myDataGrid.DataBind( )
myConnection.Close( )
end Sub

</script>
<html>
<head>
<title>View the Guestbook</title>
</head>
<body>
<form runat="server">
<p>
<asp:DataGrid id="myDataGrid"
runat="server"></asp:DataGrid>
</p>
</form>
</body>
</html>

Nov 19 '05 #2

srini wrote:
Hi Stephen,
Check out this thread.
http://asp.net/Forums/ShowPost.aspx?...&PostID=268887
HTH
srini


that helped a lot, srini. thank you!

here are the config commands I had to run:
( WebMatrix is the name of my database. abit64 is the name of the
system. )

- run the osql utility to config sql server
- osql -E -S abit64
- this gives you the osql command prompt

- use WebMatrix
go

- sp_grantlogin 'abit64\aspnet'
go

- sp_grantaccess 'abit64\aspnet'
go

- sp_addrolemember 'db_owner', 'abit64\aspnet'
go

-Steve

Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: MuZZy | last post by:
Hi, Just wanted to make sure i get it right: consider this class: // =========== START CODE ============= class Test { private SqlConnection con = null; public void Connect() { con = new...
12
by: Luther Hert | last post by:
While trying to work through textbook lessons for Vb.net Step by Step,Version 2003, Chapter 22, the first step is to create a new Web application Project,using the ASP.Net Application icon in the...
2
by: Jeff | last post by:
Hi - I have an ASP.NET web page accessing a SQL database. It works fine on the web, and I'm trying to get it to also work in debug mode in the IDE. The "on the web" page and my SQL database...
15
by: rajbala | last post by:
hi all, I got the error like $ mysqladmin -h localhost -u root -p create bedrock Enter password: ****** mysqladmin: connect to server at 'localhost' failed error: 'Access denied for...
7
by: rajbala.3399 | last post by:
Hi , I want to download sql in my linux system........... # rpm -ivh MySQL-server-5.0.24a-0.glibc23.i386.rpm MySQL-cl ient-5.0.24a-0.glibc23.i386.rpm Preparing... ...
2
by: RvGrah | last post by:
My program is giving a strange exception at startup, only on client machines. Runs fine on development machine. The app was upgraded long ago from a 2003 version to a VS2005 version, but continued...
5
by: fniles | last post by:
I am using VB.NET 2003. When using SQLClient.SQLConnection with SQL 2005 database, 1. connection pooling is automatically used, right ? I mean, in the connection string I do not need to explicitly...
6
by: MaiyaHolliday | last post by:
Hello, I've recently installed apache on a new computer, and cannot figure out why my site will not process any includes. (it was working on my old one) There are no errors on the page such as...
20
by: =?Utf-8?B?cmtibmFpcg==?= | last post by:
I was executing the steps given in http://suppor.microsoft.com/kb/308359 for testing a sample web service application. However, the following line gives a compilation error: localhost.Service1...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.