Problem with Stratframe ASP.Net Web Example


Author
Message
John Davies
John Davies
StrataFrame Beginner (13 reputation)StrataFrame Beginner (13 reputation)StrataFrame Beginner (13 reputation)StrataFrame Beginner (13 reputation)StrataFrame Beginner (13 reputation)StrataFrame Beginner (13 reputation)StrataFrame Beginner (13 reputation)StrataFrame Beginner (13 reputation)StrataFrame Beginner (13 reputation)
Group: Forum Members
Posts: 13, Visits: 136
Hi,

I wonder if you can help ... I was working through your Web sample ... and now I keep getting the error below when I click on a page that access the Strataframe database, Remote connections are enabled.  Can you help ?  I have SQL 2000 installed and SQL Express.  In my global asax file I added the connection string

DataLayer.DataSources.Add(new SqlDataSourceItem("", "Server = ./SqlExpress;Database=StrataFrameSample;Integrated Security=SSPI"));

.... although I don't believe I need it.  I have also successfully connected to the database using the Database connection Tool.

Error
An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

Source Error:

Line 127:Line 128://-- Execute the commandLine 129:Customers.FillDataTable(loCommand);Line 130:Line 131://-- Stop the watch


Source File: e:\Program Files\MicroFour\StrataFrame\CSharp Samples\Web Sample\SearchCustomers.aspx.cs    Line: 129

Stack Trace:

[SqlException (0x80131904): An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)] 


Replies
John Davies
John Davies
StrataFrame Beginner (13 reputation)StrataFrame Beginner (13 reputation)StrataFrame Beginner (13 reputation)StrataFrame Beginner (13 reputation)StrataFrame Beginner (13 reputation)StrataFrame Beginner (13 reputation)StrataFrame Beginner (13 reputation)StrataFrame Beginner (13 reputation)StrataFrame Beginner (13 reputation)
Group: Forum Members
Posts: 13, Visits: 136
Hi Trent,

First, thanks for your promt reply.  I changed the DSN as you suggested using Localhost and putting in my SQL 2005 credentials.  Now the search customers form work ok. 

I am a newby to this and I have a couple of questions based on your points. 

1) I am now using an SQL log In rather than windows.  Is this the distinction you were making when you refered to TCP/IP connection versus Named pipes ? 

2) This might be a silly question but I thought that it was better to use Windows authentication or is this only for forms access.

3)  In the mean while I have a similar set up on my laptop where I am using XP Professional.  After the problem I had I went downstairs used my Laptop and realised it was probably on my laptop that I had seen the customer search working.  I checked the global.asax file and noted I had not set up a connection string yet it appeared to be working ok.  I am sure I read somewhere that the controls can use a default value for the connection string.  Is this probably the case ?  where did I set this default ?

4)  In both my set-ups the Search Customer form now works ok.  But, when I perform an edit of the data and try and save the edit I get the error below.  I noted in the design view of the form WebBindingSource.aspx the grid view has an error

"There was an error rendering the control".

"The data source does not support server-side data paging.

I'm not sure they are related ... can you suggest what I'm doing wrong ? 

Thanks in advance.

jd

Page error after edit

The business object 'Customers' could not be found on this page.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: The business object 'Customers' could not be found on this page.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[InvalidOperationException: The business object 'Customers' could not be found on this page.]

StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
1) I am now using an SQL log In rather than windows.  Is this the distinction you were making when you refered to TCP/IP connection versus Named pipes ?

Nope, connecting through Named Pipes means that a the application connects to SQL Server through memory, while a TCP/IP connection connects accross the network stack.  TCP/IP communication is disabled by default on SQL Server Express; you have to explicitly turn it on or you can only connect to the SQL Server from the machine where it's installed.

2) This might be a silly question but I thought that it was better to use Windows authentication or is this only for forms access.

With StrataFrame, there's no advantage either way.  But, with an SF WebForms application, the connection is shared across the entire AppDomain running the ASPX pages, meaning the IIS Hosting process shares the connection for all users that connect to the server.  If you use Windows authentication in a SF WebForms environment, you won't be able to consistently control the user under which the connections are opened since the user's credentials are not passed through to the connection.  So, you'll have to implement security in some other way besides using SQL Server security only.

3)  In the mean while I have a similar set up on my laptop where I am using XP Professional.  After the problem I had I went downstairs used my Laptop and realised it was probably on my laptop that I had seen the customer search working.  I checked the global.asax file and noted I had not set up a connection string yet it appeared to be working ok.  I am sure I read somewhere that the controls can use a default value for the connection string.  Is this probably the case ?  where did I set this default ?

The default is set through the global.asax file.  You specify the connection string when the DataBasics.DataSources.Add(new SqlDataSourceItem("", "conn string")); is called.  That connection string there is the one used by the data source.

4)  In both my set-ups the Search Customer form now works ok.  But, when I perform an edit of the data and try and save the edit I get the error below.  I noted in the design view of the form WebBindingSource.aspx the grid view has an error

"There was an error rendering the control".

"The data source does not support server-side data paging.

I'm not sure they are related ... can you suggest what I'm doing wrong ?

The WebBindingSource always displays that error at design-time, although the control itself does support paging.  So, the error you are receiving at runtime is independent of the error you're receiving at design-time (which can be ignored).  What's the error you're getting at runtime?

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
John Davies - 17 Years Ago
Ivan George Borges - 17 Years Ago
Trent L. Taylor - 17 Years Ago
John Davies - 17 Years Ago
StrataFrame Team - 17 Years Ago
John Davies - 17 Years Ago
Trent L. Taylor - 17 Years Ago
John Davies - 17 Years Ago
Trent L. Taylor - 17 Years Ago
John Davies - 17 Years Ago
Trent L. Taylor - 17 Years Ago
John Davies - 17 Years Ago
John Davies - 17 Years Ago
Trent L. Taylor - 17 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search