CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

ASP.NET Web Hosting – 3 Months Free!



Zone: > NEWSGROUP > Asp.Net Forum > starter_kits_and_source_projects.classifieds_starter_kit Tags:
Item Type: NewsGroup Date Entered: 10/12/2007 12:32:38 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 14 Views: 49 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
15 Items, 1 Pages 1 |< << Go >> >|
ScarletSpider
Asp.Net User
Errors after changing LocalSqlServer connectionstring10/12/2007 12:32:38 AM

0/0

I had intermittent login errors (not accepting passwords) after transferring my site to IIS. I fixed this by putting in LocalSqlServer  in the connectionstrings of web.config. Now I can't insert ads. I get an error.

An exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll but was not handled in user code

Additional information: The INSERT statement conflicted with the FOREIGN KEY constraint "FK_Ads_Members". The conflict occurred in database "C:\ALCIS SOURCE\WEB ASP.NET\REALESTATE\APP_DATA\CLASSIFIEDSDB.MDF", table "dbo.classifieds_Members", column 'Id'.
The statement has been terminated.

dreamz
Asp.Net User
Re: Errors after changing LocalSqlServer connectionstring10/12/2007 2:30:46 AM

0/0

This may be due the foriegn key reference for the field "id" you have given in the database.

ScarletSpider
Asp.Net User
Re: Errors after changing LocalSqlServer connectionstring10/12/2007 4:09:05 AM

0/0

The database works fine if I remove the connection string in web.config, I think it could be because the connectionstring to the Ads DataAdapter is looking in the wrong place. I tried to make a new DataAdapter, but I can't find how to change the AdsDataComponent.

ashmetry
Asp.Net User
Re: Errors after changing LocalSqlServer connectionstring10/12/2007 2:33:44 PM

0/0

The DB works fine directly because you are probably using the MEMBER_ID that you expect to use from the database that you originally uploaded.

When using the website and you endup adding LocalSqlServer. I bet it creates a new membership DB and assigns you a new MemberId. So when you insert an ad you get this error becuse the ads table cannot find this member Id on the memebrship table that is has a FK too.

You need to make sure that the website and your ads table are referencing the same membership table.


-Ash
Web:   www.love2trade.com
Blog:   blog.love2trade.com

Please remember to click "Mark as Answer" on this post if it helped you.
ScarletSpider
Asp.Net User
Re: Errors after changing LocalSqlServer connectionstring10/13/2007 10:50:35 AM

0/0

Thanks for that. I understand what you're saying, but have no idea what to do about it.

The ASPNETDB table is stored on a SQL 2005 server, but it's no better if I use EXPRESS (pointing LocalSqlServer connectionstring in web config to EXPRESS instead of SQL 2005 server).

When I remove the connectionstring in web.config for LocalSqlServer everything works in debug mode, but I can't log in from IIS.   

The classifieds table is stored on EXPRESS locally.

I thought the insert command was just a standard stored procedure, is something else happening ?.

ScarletSpider
Asp.Net User
Re: Errors after changing LocalSqlServer connectionstring10/13/2007 3:22:39 PM

0/0

OK, the problem is that Profile.MemberId is 0. Not sure why. I can get rid of the error by doing the query ALTER TABLE classifieds_Ads DROP CONSTRAINT FK_Ads_Members .

Still working on this. Any suggestions appreciated.

ScarletSpider
Asp.Net User
Re: Errors after changing LocalSqlServer connectionstring10/13/2007 3:33:24 PM

0/0

Taking things further.  

I thought I'd create a new user, but for every user I create it says the username already exists. Somethings going wrong with the login routine. 

The connections string is: 

<add name="LocalSqlServer" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\aspnetdb.mdf;Integrated Security=True;User Instance=True; Pooling=false"/>

 

darkknight187
Asp.Net User
Re: Errors after changing LocalSqlServer connectionstring10/14/2007 2:32:15 PM

0/0

You said the problem started after you transfered it online,

Does this mean your local computer is running the application just fine?

Exactly what changes did you do for LocalSqlServer connection string?

In the web.config there is reference to LocalSqlServer for the membership section,

you did leave that reference to LocalSqlServer alone, Right?

If your local computer works fine, and it's just an online issue,

post your connection string. (xxxxxx out all the secure info, such as passwords, usernames...) 

 

I sounds like something is really conflicting with another.

The only time I had a problem with usernames was I created the two databases, created my username for admin, and needed to start over with the ads database. So I deleted it, and then recreated it, I ended up having to delete both databases and recreate them.

 


Be sure to visit www.detelli.com

And please remember to click ?Mark as Answer? on the post that helps you.
This can be beneficial to other community members reading the thread.
ScarletSpider
Asp.Net User
Re: Errors after changing LocalSqlServer connectionstring10/14/2007 10:38:26 PM

0/0

No, when I put in the changes to the connectionstring it fails, even on the local/development computer.

 

<?xml version="1.0"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
 
  <configSections>
    <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
      <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
        <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
        <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
          <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="Everywhere"/>
          <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
          <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
        </sectionGroup>
      </sectionGroup>
    </sectionGroup>
  </configSections>
  <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>
  <location path="ManageVideos.aspx">
    <system.web>
      <httpRuntime maxRequestLength="11264" executionTimeout="86400"/>
    </system.web>
  </location> 
 <system.web>
    <!--<pages enableEventValidation="false"/>-->
  <!--customErrors defaultRedirect="Error.aspx" mode="RemoteOnly"/-->
    <customErrors mode="Off"/>
  <pages styleSheetTheme="Red" enableEventValidation="false"/>
  <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="7" minRequiredNonalphanumericCharacters="1" 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>
  <compilation debug="true">
   <assemblies>
    <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      </assemblies>
    </compilation>

    <httpHandlers>
      <remove verb="*" path="*.asmx"/>
      <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
      <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
      <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
    </httpHandlers>
    <httpModules>
      <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    </httpModules>   
   
  </system.web>
 <connectionStrings>
   
  <add name="classifiedsConnection" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\classifiedsdb.mdf;Integrated Security=True;User Instance=True; Pooling=false"
   providerName="System.Data.SqlClient" />
  <add name="ALCConnectionString" connectionString="Data Source=SERVER;Initial Catalog=ALC;Persist Security Info=True;User ID=myId;pwd=myPW"
   providerName="System.Data.SqlClient" />
  <add name="CLASSIFIEDSDBConnectionString1" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\CLASSIFIEDSDB.mdf;Integrated Security=True;User Instance=True"
   providerName="System.Data.SqlClient" />
  <add name="ConnectionString" connectionString="Data Source=SERVER;Persist Security Info=True;User ID=myId;Password=myPW"
   providerName="System.Data.SqlClient" />
  <add name="RealEstateConnectionString1" connectionString="Data Source=server\;Initial Catalog=RealEstate;Persist Security Info=True;User ID=myId;Password=myPW"
   providerName="System.Data.SqlClient" />
  <remove name="LocalSqlServer"/>
  <add name="LocalSqlServer" connectionString="Data Source=Server;Initial Catalog=RealEstate;Persist Security Info=True;User ID=myId;pwd=myPW"/>
  <!--  connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\classifiedsdb.mdf;Integrated Security=True;User Instance=True; Pooling=false  -->
  <!--  connectionString="Data Source=localhost;Initial Catalog=appservicesdb;Integrated Security=True" providerName="System.Data.SqlClient"/>  -->
  </connectionStrings>
 <system.net>
  <mailSettings>
   <smtp>
    <network host="yourSMTPhostname" port="25" defaultCredentials="true" userName="enterUserNameHereIfRequired" password="enterPasswordIfRequired"/>
    /&gt;
   </smtp>
  </mailSettings>
 </system.net>


 
  <system.web.extensions>
    <scripting>
      <webServices>
        <!-- Uncomment this line to customize maxJsonLength and add a custom converter -->
        <!--
      <jsonSerialization maxJsonLength="500">
        <converters>
          <add name="ConvertMe" type="Acme.SubAcme.ConvertMeTypeConverter"/>
        </converters>
      </jsonSerialization>
      -->
        <!-- Uncomment this line to enable the authentication service. Include requireSSL="true" if appropriate. -->
        <!--
        <authenticationService enabled="true" requireSSL = "true|false"/>
      -->
        <!-- Uncomment these lines to enable the profile service. To allow profile properties to be retrieved
           and modified in ASP.NET AJAX applications, you need to add each property name to the readAccessProperties and
           writeAccessProperties attributes. -->
        <!--
      <profileService enabled="true"
                      readAccessProperties="propertyname1,propertyname2"
                      writeAccessProperties="propertyname1,propertyname2" />
      -->
      </webServices>
      <!--
      <scriptResourceHandler enableCompression="true" enableCaching="true" />
      -->
    </scripting>
  </system.web.extensions>
  <system.webServer>
    <validation validateIntegratedModeConfiguration="false"/>
    <modules>
      <add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    </modules>
    <handlers>
      <remove name="WebServiceHandlerFactory-Integrated"/>
      <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
      <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
      <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    </handlers>
  </system.webServer>
  <appSettings>
    <add key="MAX" value="20"/>
  </appSettings>

</configuration>
--> --> --> --> --> -->

darkknight187
Asp.Net User
Re: Errors after changing LocalSqlServer connectionstring10/14/2007 11:51:38 PM

0/0

So why do you have so many connection strings;

<connectionStrings>

<add name="classifiedsConnection" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\classifiedsdb.mdf;Integrated Security=True;User Instance=True; Pooling=false"

providerName="System.Data.SqlClient" />

<add name="ALCConnectionString" connectionString="Data Source=SERVER;Initial Catalog=ALC;Persist Security Info=True;User ID=myId;pwd=myPW"

providerName="System.Data.SqlClient" />

<add name="CLASSIFIEDSDBConnectionString1" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\CLASSIFIEDSDB.mdf;Integrated Security=True;User Instance=True"

providerName="System.Data.SqlClient" />

<add name="ConnectionString" connectionString="Data Source=SERVER;Persist Security Info=True;User ID=myId;Password=myPW"

providerName="System.Data.SqlClient" />

<add name="RealEstateConnectionString1" connectionString="Data Source=server\;Initial Catalog=RealEstate;Persist Security Info=True;User ID=myId;Password=myPW"

providerName="System.Data.SqlClient" />

<remove name="LocalSqlServer"/>

<add name="LocalSqlServer" connectionString="Data Source=Server;Initial Catalog=RealEstate;Persist Security Info=True;User ID=myId;pwd=myPW"/>

<!-- connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\classifiedsdb.mdf;Integrated Security=True;User Instance=True; Pooling=false -->

<!-- connectionString="Data Source=localhost;Initial Catalog=appservicesdb;Integrated Security=True" providerName="System.Data.SqlClient"/> --> </connectionStrings>

If I paste in your web.config into my own and set it back to the original connection string

<connectionStrings>

<add name="classifiedsConnection" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\classifiedsdb.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>

</connectionStrings>

Everything works normaly, even the ajax enabled part.

Or am I mistaken that you actually have six sql databases, plus a members database? As in five more than the default?

That seems a little excessive, it's a lot easier to add a table to a database, so excuse me if I'm on the wrong track.

 


Be sure to visit www.detelli.com

And please remember to click ?Mark as Answer? on the post that helps you.
This can be beneficial to other community members reading the thread.
ScarletSpider
Asp.Net User
Re: Errors after changing LocalSqlServer connectionstring10/15/2007 12:04:10 AM

0/0

Please note that the main symptom is that Profile.MemberId doesn't change after I log in. I.e. no MemberID in insertad causing the original error posted.

ScarletSpider
Asp.Net User
Re: Errors after changing LocalSqlServer connectionstring10/15/2007 12:05:53 AM

0/0

Thanks for doing that darknight, really appreciate you looking in to it. I don't need so many connection strings, the site is only just going live, most of it was for debugging purposes, so I can tidy up the multiple references.

darkknight187
Asp.Net User
Re: Errors after changing LocalSqlServer connectionstring10/15/2007 12:38:20 AM

0/0

Well I am at a loss as to what the problem is for you, it's not in the web.config though.

I even tried logging in with a current id, creating a new login and posted an ad successfully.

Everything works fine.

Did you try creating a new login to fix this problem, you could have some glitch in the database,

or maybe with the stored procedures or something.

Hope you get it,

Good luck, and don't forget to make frequent backups of working versions.

 


Be sure to visit www.detelli.com

And please remember to click ?Mark as Answer? on the post that helps you.
This can be beneficial to other community members reading the thread.
ashmetry
Asp.Net User
Re: Errors after changing LocalSqlServer connectionstring10/15/2007 2:10:13 AM

0/0

It is very possible that its DB related. Did you mess with any of the stored procs? (I had a similar issue that the SP was not returning the actual memberId and I actually got rid of the whole memberId thing and replaced it with only Username, but thats a different story..)

Try troubleshooting the Database SPs by themselves first..to make sure they are returning everything correctly. If everything works ok..try to troubleshoot from the DAL and test.. if everything ok, then go one level down to the BLL and step through the debugger..and so on ...

You also mentioned that you cannot create a new user which is probably caused by the same error. I think its a permission issue somewhere, maybe on the DB.

I would tackle that issue because that seems to be unrelated to the Classifieds Starter Kit.

You can even create a new membership form page and upload that to the server and see if that works or not.


-Ash
Web:   www.love2trade.com
Blog:   blog.love2trade.com

Please remember to click "Mark as Answer" on this post if it helped you.
ScarletSpider
Asp.Net User
Re: Errors after changing LocalSqlServer connectionstring10/16/2007 3:43:12 AM

0/0

Instead of finding a cause to the problem I decided to work around it, with the following code. I made a stored procedure to get the MemberId from the classifieds_Members table.

PostAdWizard_FinishButtonClick

Dim membername As String = User.Identity.Name

Dim memberId As Integer

If Profile.MemberId = 0 Then

memberId = AdsDB.GetIdByUserName(membername)

Else

memberId = Profile.MemberId

End If

15 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
ASP.NET AJAX Programming Tricks Authors: Matthew David Ellis, Matthew Ellis, Pages: 388, Published: 2007
Microsoft Office SharePoint Server 2007: The Complete Reference Authors: David Matthew Sterling, David Sterling, Pages: 788, Published: 2007
Sams Teach Yourself Visual Studio .NET 2003 in 21 Days Authors: Jason Beres, Pages: 666, Published: 2003
Professional ASP.NET 3.5: In C# and VB Authors: Bill Evjen, Scott Hanselman, Devin Rader, Pages: 1673, Published: 2008
Beginning ASP Databases Authors: John Kauffman, Kevin Spencer, Thearon Willis, Pages: 856, Published: 2003
Microsoft IIS 7 Implementation and Administration: Implementation and Administration Authors: John Paul Mueller, Pages: 364, Published: 2007
Beginning ASP.NET 3.5: In C# and VB Authors: Imar Spaanjaars, Pages: 734, Published: 2008

Web:
Errors after changing LocalSqlServer connectionstring - ASP.NET Forums Re: Errors after changing LocalSqlServer connectionstring ... Re: Errors after changing LocalSqlServer connectionstring ...
DiscountASP.NET Community Forum Please review the specific error details below and modify your .... Change LocalSQLServer to what you have the connection string name to be. ...
ASP.NET Website Administration Tool Problems « More Soma Please… Nov 5, 2007 ... The WAT tool uses the LocalSqlServer connection string to connect ... After making this change the Security tab for the WAT works correctly. ...
Results for "localsqlserver" [quote] You changed the LocalSqlServer connection string entry, right? .... I now get the following error message after copying an asp.net ...
Whenever you get User Instance Disabled error follow these steps Jul 7, 2008 ... But still after changing the connection string if you still receive the same error than you should try this piece of code. ...
MSDN login through a webmethod error login through a webmethod error. Well, I did change the connection string in web .config, thats the first thing I did after removing the localsqlserver ...
SQL Server Error 26: Error Locating Server/Instance Specified ... error locating server/instance specified. After doing some searching I .... In my Web Application, "LocalSqlServer" connection string does not exist in ...
The connection name ‘LocalSqlServer’ was not found in the ... By default, there is a connection string called LocalSqlServer in ... VS error - SQL Server not allow remote connections - bytes Jul 2, 2007 ... I left it a few days ago, after I had implemented membership, worked on some db tables ... Asp.Net Programming :: deploying aspnetdb membership .. error: 26 ...




Search This Site:










works fine on local server, but not on host server!

dotnetnuke and classified starter kit

classified starter kit with mysql or ms access

silly question...masterpage format

insert category sp

install scripts customisation

error: cannot convert to type system.decimal

how to make this work.. classifieds city wise and search with id

cannot send e-mail from my live website

namespace issue

reduce size of featured ad

working solutions for this requirements

converting to web app

working website + suggestions for future versions

photo doesn´t show on page

here is an extended version of this starterkit.

working site example

multiple featured ads

page looks poor in ie6 but good in ie7

dbo.aspnet_checkschemaversion

moving photos from db back to upload directory

hi, can anyone tell me how the adid is passed to the upload photos page ??

classifieds hosting problem

check out my site and send me feedback! work great with ie but not with firefox.

classified starterkit opens very slow.

progress bar for upload page

sending mail from hosted site. help!![:'(]

very strange, bothersome bug!! wrong domain name displayed in "send ad as email text box

how does the members table in classifiedsdb.members work with aspnetdb.mdf ?

saving user information to profile and not database?

  Privacy | Contact Us
All Times Are GMT