473,699 Members | 2,384 Online
Bytes | Software Development & Data Engineering Community
+ 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_conne ction=true; database='WebMa trix'" )

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="Syst em.Data" %>
<%@ import Namespace="Syst em.Data.SqlClie nt" %>
<script runat="server">

sub Page_Load
dim myConnection as SqlConnection
dim myCommand as SqlCommand
myConnection = New SqlConnection(
"Server='abit64 ';trusted_conne ction=true; database='WebMa trix'" )
myCommand = New SqlCommand( "Select * from Guestbook",
myConnection )
myConnection.Op en( )
myDataGrid.Data Source = myCommand.Execu teReader( )
myDataGrid.Data Bind( )
myConnection.Cl ose( )
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 1868
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_conne ction=true; database='WebMa trix'" )

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="Syst em.Data" %>
<%@ import Namespace="Syst em.Data.SqlClie nt" %>
<script runat="server">

sub Page_Load
dim myConnection as SqlConnection
dim myCommand as SqlCommand
myConnection = New SqlConnection(
"Server='abit64 ';trusted_conne ction=true; database='WebMa trix'" )
myCommand = New SqlCommand( "Select * from Guestbook",
myConnection )
myConnection.Op en( )
myDataGrid.Data Source = myCommand.Execu teReader( )
myDataGrid.Data Bind( )
myConnection.Cl ose( )
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_addrolemembe r '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
4256
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 SqlConnection(SomeConnectionString);
12
2409
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 Visual Basic Projects folder. When I select the ASP.Net Application icon and type in http://localhost/MyWebCalculator, I recieve an error in a dialogue box stating: MS Development Environment Dialogue Box error message:
2
2293
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 are hosted by a third party (on separate servers). Since debug mode opens IE and loads my page from localhost, since the database is located at a web URL, and since my development machine has an always-on DSL connection, I'm hoping there's a way...
15
43589
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 user 'root'@'localhost' (using password: YES)' $ mysqladmin --no-defaults -u root ver mysqladmin: connect to server at 'localhost' failed
7
161303
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... ########################################### package MySQL-client-5.0.24a-0.glibc23 is already installed package MySQL-server-5.0.24a-0.glibc23 is already installed
2
3404
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 to run fine until just a couple of weeks ago. Now new builds give the error when the code hits: SqlConnection cn = new SqlConnection(); The error is: System.TypeInitializationException: The type initializer for...
5
3423
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 write Pooling=true ? 2. What is the default Max Pool size ? After I open the connection, how can I check what is the max pool size ? 3. I always open the db right before I fill dataset or open a reader, then close it right away, but sometimes I...
6
7974
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 "include not found", rather much of the page is blank where the included menus, etc would be, and the CSS is not attached. thanks so much!!! My httpd.conf looks like this:
20
6739
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 xxx = new localhost.Service1(); localhost is not recognized by the compiler.
0
8685
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8613
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9172
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9032
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8880
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6532
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4374
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3054
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.