By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,218 Members | 1,195 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,218 IT Pros & Developers. It's quick & easy.

sql 2005 connection issue

P: n/a
JD
Hello,

I am dealing with an issue, that although probably simple, is driving me
crazy. I am trying to connect to a SQL 2005 Express database through a web
service using the following code:

[WebMethod]
public XmlDocument GetAllAuthors()
{
XmlDocument doc = new XmlDocument();
DataSet prjDataSet = new DataSet("ProjectStatus");
using (SqlConnection conn = new
SqlConnection("server=UA13098;uid=user;pwd=pass;da tabase=forms;"))
{
SqlDataAdapter adapter = new SqlDataAdapter("Select
id,name,text, from prjstatus ", conn);
adapter.Fill(prjDataSet, "ProjectStatus");
}
doc.LoadXml(prjDataSet.GetXml());
return doc;
}

The problem is that I keep receiving an error that states: Login for 'user'
failed.....and it contains no further information. I can log into the SQL
console with the account just fine, and access the forms database. The
problem is only occurring when I try to access the database from the web
service.

Any suggestions are mosted appreciated.

Thanks
Oct 18 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Not sure if this is your problem but... With my set-up I can only have one
connection at a time. I find that if I leave VS server browser connected I
get the same message when trying to run the application in the dev
environment. To get around this I just make sure that I disconnect the
connection in the server view prior to running the app and this seems to
work fine.

--
RobP
'There are only 10 types of people in this world - Those that understand
binary and those that don't'

"JD" <je**@jditty.netwrote in message
news:W9******************************@wideopenwest .com...
Hello,

I am dealing with an issue, that although probably simple, is driving me
crazy. I am trying to connect to a SQL 2005 Express database through a
web service using the following code:

[WebMethod]
public XmlDocument GetAllAuthors()
{
XmlDocument doc = new XmlDocument();
DataSet prjDataSet = new DataSet("ProjectStatus");
using (SqlConnection conn = new

SqlConnection("server=UA13098;uid=user;pwd=pass;da tabase=forms;"))
{
SqlDataAdapter adapter = new SqlDataAdapter("Select
id,name,text, from prjstatus ", conn);
adapter.Fill(prjDataSet, "ProjectStatus");
}
doc.LoadXml(prjDataSet.GetXml());
return doc;
}

The problem is that I keep receiving an error that states: Login for
'user' failed.....and it contains no further information. I can log into
the SQL console with the account just fine, and access the forms database.
The problem is only occurring when I try to access the database from the
web service.

Any suggestions are mosted appreciated.

Thanks

Oct 18 '06 #2

P: n/a
JD
Rob,

Thanks for the reply....this is not my issue. When I receive the error, I
do not have any other connections present.

I assume that my error is at the database, and not the code...not sure
though.

JD

"Rob Pollard" <ro************@hotmail.comwrote in message
news:_q*******************@fe2.news.blueyonder.co. uk...
Not sure if this is your problem but... With my set-up I can only have one
connection at a time. I find that if I leave VS server browser connected I
get the same message when trying to run the application in the dev
environment. To get around this I just make sure that I disconnect the
connection in the server view prior to running the app and this seems to
work fine.

--
RobP
'There are only 10 types of people in this world - Those that understand
binary and those that don't'

"JD" <je**@jditty.netwrote in message
news:W9******************************@wideopenwest .com...
>Hello,

I am dealing with an issue, that although probably simple, is driving me
crazy. I am trying to connect to a SQL 2005 Express database through a
web service using the following code:

[WebMethod]
public XmlDocument GetAllAuthors()
{
XmlDocument doc = new XmlDocument();
DataSet prjDataSet = new DataSet("ProjectStatus");
using (SqlConnection conn = new

SqlConnection("server=UA13098;uid=user;pwd=pass;d atabase=forms;"))
{
SqlDataAdapter adapter = new SqlDataAdapter("Select
id,name,text, from prjstatus ", conn);
adapter.Fill(prjDataSet, "ProjectStatus");
}
doc.LoadXml(prjDataSet.GetXml());
return doc;
}

The problem is that I keep receiving an error that states: Login for
'user' failed.....and it contains no further information. I can log into
the SQL console with the account just fine, and access the forms
database. The problem is only occurring when I try to access the database
from the web service.

Any suggestions are mosted appreciated.

Thanks


Oct 18 '06 #3

P: n/a
You probably just need to enable it for remote connections. See here:

http://blogs.msdn.com/sqlexpress/arc...05/415084.aspx

Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"JD" wrote:
Hello,

I am dealing with an issue, that although probably simple, is driving me
crazy. I am trying to connect to a SQL 2005 Express database through a web
service using the following code:

[WebMethod]
public XmlDocument GetAllAuthors()
{
XmlDocument doc = new XmlDocument();
DataSet prjDataSet = new DataSet("ProjectStatus");
using (SqlConnection conn = new
SqlConnection("server=UA13098;uid=user;pwd=pass;da tabase=forms;"))
{
SqlDataAdapter adapter = new SqlDataAdapter("Select
id,name,text, from prjstatus ", conn);
adapter.Fill(prjDataSet, "ProjectStatus");
}
doc.LoadXml(prjDataSet.GetXml());
return doc;
}

The problem is that I keep receiving an error that states: Login for 'user'
failed.....and it contains no further information. I can log into the SQL
console with the account just fine, and access the forms database. The
problem is only occurring when I try to access the database from the web
service.

Any suggestions are mosted appreciated.

Thanks
Oct 18 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.