Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > BOOK: Beginning ASP.NET 4 : in C# and VB
| Search | Today's Posts | Mark Forums Read
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB 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 July 29th, 2012, 12:30 PM
Friend of Wrox
Points: 1,469, Level: 15
Points: 1,469, Level: 15 Points: 1,469, Level: 15 Points: 1,469, Level: 15
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2009
Posts: 341
Thanks: 14
Thanked 3 Times in 3 Posts
Smile

Quote:
Fully working now!
HI jdlferreira,
can you please tell me what connection string you used for database and entity.
Please specify full connection string from <add name="ConnectionString" Data Source="" Provide="">

Just mark ***** for user id, password, database name, server but tell me the complete string.
Many thanks
 
Old July 29th, 2012, 04:21 PM
Authorized User
Points: 113, Level: 2
Points: 113, Level: 2 Points: 113, Level: 2 Points: 113, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2012
Posts: 27
Thanks: 3
Thanked 0 Times in 0 Posts
Default

Sure.

This is the database string given by my host:
Code:
workstation id=orangefresh.mssql.somee.com;packet size=4096;user id=****;pwd=****;data source=orangefresh.mssql.somee.com;persist security info=False;initial catalog=orangefresh
And here is the string for Entity:

Code:
metadata=res://*/App_Code.Orangefresh.csdl|res://*/App_Code.Orangefresh.ssdl|res://*/App_Code.Orangefresh.msl;provider=System.Data.SqlClient;provider connection string=&quot;workstation id=orangefresh.mssql.somee.com;packet size=4096;user id=****;pwd=****;data source=orangefresh.mssql.somee.com;persist security info=False;initial catalog=orangefresh&quot;
Notice that the database string goes inside the &quot; marks in the regular Entity string Visual Studio/Web Developer created in the web.config file.

Hope that helps.
 
Old July 30th, 2012, 11:17 AM
Friend of Wrox
Points: 1,469, Level: 15
Points: 1,469, Level: 15 Points: 1,469, Level: 15 Points: 1,469, Level: 15
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2009
Posts: 341
Thanks: 14
Thanked 3 Times in 3 Posts
Smile

Not working for me.
Production strings are working at my local site but when I try to use that string in production site, then it is giving me error.

"A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)"

I am getting this error only on production site, using same string (production) on local site works fine.
Can anyone please tell me what may be the issue?
 
Old July 30th, 2012, 01:28 PM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Could be a network setup issue where you production machine is not able to "see" itself over the public network using its public name. Your host / sys admin should be able to help you out with this.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old July 30th, 2012, 03:01 PM
Friend of Wrox
Points: 1,469, Level: 15
Points: 1,469, Level: 15 Points: 1,469, Level: 15 Points: 1,469, Level: 15
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2009
Posts: 341
Thanks: 14
Thanked 3 Times in 3 Posts
Smile

Quote:
Could be a network setup issue where you production machine is not able to "see" itself over the public network using its public name.
if this is the case,
1. then why it is giving the username availability message on signup page.(I have used web method to check for existing users)

2. and why it is working for jdlferreira?
 
Old July 30th, 2012, 03:06 PM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

>> then why it is giving the username availability message on signup page.(I have used web method to check for existing users)

Don't know what this is referring to.

>> and why it is working for jdlferreira?

Unless you're hosting on exactly the same machine, there could be millions of reasons. Each server can be configured differently, with many OS, software and network settings that could influence this.

How about posting your connection strings so we can take a look?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old July 31st, 2012, 11:04 AM
Friend of Wrox
Points: 1,469, Level: 15
Points: 1,469, Level: 15 Points: 1,469, Level: 15 Points: 1,469, Level: 15
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2009
Posts: 341
Thanks: 14
Thanked 3 Times in 3 Posts
Smile

uhhh
I thought it would be done but I am struggling..

Quote:
How about posting your connection strings so we can take a look?
I analyzed that simple database connection string is working but not the entity string. But I am posting both

Code:
<connectionStrings>
    <add name="ASPNETDBEntities" connectionString="metadata=res://*/App_Code.ProOnline.csdl|res://*/App_Code.ProOnline.ssdl|res://*/App_Code.ProOnline.msl;provider=System.Data.SqlClient;provider connection string=&quot;workstation id=PropOnline.mssql.somee.com;packet size=4096;user id=******;pwd=*******;data source=PropOnline.mssql.somee.com;persist security info=False;initial catalog=PropOnline;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />

<add name="ConnectionString" connectionString="workstation id=PropOnline.mssql.somee.com;packet size=4096;user id=******;pwd=******;data source=PropOnline.mssql.somee.com;persist security info=False;initial catalog=PropOnline" providerName="System.Data.SqlClient" />
  </connectionStrings>
Please address the issue...
 
Old August 2nd, 2012, 03:29 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Can't see anything wrong with this. Are you sure that a) this connection string is really used by EF at runtime and b) that EF is indeed causing the error? Maybe it's another connection string for other code that's causing the problem?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old August 2nd, 2012, 02:39 PM
Friend of Wrox
Points: 1,469, Level: 15
Points: 1,469, Level: 15 Points: 1,469, Level: 15 Points: 1,469, Level: 15
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2009
Posts: 341
Thanks: 14
Thanked 3 Times in 3 Posts
Smile

Quote:
Are you sure that a) this connection string is really used by EF at runtime and b) that EF is indeed causing the error? Maybe it's another connection string for other code that's causing the problem?
How I can check these things, I have no idea to test that.
If you don;t mind can you please take a look at site.

UserName: test
Password: test123#
site: welcome.somee.com

It logs in and logs out users it means normal connection string is working.
After having being logged in go to http://welcome.somee.com/Member/

Now you will get the error, please help me at that point...

Many thanks

Last edited by sophia; August 2nd, 2012 at 02:44 PM..
 
Old August 3rd, 2012, 03:33 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

I can indeed see the error, but it's a bit unhelpful for me, as I have no idea what code is run when you access /Member. Could be anything.

>> How I can check these things, I have no idea to test that.

By looking at the code for the page that fails.

So, as asked before, please be specific. Tell us if /Member is just a folder or a configured application, shows us the relevant code for the page behind /Member, tells us what you expect to fire and when etc..... In other words: help us help you....

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!




Similar Threads
Thread Thread Starter Forum Replies Last Post
Storing Connection String in web.config TeaDrinkingGeek BOOK: Beginning ASP.NET 4 : in C# and VB 1 March 14th, 2011 10:42 AM
connection string issues, web.config file issues kaliaparijat ASP.NET 2.0 Professional 1 June 12th, 2008 08:07 AM
setting connection string in the web.config ACE2084 ADO.NET 2 January 6th, 2005 04:33 PM
Database Connection with Web.Config RPG SEARCH Classic ASP Databases 7 July 26th, 2004 06:10 PM
Variable Path in web.Config Connection String? ElPato General .NET 4 June 21st, 2004 05:44 PM





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