Running .SQL Script to populate DB

Discussion in 'Databases' started by wisemx, May 21, 2008.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Hi,
    Yes I can step you through this step by step.
    First of all please tell me if the data you want to migrate is in an Express DB.
    Either that or it resides in your local SQL Server 2005, which will be best of all.
    Salute,
    Mark
     
  2. Thank you, Mark!


    Yes, it was an Sql Server 2005 Express db. I generated the sql script as noted - and that script resides on my pc. As a side note, I have SQL Server 2005 Pro - BUT this db was created using SQL Server 2005 Express - and resides in that instance (Express instance).


    Although you haven't asked, I thought I'd also include the part of the written tutorial I used -to help you better understand the process I've gone through -in an effort to make sure you and I are on the same page...





    "The Database Publishing Wizard enables you to use either SQL Express or SQL Server 2000/2005 locally, and then use either SQL 2000 or SQL 2005 in the remote hoster environment."


    Step 2: Creating .SQL Installation Scripts for our Database</o:p>


    Now that we've created a new application +local database,and added custom data to it (new users+theirrole membership, as well as new photos and albums), we want to deploy the application to a remote hosting server. </o:p>


    The first step we'll take is to create .SQL script files that will enable us to automate re-creating the exact same database schema + database content on our remote hosting account. To-do this we'll use the Database Publishing Wizard we installed as part of the SQL Hosting Toolkit. </o:p>


    To begin, click on the "Server Explorer" tab within Visual Studio or Visual Web Developer to see the databases that the application is using:


    As you can see in the above picture, we have two SQL Express databasesthat we are using: ASPNETDB.MDF and Personal.MDF. To generate .SQL installation files for each one, simply select the database in the solution explorer, then right-click and select the new"Publish to Provider" context menu item (added by the Database Publishing Wizard) setup on it:


    This will launch the Database Publishing Wizard and allow us to walkthrough scripting the installation of our database.As I mentioned in the intro of this blog post, the Database Publishing Wizard supports two deployment options: 1) To generate .SQL install script files that you can copy to your remote hoster and run using their existing web admin control panel tools, or 2) To upload the database directly using Database Publishing Web-Services on the hoster web-site. </o:p>


    For this first tutorial, we'll be using the .SQL script file approach - so keep the default radio button selected and provide a name for the .SQL install script file you want to generate:</o:p>


    When you click "next" you'll be given the option to customize some of preferences when creating the .SQL setup file. Note that you can control whether to drop existing objects within the target database, whether you want to target SQL 2000 or SQL 2005 with the script, and whether you want to setup both the schema and data, or just the schema, or just the data:
    For this tutorial just keep the defaults selected, and hit next and generate the .SQL script:
    You now have a Personal .SQL file that contains a script that you can run on any SQL server to re-create all the tables, sprocs, views, triggers, full-text catalogs, etc. for a database, as well as import and add all of the table row data that was in the database at the time the .SQL file was created.
    Notice above how the .SQL file includes both the SQL DDL needed to create the Photos table(including all of its constraints and primary-key/foreign-key relationships), as well as the SQL to insert data within the table once it is created (in the case above it is even inserting binary data for the photos - since they are stored in the database)




    Step 3: Using our .SQL files to create our remote databases</o:p>


    Now that we have our .SQL files, we can go about using them to install our database at our hoster. Exactly how we use the .SQL files to install the database will vary depending on how the hoster gives us access to our SQL account. Some hosters provide anHTML based file-upload tool that allows you to provide a .SQL file - which they will then execute against the SQL database you own. </o:p>


    Other hosters provide an online query tool (like below)that allows you to copy/paste SQL statements to run against your database. If you have a hoster which provides an online query tool like this, then you can open the .SQL file with a text-editor and copy/paste the contents into the query textbox and run it.</o:p>


    <v:shapetype id=_x0000_t75 stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" o:preferrelative="t" o:spt="75" coordsize="21600,21600"><v:stroke joinstyle="miter"></v:stroke><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"></v:f><v:f eqn="sum @0 1 0"></v:f><v:f eqn="sum 0 0 @1"></v:f><v:f eqn="prod @2 1 2"></v:f><v:f eqn="prod @3 21600 pixelWidth"></v:f><v:f eqn="prod @3 21600 pixelHeight"></v:f><v:f eqn="sum @0 0 1"></v:f><v:f eqn="prod @6 1 2"></v:f><v:f eqn="prod @7 21600 pixelWidth"></v:f><v:f eqn="sum @8 21600 0"></v:f><v:f eqn="prod @7 21600 pixelHeight"></v:f><v:f eqn="sum @10 21600 0"></v:f></v:formulas><v:path o:connecttype="rect" gradientshapeok="t" o:extrusionok="f"></v:path><o:lock aspectratio="t" v:ext="edit"></o:lock></v:shapetype><v:shape id=_x0000_i1025 style="WIDTH: 24pt; HEIGHT: 24pt" alt="" type="#_x0000_t75"></v:shape></o:p>


    The quality of the SQL tools that different hosters provide varies quite a bit. In testing the Database Publishing Wizard we found that some custom-made SQL admin tools provided by hosters had issues where they incorrectly parsed valid SQL statements (in particular GOTO statements). This page describes one issue you might see some hosters have with GOTO statements, along with a workaround you can use. To help improve the overall quality of SQL hosting admin tools, the SQL Server team early next year is going to be shipping the source to a free SQL HTML admin tool that hosters will be able to integrate into their experiences. Hopefully this will help improve the standard experience with all Windows hosters.</o:p>If your hoster has no usable HTML web admin tool for allowing you to easily manage your SQL database, then you can also just write a simple ASP.NET page that you FTP (along with your .SQL file) to your web-siteand then hit to read the .SQL file on the server in as text, and then pass it as a string to ADO.NET to execute. This will give you the same result as the query analyzer above - and fully create your database for you.
     
  3. OK, more clear but we need to go over a few more details...
    Don't worry, this isn't all that complicated.

    I've tested the DB publishing wizard but find working in SQL Server 2005 a lot easier.

    You have two options at this point.
    1. Use your local SQL Server 2005 to mount the Express DB then pump the data and objects to remote.
    2. Edit the publishing SQL scripts then execute then on the remote SQL Server.


    btw...Did you decide not to use the DASP attach DB feature?
    Since you have a blank remote DB, if it's SQL Server 2005, you can actually attach it and be done.


    Let me know which direction you want and I'm here for ya.
    I can even do the data pump for you if things get too crazy.
    Salute,
    Mark
     
  4. Mark,


    You are a wealth of info.


    You really have me thinking about the last comment you made: "btw...Did you decide not to use the DASP attach DB feature?
    Since you have a blank remote DB, if it's SQL Server 2005, you can actually attach it and be done."


    I was under the impression that all data and objects would be lost utilizing that method. I have a fair amount of data in the tables that needs to be uploaded as well as 60+ stored procedures and some views (read: if that data is lost, I am a dead man...). Man, if it's that easy...


    Awhile back I purchased VS2005 Pro (which ships with Sql Server 2005 Dev). I installed it, but ran into some conflicts between the two versions on my pc. I ended up posting in another forum - and due to the timeline coming my way decided to develop under the express edition until this project was completed. That's where I am... So, to answer your first question - I think it's best that I edit the scripts and upload them (providing that I can't simply use the db attach feature).


    What do you think?


    Seriously, though - I really appreciate your efforts.


    Cheers,


    Mike
     
  5. ALL,

    I apologize if this is old news and a poor question - but I am an absolute newbie when it comes to publishing databases - and I need someone to step-by-step walk me through this process.

    I've purchased the SQL Server 2005 add-on and have a blank db just waiting for some goodies.

    The local database I developed has data already in it - data and objects that need to be uploaded as is.

    I did some searching on here and was pointed to an article regarding Microsofts Database Publishing Wizard. I used this application to generate a Microsoft SQL Query File. I looked through it - and it contains all the data, stored procedures, etc. This is a wonderful thing...

    However, I'm completely lost as to the next step - which is uploading that file to DASP and running it - so that my DASP database is now populated as an exact copy of my local db.

    I have gone so far as to purchase two DASP domains and db's. One set for testing this - and then one set for implementation (so that I don't screw the pooch...)

    I have Visual Studio 2005, SQL Server 2005 (although I used Express as my dev db). I also have SQL Server Management Studio Express.

    Could someone please provide me with a DETAILED step-by-step procedure to complete this?

    THANK YOU!

    Mike
     
  6. Mark,


    I ftp'd the database to the DASP server - and then attached it using the DASP SQL Tools. I then proceeded to upload the website after making the necessary changes to the web.config (connection Strings). All loaded well - but when I go to log in I get quite the error (posted below...)


    Connection string is as such (from my web.config) - (I've changed the server, user, pwd...)


    <connectionStrings>


    <remove name="ConnectionString"/>


    <add name="ConnectionString" connectionString="Data Source=tcp:sql2k502.discountasp.net;Initial Catalog="mikes db;User ID=myuser;Password=********;"/>


    </connectionStrings>





    And Finally, The error:


    [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) +800131
    System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +186
    System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject) +737554
    System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +114
    System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +421
    System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +181
    System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +173
    System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +133
    System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +30
    System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +424
    System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66
    System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +494
    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.SqlMembershipProvider.GetPasswordWithFormat(String username, Boolean updateLastLoginActivityDate, Int32&amp; status, String&amp; password, Int32&amp; passwordFormat, String&amp; passwordSalt, Int32&amp; failedPasswordAttemptCount, Int32&amp; failedPasswordAnswerAttemptCount, Boolean&amp; isApproved, DateTime&amp; lastLoginDate, DateTime&amp; lastActivityDate) +1121
    System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved, String&amp; salt, Int32&amp; passwordFormat) +105
    System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved) +42
    System.Web.Security.SqlMembershipProvider.ValidateUser(String username, String password) +83
    System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e) +160
    System.Web.UI.WebControls.Login.AttemptLogin() +105
    System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +99
    System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35
    System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +115
    System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +163
    System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
    System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
    System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746
     
  7. Mark and anyone else viewing....


    I used a video you posted on these boards to help me connect to my db using sql server management studio express. Thank you for that - it was an absolute breeze. So, the move of my data to the DASP server was successful - all my data and objects are up there and well.


    Still, when I log in, I get that god awful error I just posted.


    Long story short, the website is up, as is the db - but when I login it goes south. I get that error (see previous post). Any ideas?


    Mike
     
  8. Well, I'm at a loss... I keep thinking that the problem lies within my web.config file. I'm gonna post it on here with the hopes that it is an easy fix and simply an oversight on my end.







    <!--


    Note: As an alternative to hand editing this file you can use the


    web admin tool to configure settings for your application. Use


    the Website->Asp.Net Configuration option in Visual Studio.


    A full list of settings and comments can be found in


    machine.config.comments usually located in


    \Windows\Microsoft.Net\Framework\v2.x\Config


    -->


    <configuration>


    <appSettings/>


    <connectionStrings>


    <remove name="ConnectionString"/>


    <add name="ConnectionString" connectionString="Data Source=tcp:sql2k502.discountasp.net;Initial Catalog=SQL2005_*****_*****;User ID=blah..blah..,;Password=*******;" providerName="System.Data.SqlClient"/>


    </connectionStrings>


    <system.web>


    <!--


    Set compilation debug="true" to insert debugging


    symbols into the compiled page. Because this


    affects performance, set this value to true only


    during development.


    Visual Basic options:


    Set strict="true" to disallow all data type conversions


    where data loss can occur.


    Set explicit="true" to force declaration of all variables.


    -->


    <roleManager enabled="true"/>


    <pages>


    <namespaces>


    <clear/>


    <add namespace="System"/>


    <add namespace="System.Collections"/>


    <add namespace="System.Collections.Specialized"/>


    <add namespace="System.Configuration"/>


    <add namespace="System.Text"/>


    <add namespace="System.Text.RegularExpressions"/>


    <add namespace="System.Web"/>


    <add namespace="System.Web.Caching"/>


    <add namespace="System.Web.SessionState"/>


    <add namespace="System.Web.Security"/>


    <add namespace="System.Web.Profile"/>


    <add namespace="System.Web.UI"/>


    <add namespace="System.Web.UI.WebControls"/>


    <add namespace="System.Web.UI.WebControls.WebParts"/>


    <add namespace="System.Web.UI.HtmlControls"/>


    </namespaces>


    </pages>


    <!--


    The <authentication> section enables configuration


    of the security authentication mode used by


    ASP.NET to identify an incoming user.


    -->


    <authentication mode="Forms"/>


    <!--


    The <customErrors> section enables configuration


    of what to do if/when an unhandled error occurs


    during the execution of a request. Specifically,


    it enables developers to configure html error pages


    to be displayed in place of a error stack trace.


    <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">


    <error statusCode="403" redirect="NoAccess.htm" />


    <error statusCode="404" redirect="FileNotFound.htm" />


    </customErrors>


    -->


    <membership>


    <providers>


    <remove name="AspNetSqlMembershipProvider"/>


    <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="LocalSqlServer" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="0" passwordStrengthRegularExpression=""/>


    </providers>


    </membership>


    <siteMap defaultProvider="XmlSiteMapProvider" enabled="true">


    <providers>


    <add name="XmlSiteMapProvider" description="Default SiteMap provider." type="System.Web.XmlSiteMapProvider " siteMapFile="Web.sitemap" securityTrimmingEnabled="true"/>


    </providers>


    </siteMap>


    <profile>


    <properties>


    <add name="locIdentifier" type="int"/>


    </properties>


    </profile>


    </system.web>


    </configuration>
     
  9. Mark,

    Oy vey... The ugly Sql error has been replaced with a login control that does not accept the username/password. Before, when i entered some of the logins and passwords - that error would pop up after a minute or so. Now, when I click the login button (after entering credentials on my loggin page...) I get the default message from the asp.net login control saying that "Your login attempt was not successful. Please try again."

    I've sent you a private message - so that you may see it in action.

    THis one is tough.. cause I don't have an error message to walk me through it...

    I checked the db via sql server management studio - and the users exist... Itried multiple logins - one as the administrator, one as a lesser peon, etc...

    Regards,
    Mike

    p.s. I changed my web.config as you noted... just thought I'd clear that up...
     
  10. Got your PM and will look into this soon.
    My kids have a half day of school today, last day for the School year.
    Once things calm down here I'll look into the for ya.
    (Tossing snacks like you do at the Zoo) LOL
    Salute,
    Mark
    PS - I give them healthy snacks, we're health nuts. [​IMG]
    You can see my little health nuts in the fotos on my blog if you want.
    http://blogcastrepository.com/blogs/wisemx/default.aspx
     
  11. Mark,


    We have much in common. I lived in Seattle for 6 years - getting into the whole .com/net boom in the 90's. I left the field (and Seattle) for a while - took it easy... I have a wife and three kids as well. You have a Harley - I have a bicycle... (ok maybe that similarity is a stretch...)


    Since moving to NY, I have returned to software dev (albeita much different role)- but my roots in a good quality cup of java have always remained in tact (hence javasource... had good duality - I used to dev/test java and I drink more coffee than Starbucks can support). In fact, I ought to be considered a primary shareholder...


    Anyway, back to the problem at hand...


    My dilemma with this is getting ugly. I'd be willing to hand you the source code - if you find it easier - for the site. I'll leave that entirely up to you.


    When you look at the test site - you'll notice immediately that I used Asp login control that is tied to the asp membership/roles system (I'm sure you gathered this from the web.config...) That is what is killing me about this whole process. I didn't re-invent the wheel here, I allowed for the web.config to be created by VS2005 - and have only added a profile setting and changed the connection strings. So, where might I have gone wrong?


    Let me know what you need, and I'll graciously offer it to you. I'd rather learn my way through this one... that's just my nature.


    Regards,


    Mike
     
  12. Mark,


    You participated in a forum a year ago that seems to be the very problem I am encountering.


    http://community.discountasp.net/pr.aspx?f=16&amp;m=22935


    Could you take a look at this and verify whether or not this is the problem? I'm under the impression that it is... but the forum post is rather garbled and hard for me to understand the very solution. If this is a fix - could you reword it in a few simple steps? I would much appreciate it!


    Thanks,


    Mike
     
  13. Mark,


    Yeah, now I'm 99.9% sure that is the problem.


    I connected to the db on DASP via server explorer in VS2005. I opened a local web site solution - so that dev time wasn't unbearable. I created a new page called test.aspx and dropped a gridview on it. I made a new connection (Connection2) and saved that to my web.config. I configured the datasource to select all from a states table I have.


    To try it, check your email for the site url I sent last night. just add '/test.aspx' to the root url and you can see what I mean. All the state data displays. So, obviously I'm connecting to the db. I took that new connection string and replaced the other two with the same string (the only difference was 'initial provider'.) I then navigated back to the login url and tried to login. Still no go... So I doubt it is the web.config - and I know it's not the connection to the database. All signs point to the problem of membership/roles issues I mentioned in that post you participated in a year ago.


    So, my friend... any ideas?


    Mike
     
  14. Just getting back from the crazies. [​IMG]

    Yeah mun, I'm not only a long time biker but also a Bicycle nut.

    Grew up in Detroit (1961), my Dad in prison (All my life, have never even touched him.), grew up dirt poor.
    First started biking for School sports.
    Graduated in 1979 and bought a motorcycle for $30 from my Hockey Coach, in parts, lots of parts.
    Was sad times but made me tougher than nails I guess. [​IMG]

    Anyway, back to business...
    The choice to have me look at the site code is probably the best way and it will save you some frustration.
    If you e-mailed me, [email protected], I didn't get it, but I noticed there have been some mail outages today.
    Just PM me with your site login info and I'll connect with VS2008 Pro, then I'll be able to see what's up.

    You can trust me, to a fault.
    I do my best to be a man of integrity.
    Salute,
    Mark
     
  15. Mark,


    Well, as I received your message - I had just finished trying to do that regsql bit on your video. I did it do a database that already had the tables - so it doesn't appear as if anything happened.


    I did pm you (on here) last night. Check your private messages on DASP - but I'll send them to the email you provided as well.


    I'll send you the entireproject in a .rar file to your email. That way you can look at it from VS - without having to download.


    I'll be sending it from my work email....





    Cheers,


    Mike
     
  16. Sorry it took so long to get back, it's been quite a day. [​IMG]

    Do me a favor and use your connection string like this:

     
  17. Howdy...I got your messages and the site files.
    Since the site is using an Express DB rather than mount the DB in SQL Server on Vista I'm transferring over to my XP box.
    On that machine I've installed the Express tools only.
    btw, are you on Windows Server 2003/IIS6 here?
    So far the only change I've made is to run the site in debug mode.
    <compilation debug="true"/>

    You should test that way but never run it in production.
    Not only will it slow the site down it gives out too much information when a page bombs. [​IMG]

    If I don't get this finished for you tonight I'll get to it first thing in the morning, I'm whooped. [​IMG]
    Salute,
    Mark

    UPDATE: I was able to successfully run the site on my XP box.
    This tells me you may not have properly migrated the data to your SQL Server here or the connection string was wrong.
    If you want me to verify your SQL Server data e-mail the connection info and I'll connect from my SQL Server here.
    There are only two ways I can verify that part really, since the site roles did run for me.
    Whatever you want to do just let me know. I've had my shower and am going to go pass out now for the night. [​IMG]

    Post Edited (wisemx) : 5/23/2008 1:36:30 AM GMT
     
  18. Mark,


    I believe the connection data that you need is in the web.config file - unless the version I sent you was the local... As far as the compilation debug - I've had that enabled locally when testing - but delete it whenever I migrate the web.config to DASP- perhaps you received one of those versions. For dev, I'm using XP Pro - and DASP account is IIS 6.0 (Windows 2003).


    The dev IDE I use is VS2005 Professional edition (Visual Web Developer is part of that) - I'm not using VWD Express stand alone. The database is Sql Server 2005 Express.


    When you say that you were able to run the site on your xp box - do you mean that you were able to run it locally? I've had all the success in the world running it locally. All of the membership/roles functionality works beautifully. It's just when you upload that db to DASP you can't use the membership/roles functionality (you can't login). I'm quite certain that the connection strings are ok - because I can access other data tables/data from that db (on DASP - as noted in post where I navigate to /test.aspx page). As you may notice - I used the aspnetdb.mdf to store other tables, sprocs, etc.


    I'll send the connection string to your email immediately following this post.


    Thanks, brother!


    Mike
     
  19. Mark,

    As a side note... as I mentioned previously, I've been messing around with the regsql tool in .net 2.0. After clearing the data from the aspnet membership tables - and killing one of the key relationships to my other tables in that db- I used regsql to drop those membership tables from the site. After doing so, I checked sql management studio to verify they were gone. They were. I then used the tool to recreate the tables on the DASP server. Checked Sql Management studio, they were back - this time empty. I then opened my local copy of the site in VS2005 and modified the connection strings so that I wascommunicating tothe DASP db. I recreated a member/role and then tried to login - after syncing the local web.config with the DASP one (using the 'copy to' in VS2005). Still no go. As noted, I can view all of the states info in a gridview from the '.test.aspx' page - but can'[t use the login controls.

    just fyi - on what I've tried from my end...

    Mike
     
  20. Howdy mun,
    I've been outside running the Table saw all day, yes while babysitting my three kids. [​IMG]
    Fortunately they do not like the noise the saw makes, and they stay out of the way. [​IMG]

    As I was reading your post just now your e-mail with the conn string arrived.
    I'll look into it right now.

    btw, yes on my XP Pro SP3 box I ran your site locally with the Express DB.
    The conn string you sent with it was only for the Express DB.

    We're making headway so don't fret.
    Salute,
    Mark

    UPDATE: OK, just connected with SQL Server 2005, your data and security roles look good.
    Next step will be for me to use your local site code and modify it to connect to the remote SQL Server.
    Off I go...


    Post Edited (wisemx) : 5/23/2008 9:08:44 PM GMT
     
  21. Yeah table saws and kids dont seem to go well together. I've always had some trust issues with circular saws. I've really grown to love my chop saw...

    Anyway,

    I've been able to view the site from my local pc - using the DASP db. It's frustrating as heck...

    I've been screwing around alot with the site - in fact I just went through and ran the .sql scripts against it - dropping everything and repopulating it. Still no go. I think that was more out of desperation - cause I know I'm connecting to the db via the site. It's just that dang membership/roles/profile login bit that is killing me. Must be some setting in the config....

    We'll keep hacking away at this...
     
  22. I had the full boat out there today, not just the Table Saw.
    Was running raw boards, then chopping them for length, then the Circular saw, Belt sander, then finish sanding.
    As you can imagine my hands are sopolished right now they're sliding off the keys.
    Gets really bad when I saw nut trees but today it was all Eastern Hemlock I've been drying for 2 years.
    Came out really nice, no finish at all, aged to perfection. Love it that way. [​IMG]

    Anyway, good news, I just ran your code with your remote SQL Server.
    I'll ZIP up the project and e-mail it back to ya.
    Remember, I've got debugging enabled right now.
    When your all done change it to: <compilation debug="false"/>
    Salute,
    Mark
     
  23. SO, what did you do to make it work? You rock!


    What are you working on with the hemlock? I mean- what's the project?
     
  24. Mark,


    My friend, compadre, etc...


    I unzipped the goodies, removed the debug mode, and copied the files to the site (minus the appdata) folder. Still, when you go to the site, you cannot successfully login...


    Mike
     
  25. Mark,





    I need to get to my daughters softball practice (I coach) - I've sent you an email. Could you check that out?





    Regards,


    Mike
     
  26. The woodworking bit is really cool. I live in upstate NY - completely surrounded by woodland. I've a 5-acre pond that has turned my interest towards luremaking. I've done a fair share of woodwork myself - but have sort of reserved myself to turning wooden lures on my lathe. I then use those wooden forms as the forms for creating plastic replicas. Took a long time to find a plastic that would work for this... but a company called Smooth-on actaully sells a great product for this purpose.


    I also dabble in cabinets - as I love to work with my router.


    Anyway - I sent you an email regarding the disfunctional site. The problem is that everything works locally, it's just that dang DASP website that doesn't allow a user to login. I know you are an incredibly busy dude, but could you keep working with me on this thing?


    Thanks, man!


    Mike
     
  27. I got your message,worked on your site and just e-mailed you back.

    Wood working has been something I've been doing for a very long time.
    We owned a large forest on Sampson Mountain, while I owned Solomon Farms.
    During that time I traded with Saw mills, I cut/claim, they haul and saw.
    Then with those timbers I've built a lot of all wood houses.
    In our current house I'm replacing old 1960's mud walls with wood.
    The floors between the levels are 12", the walls run full length.

    One of my trademark projects is to create full wall book shelving all from the same tree.
    Shelves and splines, all hand drawn, leaving the inner bark face on the outer edge.

    Other wood projects I'm always doing are things like full wall Eagles made from tree root sections.
    Guess it fits since I'm a Wisecarver. [​IMG]
    Salute,
    Mark Wisecarver
     
  28. Mark and anyone else,

    First off... I would like to thank you for the effort you put into helping me along with this. I have recently discovered the problem and now have a fully functional site. The answer was buried in another post that I pointed you to. Simply put, this bug lies within Visual Studio. The problem is that you cannot use the website administration tool for membership/roles until you have careully configured the development environment.

    Although somewhat impractical/inconvenient for developers, you must do the following...

    IF you have already developed a site locally that you wish to publish remotely, this is the solution:

    Create a DASP account and purchase db add on - do not upload the ASPNET.DB. If you have a local database for non-membership data, feel free to upload and attach it. (if you're previous database has anymembership 'aspnet' datatables, use the SQL Server Hosting Toolkit's Database Publishing Wizard (google this if unfamiliar) tocreate a script withonly the NON-aspnet tables/objects (aspnet tables and objects are easy to identify, as they all folow thesame naming conventions). After creating the sql script, open SQL Server Management Studio, connect to your db,'add new query' past script into query window then execute it. Verify data integrity, then close SQL Server Management Studio.

    Create new website project in VS
    In Server Explorer, right click on Data Connections and Select 'Add Connection'
    Using the connection string provided by DASP, connect to the empty db.

    Now go to command prompt. (Start, run..., 'cmd')At the prompt, paste: cd C:\Windows\Microsoft.net\Framework\v2.0.50727
    hit enter

    then paste the following string (substitute you database info where prompted): aspnet_regsql.exe -S DBServerName -U DBLogin -P DBPassword -A all -d DBName
    hit enter

    After this process has completed, close DOS prompt and open web.config file in the new project.

    replace: <connectionStrings/>



    with <connectionStrings>
    <remove name="LocalSqlServer" />
    <add name="LocalSqlServer" connectionString="Data Source=DBServerName;Integrated Security=false;Initial Catalog=DBName;User ID=DBLogin;Password=DBPassword" providerName="System.Data.SqlClient" />
    </connectionStrings>
    Next, close visual studio. Using Windows explorer, copy and paste all of your development files (except those that already exist in your newly created project above). Navigate to where the new project resides and paste these files in the appropriate directory.
    Now re-open the new project. (Note: I needed to add (not replace)my old connection string to web.config file)

    On the VS menu, select Website, Website Configuration Tool (ASP.NET Configuration tool) and go ahead and create the users, roles, access rules as they apply to your site.

    Now use the copy to.., publishing wizard in VS - or even simpler, connect to your ftp site and copy and paste all project subfolders into your ftp root folder.

    Now have at it!
     
  29. Glad you got it working bro.[​IMG]
    If you saw my Membership Roles video you know aspnet_regsql.exe is my preferred method for this.
    I'm a big fan of Microsoft but absolutely hate the Express SQL products. [​IMG]
    Salute,
    Mark
     
  30. I love your site, the videos, the links. Without them, I never would've figured this out.


    Stay in touch - maybe wecan meet up in Sturgis if I ever get enough money to get my own Harley!


    ~Mike
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page