I've been trying for two days to get some test .ASPX scripts to run using ADO.NET objects. I've tried several different methods (found in several different tutorials) but nothing seems to work. For example, here is some code that, according to most of the information I've found, should work just fine:<BR><BR><%@ Page Language="vb" Debug="true" %><BR><%@ Import Namespace="System.Data" %><BR><%@ Import Namespace="System.Data.ADO" %><BR><script language="vb" runat="server"><BR> sub Page_Load(Src as Object, E as EventArgs)<BR> dim oDS as DataSet<BR> dim oConn as ADOConnection<BR> dim oCmd as ADODataSetCommand<BR> dim sConn as string<BR> dim sQuery as string<BR> <BR> sConn = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=MyDatabase;Data Source=MyServer"<BR> sQuery = "select top 10 * from Parcel"<BR> oConn = new ADOConnection(sConn)<BR> oCmd = new ADODataSetCommand(sQuery, oConn)<BR> oDS = new DataSet()<BR> oCmd.FillDataSet(oDS, "Parcel")<BR><BR> dgGrid.DataSource = oDS.Tables("Parcel IDs").DefaultView<BR> dgGrid.DataBind<BR> end sub<BR></script><BR><html><BR><head><BR> <title>DataGrid Test</title><BR></head><BR><body><BR><table border="0" cellspacing="0" cellpadding="0" align="center"><BR><tr><BR> <td><BR> <font face="arial" size="2"><BR> <asp:datagrid id="dgGrid" runat="server"<BR> width="100%"<BR> backcolor="#ffffff"<BR> bordercolor="#000000"<BR> showfooter="false"<BR> cellpadding="3"<BR> cellspacing="0"<BR> font-name="verdana"<BR> font-size="8pt"<BR> headerstyle-backcolor="lightblue"<BR> headerstyle-font-size="10pt"<BR> headerstyle-font-style="bold"<BR> maintainstate="false"<BR> /><BR> </font><BR> </td><BR></tr><BR></table><BR></body><BR></html><BR><BR>(NOTE: I have changed the connection string here so as not to send you the real DB and Server names.) <BR><BR>Now, the connection string I use here is the same one I use in other classic .ASP scripts that work just fine. However, when attempting this in an .ASPX script, errors are thrown telling me: Login failed for user 'NT AUTHORITYANONYMOUS LOGON'. This doesn't happen to me when using classic .ASP scripts. I've tinkered around in IIS to try to solve the problem and tried different connection string configurations and tried using SQLConnection objects rather that ADOConnection objects - but all to no avail.<BR>Is there something wrong in the Beta1 release? Or am I doing something wrong? Is there a setting somewhere that needs to be modified? Please help me........<BR><BR> ~~ TonyIn your Connection String add:<BR><BR>"...; User ID=ValidUserName; Password=ValidPasswordForUser"<BR><BR>Does that do the trick?Unfortunately, when using ADO.NET, that does not do the trick. It works fine when I'm using good old classic ADO though.<BR><BR>Thanks,<BR><BR>~~ TonyOn an aside, have you considered using the SQLConnection object? It provides faster access when working with SQL Server.<BR><BR>For the SQLConnection, you can use a connection string like so:<BR>Dim myConnection as SQLConnection = new SQLConnection("server=localhost;uid=sa;pwd=;database=pubs")Yes, I've tried the SQLConnection object as well with the same results. I can't help thinking that something is wrong with my IIS (or virtual directory) settings - something to do with permissions. Although, I'm only having this problem using .NET. I'm baffled.Here's the situation:<BR><BR>I still can't get the dang thing to work! (refer to original entry)<BR><BR>I'm using "Basic Authentication" in IIS so I shouldn't have to include any kind of username or password in the connection string (again - this same connection string works fine for me in ASP, VB6, etc., just not in ASP.NET/ADO.NET).<BR><BR>In addition, I'm not trying to access a SQL Server on my local box - it's a remote server, an NT box (which doesn't have the .NET Framework installed on it, by the way).<BR><BR>Does anyone have any suggestions as to why this isn't working? Should I be using a different kind of authentication? Does .NET talk differently to SQL Server than classic ASP? Did I screw something up during the install of the Beta 1 .NET Framework? Does the box on which the SQL Server need to be a Windows2000 box or have the .NET Framework installed?<BR><BR>I just don't know why the same connection string works from ASP and not from ASP.NET.<BR><BR>Any help would be greatly appreciated. I'm starting to lose hair and sleep over this now - and what hairs aren't being lost are quickly turning gray.Scott,<BR><BR>Do you have any more suggestions? Or at least know where I can go to find out how to solve this problem?<BR><BR>Thank you,<BR><BR>~~ TonyThere is a highly focused listserv at:<BR>http://www.asplists.com/asplists/aspngdata.asp<BR><BR>This list looks at data-related issues with ASP.NET. Chances are someone there will be able to help.Thank you - I really appreciate your time and help. I'll give that site a try.<BR><BR>Thanks again,<BR><BR>~~ TonyIf anyone has read this and has been interested in the solution to this particular conundrum, I have found it.<BR><BR>A kind and helpful (not to mention very knowledgeable) gentleman from another forum informed me that all I needed to do was add the following code to my config.web file:<BR><BR>****************************************<BR><security><BR> <authentication mode="none" /><BR> <identity><BR> <impersonation enable="true"/><BR> </identity><BR> <authorization /><BR></security><BR>****************************************<BR><BR>I just needed to set "impersonation" to "true". I hope this is some help to anyone who might face a similar problem.<BR><BR>~~ TonyI thought the problem was solved and out of the way - and it is, if I only want to access my database from an ASPX page.<BR><BR>I'm finding now that when I try to access the db from a webservice, I get some of the same "Anonymous Access" errors. I also tried putting the connection string in my config.web file under "appsettings" and then access it at runtime using a HashTable object. This works beautifully from my ASPX page, but not from my webservice. In attempting this from the webservice, I get the following error message:<BR><BR>****************************<BR>System.InvalidCastException: The data value could not be converted for reasons other than sign mismatch or data overflow. For example, the data was corrupted in the data store but the row was still retrievable.<BR> at System.Data.ADO.DBBindings.get_ValueString()<BR> at System.Data.ADO.ADODataReader.GetString(Int32 ordinal)<BR> at DataAccess.GetXMLResultSet(String sConnStr, String sQueryStr) in C:TonyTestsdotNETwsDataAccessTest.asmx:line 88<BR> at DataAccess.ShowData(String ConnectionString, String SQLQuery) in C:TonyTestsdotNETwsDataAccessTest.asmx:line 51<BR>****************************<BR><BR>If I understand that message correctly, I'm getting logged in just fine, but something is wrong with the data in my resultset. Maybe I'm misinterpreting that though. Either way, it is yet another snag.<BR><BR>If anyone has any suggestions, I would love to hear them.<BR><BR>Thank you,<BR><BR>~~ TonyScratch what I just submitted!<BR><BR>I apologize - it turns out that I was doing something wrong with my DataReader object - the connection is working fine though.<BR><BR>I'm sorry for any inconvenience my previous entry may have caused anyone.<BR><BR>~~ Tony