Wrox Programmer Forums
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 2nd, 2004, 11:17 AM
Authorized User
 
Join Date: Aug 2004
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default server side data access

Hi - can anyone help,

Ive tried this example from microsoft quickstart tutorial and copied the code exactly (changing variables, db where necessary):

http://samples.gotdotnet.com/quickst.../datagrid1.src

When I build it in VisualStudio.net - there are no build errors and when it is run in a browser I can only see the title: 'Simple Select to a DataGrid Control', with no datagrid. Because there are no visible errors, im not sure what is happening - please help! why cant i see the datagrid with the data from my sql database???

Thanks-
rizp
 
Old September 2nd, 2004, 11:37 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 540
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Change this line:

AutoEventWireup="false"

to

AutoEventWireup="true"

in your Page Directive.

J
 
Old September 2nd, 2004, 04:37 PM
Authorized User
 
Join Date: Aug 2004
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi -

This worked i think, although its uncovered more error that i cant work out for the life of me! the error that i get is:

 'SQL Server does not exist or access denied', on line 13 MyConnection.Open(). The SQL Server is open, i checked several times and the server is working fine too. I also have access rights since im the admin of the system. Any ideas anyone???

By the way, what is AutoEventWireup and why did you set it to true? Does this need to be the case all the time?

thanks - rizp
 
Old September 2nd, 2004, 04:54 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 540
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Did you change this line:

MyConnection = New SqlConnection("server=(local)\NetSDK;database=pubs ;Trusted_Connection=yes")

to this:

MyConnection = New SqlConnection("server=(local);database=pubs;Truste d_Connection=yes")

--------------------------------------

No, you don't always have to use it. I almost never use it. I put all of my code in a codebehind file. Here is an article from Microsoft on AutoEventWireup:

http://support.microsoft.com/default...en-us%3B317690

J
 
Old September 2nd, 2004, 05:26 PM
Authorized User
 
Join Date: Aug 2004
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks for that -
although it now states: Login failed for user 'rizp\ASPNET'.

Error is still at Connection.Open() and the exception details are: System.Data.SqlClient.SqlException: Login failed (as above)

Why would this happen if im using windows integrated security - i thought that SQL server simply uses those login details instead??

Any more ideas??

rizp
 
Old September 2nd, 2004, 08:23 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 540
Thanks: 0
Thanked 4 Times in 4 Posts
Default

I believe there are at least a couple ways of doing this. You can add the ASPNET account to the database and give it access.

Or you can modify the web.config file and set authentication mode to windows and identity impersonate to true by adding:

<authentication mode="windows" />
<identity impersonate="true" />

You will probably also want to add:

<deny users="?" />

under the "authorization" section.

On a side note, this particular topic has been covered numerous times and I am sure you could find a full white paper on this very subject if you Googled...

J
 
Old September 3rd, 2004, 05:41 AM
Authorized User
 
Join Date: Aug 2004
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi -

this does not make any differnece (for the second solution) to the error message received. however, can you expand a bit more on how i can go about the first solution please??

rizp
 
Old September 3rd, 2004, 07:30 AM
Authorized User
 
Join Date: Aug 2004
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi

It sok, i finally got it - i found the answer here:

http://aspnet101.com/aspnet101/tutorials.aspx?id=23

i had to congigure IIS properties.

Thanks just the same-
rizp
 
Old September 3rd, 2004, 08:11 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 540
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Glad I could help.

J





Similar Threads
Thread Thread Starter Forum Replies Last Post
callback data to server side code aranjan ASP.NET 2.0 Basics 1 September 4th, 2007 06:39 AM
Server Side Data Passing AgentSmith ASP.NET 1.0 and 1.1 Professional 1 July 11th, 2006 05:03 PM
Retrival of Server Side DateTime with ACCESS dubey.kuldeep Access 2 November 1st, 2005 12:37 PM
server side data access rizp ASP.NET 1.0 and 1.1 Basics 3 September 6th, 2004 12:41 PM
Accessing Server Side Data on Client Side steve456 Classic ASP Professional 3 October 15th, 2003 02:33 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.