How to install the ASP.NET 2.0 Classified Ad Starter kit Requirements: - ASP.NET 2.0 - Visual Web Developer (VWD) - SQL Express if you intend to develop on your local machine 1) Download and install the starter kit on your computer from http://www.asp.net. Once installed, the Classified Starter kit should be one of the available templates in VWD 2) Open Visual Web Developer 3) Create a local copy of the site - Select File -> New -> Website. This should bring up the New Web Site dialogue box. - Select 'Classifieds Web Site Starter Kit' - In Location: Select 'File System' - Put in a location where you want VWD to install the web site - Select either Visual Basic or Visual C# as language - Hit OK 4) Install the Database Schema on DiscountASP.NET SQL server - The SQL script to generate the database is located in the /App_code directory - You can use your favorite SQL client to execute the script. Here, I am using osql as an example a) Execute the command below to create the schema osql -S <sql server name> -U <db_user> -P <DB_password> -d <DB_Name> -i <path to the starterKit>\App_datat\classifieds-add.sql b) Execute the command below to create some sample data osql -S <sql server name> -U <db_user> -P <DB_password> -d <DB_Name> -i <path to the starterKit>\App_datat\classifieds-categories.sql 5) Update the Web.config file - Comment out the following: <add name='classifiedsConnection' connectionString='Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\classifiedsdb.mdf;Integrated Security=True;User Instance=True' providerName='System.Data.SqlClient' /> - Add the following: <add name='classifiedsConnection' connectionString='Data Source=<sql server name>.discountasp.net;Initial Catalog=<DB_Name>;User ID=<db_user>;Password=<DB_password>' /> - Update the SMTP setting Change host='' to host='localhost' 6) Set up membership / role provider database See KB: http://kb.discountasp.net/article.aspx?id=10413 7) Copy your site to DiscountASP.NET servers See KB: http://kb.discountasp.net/article.aspx?id=10364 8) Setup the directory as a web application using the Web Application Tool in the control panel. That?s it!! Bruce DiscountASP.NET www.DiscountASP.NET
Bruce.......you lost me on number: Could you give me a step by step? 4) Install the Database Schema on DiscountASP.NET SQL server - The SQL script to generate the database is located in the /App_code directory - You can use your favorite SQL client to execute the script. Here, I am using osql as an example a) Execute the command below to create the schema osql -S <sql server name> -U <db_user> -P <DB_password> -d <DB_Name> -i <path to the starterKit>\App_datat\classifieds-add.sql b) Execute the command below to create some sample data osql -S <sql server name> -U <db_user> -P <DB_password> -d <DB_Name> -i <path to the starterKit>\App_datat\classifieds-categories.sql 5) Update the Web.config file - Comment out the following: <add name="classifiedsConnection" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\classifiedsdb.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient" /> - Add the following: <add name="classifiedsConnection" connectionString="Data Source=<sql server name>.discountasp.net;Initial Catalog=<DB_Name>;User ID=<db_user>;Password=<DB_password>" /> - Update the SMTP setting Change host="" to host="localhost"
well this error is not very descriptive. Have you disable Friendly HTTP error on your browser? Bruce DiscountASP.NET www.DiscountASP.NET
I followed your how to step by step...this is what I get when I launch my site. An error occurred. Please contact the site administrator.
No. Only install the application on the folder where you uploaded the starter kit. For example, if you upload to a folder named Classified under your root, you only need to create an application in the Classified directory. Bruce DiscountASP.NET www.DiscountASP.NET
First of all, thanks for the instructions. I followed them word for word and received the following error: Server Error in '/' Application. 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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) 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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) Source Error: The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL: 1. Add a 'Debug=true' directive at the top of the file that generated the error. Example: <%@ Page Language='C#' Debug='true' %> or: 2) Add the following section to the configuration file of your application: <configuration> <system.web> <compilation debug='true'/> </system.web> </configuration> Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode. Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario. 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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)] System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +735043 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188 System.Data.SqlClient.TdsParser.Connect(Boolean& useFailoverPartner, Boolean& failoverDemandDone, String host, String failoverPartner, String protocol, SqlInternalConnectionTds connHandler, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject, Boolean aliasLookup) +820 System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +628 System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +170 System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +130 System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28 System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +424 System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66 System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +496 System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +82 System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105 System.Data.SqlClient.SqlConnection.Open() +111 System.Web.DataAccess.SqlConnectionHolder.Open(HttpContext context, Boolean revertImpersonate) +84 System.Web.DataAccess.SqlConnectionHelper.GetConnection(String connectionString, Boolean revertImpersonation) +197 System.Web.Security.SqlRoleProvider.RoleExists(String roleName) +482 System.Web.Security.Roles.RoleExists(String roleName) +242 ASP.global_asax.Application_Start(Object sender, EventArgs e) +14
You could get a more descriptive error message by modifying <%@ Page Language="C#" Debug="false" %> to <%@ Page Language="C#" Debug="true" %> within your web.config. It seems there is an issue with the connection to the SQl Server.Make sure the connectionstring values has been replaced correctly. i.e <add name="classifiedsConnection" connectionString="Data Source=<sql server name>.discountasp.net;Initial Catalog=<DB_Name>;User ID=<db_user>;Password=<DB_password>" providerName="System.Data.SqlClient"/> has the the correct credentials,your <sql server name> and your <DB_Name>. Vikram DiscountASP.NET www.DiscountASP.NET
I was able to get past that error by adding a 'tcp:' to the front of my dataSource. Now I get the following error: Server Error in '/' Application. Object reference not set to an instance of an object. 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.NullReferenceException: Object reference not set to an instance of an object. Source Error: The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL: 1. Add a 'Debug=true' directive at the top of the file that generated the error. Example: <%@ Page Language='C#' Debug='true' %> or: 2) Add the following section to the configuration file of your application: <configuration> <system.web> <compilation debug='true'/> </system.web> </configuration> Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode. Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario. Stack Trace: [NullReferenceException: Object reference not set to an instance of an object.] Login_aspx.PasswordRecovery_Init(Object sender, EventArgs e) +44 System.Web.UI.Control.OnInit(EventArgs e) +2069660 System.Web.UI.WebControls.PasswordRecovery.OnInit(EventArgs e) +11 System.Web.UI.Control.InitRecursive(Control namingContainer) +321 System.Web.UI.Control.InitRecursive(Control namingContainer) +198 System.Web.UI.Control.InitRecursive(Control namingContainer) +198 System.Web.UI.Control.InitRecursive(Control namingContainer) +198 System.Web.UI.Control.InitRecursive(Control namingContainer) +198 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +692 Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42 Thanks again for all of your help. I am a total newb when it comes to ASP. Jason
Once again,could you replace <%@ Page Language="C#" Debug="false" %> with a <%@ Page Language="C#" Debug="true" %> within your web.config to get a more descriptive error.Please let us know what it shows then? Vikram DiscountASP.NET www.DiscountASP.NET
I am a novice so i need a little more detail. on step 4 I need some help. I have the classified kit on my local drive. I want to publish to discount's servers. installing the sql scipt that is located in teh app_code directory, there are 3 folders in that directory. Please help, I am lost.
what help do you need? If you have SQL client installed, simply run the sqlcmd stated in the instruction. Bruce DiscountASP.NET www.DiscountASP.NET
I need a lot currently i am getting An error occurred. Please contact the site administrator. I have tried to follow the instructions above. I am not very well versed in SQL so I need to find a client to run the script on, also need to know db name, etc. Which i have from discountasp.net. you mention though the script to gernerate the db is located in the app_code dir, where?
ok here is where I am now. the site is online however I am getting errors when tryign to view anything other than my categories. You can see it here. www.bbqclassifieds.net post an ad, log in, etc. give the error Server Error in '/' Application. Object reference not set to an instance of an object. 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.NullReferenceException: Object reference not set to an instance of an object. Source Error: Code: 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: Code: [NullReferenceException: Object reference not set to an instance of an object.] Login_aspx.PasswordRecovery_Init(Object sender, EventArgs e) +44 System.Web.UI.Control.OnInit(EventArgs e) +2117356 System.Web.UI.WebControls.PasswordRecovery.OnInit(EventArgs e) +11 System.Web.UI.Control.InitRecursive(Control namingContainer) +321 System.Web.UI.Control.InitRecursive(Control namingContainer) +198 System.Web.UI.Control.InitRecursive(Control namingContainer) +198 System.Web.UI.Control.InitRecursive(Control namingContainer) +198 System.Web.UI.Control.InitRecursive(Control namingContainer) +198 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +692 Version Information:Microsoft .NET Framework Version:2.0.50727.832; ASP.NET Version:2.0.50727.832 <!-- [NullReferenceException]: Object reference not set to an instance of an object. at Login_aspx.PasswordRecovery_Init(Object sender, EventArgs e) at System.Web.UI.Control.OnInit(EventArgs e) at System.Web.UI.WebControls.PasswordRecovery.OnInit(EventArgs e) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) [HttpUnhandledException]: Exception of type 'System.Web.HttpUnhandledException' was thrown. at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) at System.Web.UI.Page.ProcessRequest(HttpContext context) at ASP._login_aspx.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) --><!-- This error page might contain sensitive information because ASP.NET is configured to show verbose error messages using <customErrors mode="Off"/>. Consider using <customErrors mode="On"/> or <customErrors mode="RemoteOnly"/> in production environments.-->
in the instructions..... this line: a) Execute the command below to create the schema osql -S <sql server name> -U <db_user> -P <DB_password> -d <DB_Name> -i <path to the starterKit>\App_datat\classifieds-add.sql what do you put for <sql server name> and <db_user> and <DB_password> and <DB_Name> and <path to the starterKit>???
Domain is down. Looks like he gave up.... I followed the instructions and just tweak my web config. This is a working web.config for a test classified starter kit hosted here. <configuration xmlns='http://schemas.microsoft.com/.NetConfiguration/v2.0'> <location path='Admin'> <system.web> <authorization> <allow roles='Administrators'/> <deny users='*'/> </authorization> </system.web> </location> <location path='PostAd.aspx'> <system.web> <authorization> <deny users='?'/> </authorization> </system.web> </location> <location path='EditPhotos.aspx'> <system.web> <authorization> <deny users='?'/> </authorization> </system.web> </location> <location path='MyAds.aspx'> <system.web> <authorization> <deny users='?'/> </authorization> </system.web> </location> <location path='MyProfile.aspx'> <system.web> <authorization> <deny users='?'/> </authorization> </system.web> </location> <system.web> <compilation debug='true' /> <authorization> <allow roles='Administrators' /> </authorization> <customErrors defaultRedirect='~/Error.aspx' /> <pages styleSheetTheme='Red'/> <authentication mode='Forms' /> <membership> <providers> <clear/> <add name='AspNetSqlMembershipProvider' type='System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' connectionStringName='LocalSqlServer' enablePasswordRetrieval='false' enablePasswordReset='true' requiresQuestionAndAnswer='true' applicationName='/' requiresUniqueEmail='true' passwordFormat='Hashed' maxInvalidPasswordAttempts='5' minRequiredPasswordLength='5' minRequiredNonalphanumericCharacters='0' passwordAttemptWindow='10' passwordStrengthRegularExpression=''/> </providers> </membership> <profile enabled='true'> <properties> <add name='FirstName' type='System.String'/> <add name='LastName' type='System.String'/> <add name='MemberId' defaultValue='0' type='System.Int32'/> <group name='Core'/> </properties> </profile> <roleManager enabled='true'/> <siteMap defaultProvider='RoleEnabled_AspNetXmlSiteMapProvider' enabled='true'> <providers> <clear/> <add name='RoleEnabled_AspNetXmlSiteMapProvider' type='System.Web.XmlSiteMapProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' siteMapFile='web.sitemap' securityTrimmingEnabled='true'/> </providers> </siteMap> </system.web> <connectionStrings> <add name='classifiedsConnection' connectionString='Data Source=xxx.discountasp.net;Initial Catalog=SQL2005_0000000_mydb;User ID=SQL2005_0000000_my_user;Password=mypassword' /> <remove name='LocalSqlServer'/> <add name='LocalSqlServer' connectionString='Data Source=xxx.discountasp.net;Initial Catalog=SQL2005_0000000_mydb;User ID=SQL2005_0000000_my_user;Password=mypassword' /> </connectionStrings> <system.net> <mailSettings> <smtp> <network host='localhost' port='25' defaultCredentials='true' userName='enterUserNameHereIfRequired' password='enterPasswordIfRequired'/> </smtp> </mailSettings> </system.net> </configuration>
I had modified the small business template to use for my website HWY30.com - I wanted to add the classifieds as a subdirectory, trying different options for the sub directory as an application. I was having some issues but making progress. I was not able to get login/register to work correctly in theclassifieds SubDir.I was having problems with the web.config file inheritance option. So Iremoved my root and subdirandam trying to just setup & configure classifieds to ensure i understand it, thisremoves some of the complexity(to me). I have followed this thread and tried all things within it. I have succesfully installed/ran/updated/created roles, both Administrator and guest - itall works just fine "Locally". When Imodify connections string and upload it seems to work just fine, but when Itry to login/register it fails. I have had a number of different failure messages. from the contactsite administrator error null exceptionerror - for role not created and the latest "System.NullReferenceException: Object reference not set to an instance of an object." Line 25: PasswordRecovery.MailDefinition.From = s.SiteEmailFromField I find copying the created roles to DASP servera mystery -in previous thread it was saidfro the VWD menuuse "website--> ASP.Configration" - this option exists locally but trying to access it on the DASP server Ionly get the option for web permissions which seems to tie into FrontPage extensions. i have tried aspnet_regsql.exe -S myr_DB -U myuser_info -Pmypswd -A all -d CLASSIFIEDSDB.mdf - this starts then fails I am using the web.config file from the user indicating he had it working on DASP server, but it still fails. (I have removed, started from scratch and removed again, applied again, whatcouldI possibly be missing? Any ideas from anyone would be much appreciated
Hi, If you don't run SQL Server locally you can install the new SQL Server 2008 Express version. It's the first Express version that allows you to pump data local to remote like the full versions. http://www.microsoft.com/express/ On the Webcasts page: http://iis7test.com/webcasts/ In Video #3 I show how to get the membership roles working. If you need more help let me know. Salute, Mark
Mark, thank you for your repsonse. I didnot realize there are 2 tables, 1 controlling roles and other data.I think that was my biggest problem,Only one was being attachedvia the SQL tool suitefrom my CP. I have created, for test, all of the tables/views/sp etc... from ASPNETDB.MDF to my server copy CLASSIFIEDSDB.mdf. This seems to have fixed most of my problems. I will install SQL Server 2008 Express see if I canget by the multiple tables to be used andthenmerge all 3 tables - ASPNETDB.MDF, CLASSIFIEDSDB.mdf and SmallCompanyDB.mdf to one common table, I think that would work? Am sure the easiest way would beto order a Database for each. Are there other DASPusersusing one DB for multiple applications? Again THANK YOU !!!!
Hi, I just installed the new Express products on another machine and will create a few Webcasts for those. Yes you can merge data from those DBes. The Attach feature in the control panel for your account will only work once however. So it is best to do the merge on your local machine. Cool thing about the new SQL Express versions is the Import/Export wizard. If you need help with that let me know. Salute, Mark
Mark - a friendly question, do you sleep? The error Iget is when using the SQL tool suite to attach the merged DB's (ASPNETDB.MDF, CLASSIFIEDSDB.mdf and SmallCompanyDB.mdf). It runs the job for about 8 minutes and then fails, indicating it has rolled back and to contact technical support. I opened a ticket late yesterday, it has been respondedto and closed. Ticket #: 1215234 Department: Support Status: Closed Subject: upgraded to SQL express 2008 / VWD 2008 content in ticket contains this answer. Hello, Unfortunately that is correct. You will need to upgrade to a SQL 2008 addon. You may want to consider upgrading your SQL 2005 to SQL 2008. Please refer to this thread from our community forum. http://community.discountasp.net/default.aspx?f=16&m=26892 I guess I will roll back to 2005 due to funding, Thanks for your efforts Mark.
I upgradedto SQL 2008 express and then also had to upgrade to VWD 2008. I have merged DB's to one and now it fails. I am assuming I also now have to upgrade to MSQL 2008 on DASP server too?Hmmm.....
Hi, I do not mind happy little questions like that, matter of fact I enjoy dialoging with Devs here. I'm a 47 year oldEspresso addict with three young, very active, children. http://blogcastrepository.com/photos/marks_shots/default.aspx I eat one meal each day, for four years now, no snacks ever, no colas, water and Espresso then one meal. It has turned me into a machine and I require minimal sleep. http://www.genomenewsnetwork.org/articles/2004/07/09/calorierestriction.php As for the migration, it is a good idea to move up to SQL 2008 now. You will enjoy the additions it has added. There is a little confusion over connecting to SQL 2008... Microsoft has released a SP you have to agree to, then download, and then 2005 can connect to 2008. I've already tested it for Microsoft, it works. As for the attach tool, only use it once for each of your on-line DBes. You can't attach more than one at a time, they will conflict. Best thing is to merge them locally into one DB then attach it. If you need help with that I'm willing. Salute, Mark
No...Unless you included some of the new data types SQL Server 2008 has. What is the error you are getting? Just as a note, for anyone else reading this thread... With all the recentSP1 updates it is best to remove and then re-install the new VWD2008; And allow it to install SQL Server 2008 Express. The new bootstapper install from the Web will check you system and make updates as needed. There is also an ISO DVD file you can D/L and use to install all of the updated Express products.
I would like to install the classifieds starter kit on Discountasp.net, but the download I get from Microsoft (http://www.asp.net/downloads/starter-kits/classifieds/) does not provide the database schema... You state: ------------------------------------- 4) Install the Database Schema on DiscountASP.NET SQL server - The SQL script to generate the database is located in the /App_code directory - You can use your favorite SQL client to execute the script. Here, I am using osql as an example -------------------------------------- Is there anyway someone can please provide these for me? Thank you