473,406 Members | 2,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

HELP, The connection string does not work

i am trying to connect to my Sqlserver on my machine.
i tried using the following connection strings

1)

mystring= "Initial Catalog=[SmartLan 2.0 ED];Data
Source=localhost;Integrated Security=SSPI;UID='sa';PWD="
myConn = New SqlConnection(mystring)
myCommand.Connection = myConn
myConn.Open()
myCommand.CommandText = "Select * from agegender"
myCommand.ExecuteXmlReader()

when i execute the connection it says login failed for
'L20935-P3\ASPNET',but i am sure the password is right, i have
verified the password works

i then tried the other option

2)
mystring= "database=[SmartLan 2.0 ED];data source=localhost;user
id=sa;password=;"
..
..
..
when i execute the connection it says login failed for
'L20935-P3\ASPNET' for user sa

i dont know whats going on???
can anyone please help me !!!!!!!!!!!!
Nov 18 '05 #1
1 1252
Hi Lloyd,

It looks like you're mixing and matching portions of the connection string
in a way that doesn't work.

You're trying to use both integrated security and the userID/password
method.
"lloyd" <ll***********@rediffmail.com> wrote in message
news:e7**************************@posting.google.c om...
i am trying to connect to my Sqlserver on my machine.
i tried using the following connection strings

1)

mystring= "Initial Catalog=[SmartLan 2.0 ED];Data
Source=localhost;Integrated Security=SSPI;UID='sa';PWD="
myConn = New SqlConnection(mystring)
myCommand.Connection = myConn
myConn.Open()
myCommand.CommandText = "Select * from agegender"
myCommand.ExecuteXmlReader()

when i execute the connection it says login failed for
'L20935-P3\ASPNET',but i am sure the password is right, i have
verified the password works

i then tried the other option

2)
mystring= "database=[SmartLan 2.0 ED];data source=localhost;user
id=sa;password=;"
.
.
.
when i execute the connection it says login failed for
'L20935-P3\ASPNET' for user sa

i dont know whats going on???
can anyone please help me !!!!!!!!!!!!


Nov 18 '05 #2

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

Similar topics

8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
12
by: Bill | last post by:
When I compile the following code fragment, the compiler errors saying the variable connection is not initialized. As I understand C#, I thought it would be initialized. Please help me and explain...
15
by: DavidS | last post by:
Have Visual Studio.NET installed on MS 2000 Professional OS laptop. No issue ever with web development and SQL connections. Purchased new laptop with XP Professional SP2!!!!!!!! & Visual...
4
by: Kimon Ifantidis | last post by:
Vey simple, but does not work: I'm trying to set a data-driven Web page with a GridView control. The steps I followed are: 1. Created a data connection using Database Explorer. 2. Dropped an...
8
by: Greg Strong | last post by:
Hello All, The short questions are 1 Do you know how to make DSN connection close in Access to Oracle 10g Express Edition? &/or 2 Do you know how to make a DSN-less pass-through query...
7
by: Siv | last post by:
Hi, I have a stored procedure that I want to execute and then wait in a loop showing a timer whilst it completes and then carry on once I get notification that it has completed. The main reason...
14
by: Marcus | last post by:
I have a function that simply returns TRUE if it can connect to a particular Sql Server 2005 express, or FALSE if it cannot. I am getting some strange error codes returned when the computer that...
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
4
by: Brad Isaacs | last post by:
I am working with ASP.NET 2.0 and using an SQL Server 2000 database. I am using Visual Studio 2005 and developing on my Local machine. I am working with Login controls ASP.Configuration, I...
1
by: =?ISO-8859-1?Q?Lasse_V=E5gs=E6ther_Karlsen?= | last post by:
I get the above error in some of the ASP.NET web applications on a server, and I need some help figuring out how to deal with it. This is a rather long post, and I hope I have enough details that...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
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,...
0
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
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...

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.