Absolute Beginner Newbie Questions - Sorry to ask

Discussion in 'ASP.NET WebServices' started by wisemx, Nov 7, 2008.

  1. Hi,
    Those aren't stupid questions...You deserve credit for being honest. [​IMG]
    First off...I'm working on Webcasts for DASP, they are in the first link below.
    Some of those may help you at this point.
    The main consideration being, DASP servers do NOT support Express Databases.
    DASP does however have a very good Attach feature for SQL Server 2005 and 2008.
    With it you can get your Express DB on-line.
    You will however need to add a SQL Server 2005 or 2008 to your account first.
    A few of my videos in the link below cover each aspect of that Attach feature.

    What I would recommend is you download the latest version of SQL Server 2008 Express.
    With it you can merge your data into one DB and you can both export and import your local to remote records.
    SQL Server 2008 Expressis the first Express version to offer that power, for free.

    As you need additonal help feel free to repost.
    Salute,
    Mark



    Technical Evangelist for DiscountASP.NET
    http://www.iis7test.com/webcasts/
    http://weblogs.asp.net/markwisecarver/
    http://blogs.windowsclient.net/wisecarver/default.aspx

    (Microsoft IT Usability http://msitusability.multiply.com/)
     
  2. VOG

    VOG

    [​IMG]The past 5 months I have been working on an ASP NET 3.51 website with SQL Server, Visual Studio 2008 and Ajax. I finally have it working under VS 2008 and want to deploy it and have some real basic questions. There are 2 databases one is the ASPNETDB.mdf for membership and another custom DB. First question is how do I deploy the databases to the server. I want to use the VS 2008 publish website feature, will it upload everything or do I need to backup and restore the databases. Also, do I just publish to the site the existing folder structure that is on my development computer or is there something else I need to do. Last I assume I change the name of my databases to the name provides and use the connection string provided. I never left the VS environment, is there anything else I need to do to the databases. THey don;t have any passwords or such, I created them in VS and did all the editing there.

    Sorry for what is probably stupid questions, any help is greatly appreciated.
     
  3. VOG

    VOG

    I loaded SQL Server Express 2008 and ordered a SQL Server 2008 Database on DASP. I have been trying to consolidate the ASPNETDB and a custom database for a couple of days now. I was not able to use asp_sqlreg as I would get an error 40 when I tried to browse for a database. I used the copy tool (in SQL Server Express) to import all the tables from the custome database into ASPNETDB and then used create new query editor window to copy the stored procedures from the custom db to the ASPNETDB. I changed ASPNETDB's name to the custom database name and deleted the ASPNETDB connection string in the web.config file. I now have a single database that includes the ASPNETDB + custome database tables and stored procedures. My program doesn't seem to know that the custome database is to be used for membership. The database is in the App_Data folder.


    Before I try to upload the application I wanted to consolidate the databases and use the consolidated database in Visual Studion 2008 to make sure everything works prior to hosting.


    Is there something I need to do to tell the application that the custom database should be used for membership / login as well? Any suggestion would be appreciated. I think I am getting closer, however, I am pulling out the little hair I have left. I did have SQL Server Express 2005 loaded but uninstalled it before installing SQL Server Express 2008 and VS 2008 Professional SP1.
     
  4. VOG

    VOG

    I am using the following code in my program that is working, 2 constructors and 2 connections. When I consolidated the 2 databases manually into ASPNETDB, changed its name to ClaimsCSIand used the single ClaimsCSIConnectionString membership the program didn't work (on my local machine). I have been searching for about a week how to do mash the two together and get it to work. Again thanks for any help, I have 5 books on my desk, but nothing tells how to get out of SQL Server Express to SQL Server in steps. Very hard for a beginner.


    <connectionStrings>


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


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


    </connectionStrings>





    Public Sub New()


    connectionstring = WebConfigurationManager.ConnectionStrings("ASPDBConnectionString").ConnectionString


    End Sub


    Public Sub New()


    connectionstring = WebConfigurationManager.ConnectionStrings("ClaimsCSIConnectionString").ConnectionString


    End Sub
     
  5. Hi,
    If you have two Express DBs that work and you are trying to merge them into one...
    Stick with the aspnetdb and import the other objects into it with SQL Server 2008 Express.


    If you can't figure out how to do that and want help ZIP or RAR those 2 Express DBs and Email them to me.
    I'll create a video using SQL Server Express 2008 and show how it can be done.
    There are actually several methods that can be used, Merge, Script and Export all work well for this.
    [email protected]


    Salute,
    Mark




    Technical Evangelist for DiscountASP.NET
    http://www.iis7test.com/webcasts/
    http://weblogs.asp.net/markwisecarver/
    http://blogs.windowsclient.net/wisecarver/default.aspx

    (Microsoft IT Usability http://msitusability.multiply.com/)
     
  6. VOG

    VOG

    Mark,


    Thanks. I am trying to not be a pain in the ass newbie, just I probably read a hundred forum links, and wow there is a lot to this. I was unable to use asp_sqlreg to combine the dataases. I did use SQL Server Express Import to get all the tables into ASPNETDB from my custom DB. Also used SQL Server to get the stored procedures into ASPNETDB as well. I will change the name of ASPNETDB to the DASP database name and change my connection strings and web configuration as well. Hopefully, it will run on my local VS 2008 with no problems. If so I'll then send it up to DASP. If for whatever reason my database combining efforts were unsuccessful I'll zip the two to you to combine, along with a very big thank you.


    Best regards,


    Steven
     
  7. Hi,
    You are not being a pain. [​IMG]
    I keep an XP SP3 Intel based PC updated here with the Express tools just to help in the forums.
    (On my Vista development machine Iuse VS2008 Pro, Expression Studio 2and SQL Server 2008 Enterprise.)

    At any rate I hope you can pull it off so you can put a notch in your belt but if you need help I'm standing by.
    Salute,
    Mark



    Technical Evangelist for DiscountASP.NET
    http://www.iis7test.com/webcasts/
    http://weblogs.asp.net/markwisecarver/
    http://blogs.windowsclient.net/wisecarver/default.aspx

    (Microsoft IT Usability http://msitusability.multiply.com/)
     
  8. VOG

    VOG

    Mark,


    OK, my database consolidation seemed to work. After combining I deleted the custom db, reference in the web.config, modified all the constructors and table adaptors to the ASPNETDB connection string. All seems to be working in VS. I will use your video to upload the database to DASP. I take it that SQL Server will be smart enough to know the DASP database contains membership info and all I need to do now is change the web.config connection string and all will work. I ask because locally if I tried to use any name other than ASPNETDB VS created a new ASPNETDB and the program couldn't find any membership info.


    Thanks,


    Steven
     
  9. Vog,

    By default .Net membership/roles provider uses the connection name 'LocalSQLServer' as the primary database connection for its membership and roles. So if you are going to be using your local database as a means to test your membership/roles, you may want to make sure 'LocalSQLServer' is pointing to the correct local database. Keep in mind once you uploaded the application to our server and you want it to use your SQL 2008 addon on our SQL server, the connection string will have to be altered to specify our server and not your local database.

    rcp
    DiscountASP.NET
    www.DiscountASP.NET
     
  10. VOG

    VOG

    [​IMG]
    Mark,

    Got it up and running, and learned a whole bunch too, pesky machine.config.

    Steven
     
  11. VOG

    VOG

    Mark,


    I created the databases and published the web site. I am getting this error. I am not quite sure what to do. I can find my local machine.config file, do I make changes and publish the site again. Also I am using Vista and not able to save any changes to the file. Any suggestions would help here.


    Thanks,


    Steven


    P.S. - This has been very interesting. After doing the database attach and publish, it seems pretty straight forward.
    Configuration Error


    Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

    Parser Error Message: The connection name 'LocalSqlServer' was not found in the applications configuration or the connection string is empty.

    Source Error:





    Code:
    Line 157:        <roleManager>
    Line 158:            <providers>
    Line 159:                <add name="AspNetSqlRoleProvider" connectionStringName="LocalSqlServer" applicationName="/" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
    Line 160:                <add name="AspNetWindowsTokenRoleProvider" applicationName="/" type="System.Web.Security.WindowsTokenRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
    Line 161:            </providers>
    Source File: C:\Windows\Microsoft.NET\Framework\v2.0.50727\Config\machine.config Line: 159
     
  12. Hi,
    Postthe connection strings section of your web.config, just comment out the passwords.



    Tips: On Vista always start VWD or VS as an Admin.
    Even if you are logged in as Admin it won't run them as Admin unless you change the shortcut.
    Also...don't place any project in the "Program Files" folders. Vista has UAC babies over that.
    Salute.
    Mark



    Technical Evangelist for DiscountASP.NET
    http://www.iis7test.com/webcasts/
    http://weblogs.asp.net/markwisecarver/
    http://blogs.windowsclient.net/wisecarver/default.aspx

    (Microsoft IT Usability http://msitusability.multiply.com/)
     
  13. Hi,
    Once you Attach the Express DB here you will be using the conn string that is provided in your Control Panel.
    Look in the Data section of these forums and you can see some of my recent posts concerning this.
    For example, Clear, Remove and Add...and making your remote pagtes look in the right place for everything.
    If you need me to create a connection section for your web.config just post the info in your CP, minus the password.

    (I just love saying "connection section") [​IMG]
    Salute,
    Mark



    Technical Evangelist for DiscountASP.NET
    http://www.iis7test.com/webcasts/
    http://weblogs.asp.net/markwisecarver/
    http://blogs.windowsclient.net/wisecarver/default.aspx

    (Microsoft IT Usability http://msitusability.multiply.com/)
     

Share This Page