in

dashCommerce

An ASP.NET Open Source e-Commerce Application

has Anyone gotten this thing to work on go daddy?

Last post 08-19-2009 7:56 PM by cscooper2000. 47 replies.
Page 2 of 4 (48 items) < Previous 1 2 3 4 Next >
Sort Posts: Previous Next
  • 05-13-2008 3:21 PM In reply to

    Re: has Anyone gotten this thing to work on go daddy?

    MAn if you can get this to work that would be great. Btw has anyone figured out how to get it to  work within a subdirectory lie root/commerce? 

  • 05-13-2008 3:48 PM In reply to

    Re: has Anyone gotten this thing to work on go daddy?

    While I don't have any beef with this, just be aware that you may lose the upgrade path in going this route. There is a reason we went to the version of SQL Server - the Full Test Index is one reason, but there are other things planned that will rely on the correct version of SQL Server.

    Provided you are OK with that, then the only thing you should need to do is replace the Search functionality. Now, if you plan on having your site make web service calls or http posts to third party sites (such as PayPal Pro), then you may have another problems down the road - depends on your host and thier configuration.

    BUT - to make this ALL GO AWAY - just host with us Smile 

    --
    Big Smile ~ Chris

    Open Source = Community = Shared Responsibility = Submit A Patch!
    Filed under:
  • 05-13-2008 4:30 PM In reply to

    Re: has Anyone gotten this thing to work on go daddy?

    I know i'm asking a lot here, but can you give me some idea of what problems I would run into ? I am implementing dash commerce in order to collect payments via Pay Pal, so your last statement kind of concerns me.

    How would full text search affect integration with pay pay?

    Thank YOu

  • 05-13-2008 5:52 PM In reply to

    • leftend
    • Top 100 Contributor
    • Joined on 03-05-2008
    • San Diego, CA
    • Posts 12

    Re: has Anyone gotten this thing to work on go daddy?

    OK, sorry I wasn't able to get this out sooner, but as promised, here's how to get around needing Full Text support on your database:

    First, under the "web/install/scripts" folder, copy the "storedprocedures.sql" file, and paste it into the same directory - renaming it to "storedprocedure_nofulltext.sql".  Then open it in your favorite text editor, and find the definition for the "dashCommerce_Store_ProductSearch" stored procedure.  Replace that definition with the one below and save the file:

     IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[dashCommerce_Store_ProductSearch]') AND type in (N'P', N'PC'))
    BEGIN
    EXEC dbo.sp_executesql @statement = N'
    CREATE PROCEDURE [dbo].[dashCommerce_Store_ProductSearch]
      @searchTerm nvarchar(100)
     
      -- searchTerm:  String of 1 or more search terms, all separated by spaces
      -- Results are returned in order of relevance
    AS
      BEGIN
        DECLARE @i1 int;
        DECLARE @i2 int;
        
        -- MatchType: 0=match any, 1 =match all, 2 = exact match of entire expression only
        DECLARE @MatchType int;
        SET @MatchType = 0
        
        DECLARE @Word varchar(100);
        DECLARE @Words table (Word varchar(100) not null);
        DECLARE @WordCount as integer;

        SET NOCOUNT ON

        -- Parse the searchTerm to extract all words:
        IF (@MatchType != 2)
          BEGIN
          SET @searchTerm = '' '' + @searchTerm  + '' '';
          SET @i1 = 1;
          WHILE (@i1 != 0)
            BEGIN
            SET @i2=charindex('' '', @searchTerm, @i1+1)
            IF (@i2 != 0)
              BEGIN
              SET @Word = RTRIM(LTRIM(SUBSTRING(@searchTerm, @i1+1, @i2-@i1)))
              IF @Word != '''' INSERT INTO @Words SELECT @Word
              END
            SET @i1 = @i2
            END
          END
        else
          INSERT INTO @Words SELECT LTRIM(RTRIM(@searchTerm))

        -- Get the total # of words:
        SET @WordCount = (SELECT COUNT(*) FROM @Words)

        -- Return Results in order of relevance:
        SELECT
           T.*, a.MatchPct
        FROM
          dashCommerce_Store_Product T
        INNER JOIN
          (
          SELECT
            ProductID, COUNT(*)  * 1.0 / @WordCount AS MatchPct
          FROM
            dashCommerce_Store_Product T
          INNER JOIN
            @Words W ON (
                '' '' + T.[Name] + '' '' LIKE ''%[^a-z]'' + Word + ''[^a-z]%''
                OR
                '' '' + T.[ShortDescription] + '' '' LIKE ''%[^a-z]'' + Word + ''[^a-z]%''
                OR
                '' '' + T.[BaseSku] + '' '' LIKE ''%[^a-z]'' + Word + ''[^a-z]%''
                )
          GROUP BY
            ProductID
          ) a ON T.ProductID = a.ProductID
        WHERE
          MatchPct = 1 OR @MatchType <>1
        ORDER BY
          MatchPct    
      END

    '
    END
    GO

    A couple quick notes about this procedure:

    - It was taken from an example found here:

    - Although it looks like there are double quotes (") in this script, there isn't - rather they are apostrophes (') - but they needed to be escaped because the script was failing when called through web install.  So what would normally be a single apostrophe (') becomes two ('') in this sql file. 

    - It supports searching on multiple words - the script splits the words apart, and performs a search on each one.

     

    OK, now the only thing left is to add an "appSetting" to the web.config:

     <appSettings>

        <add key="useFullTextIndex" value="false"/>

    </appSettings> 

    ... and finally, to modify the "database.ascx.cs" file under "web/install/controls".  First, within the "Constants" region, add this line:

    private const string SCRIPT_SPS_NO_FULL_TEXT = "~/install/scripts/storedprocedures_nofulltext.sql";

    Then, modify the RunScripts method to look like this:

    private void RunScripts(string connectionString) {
          //get setting
          bool useFullText = Boolean.Parse(System.Web.Configuration.WebConfigurationManager.AppSettings["useFullTextIndex"]);

          //Drop
          string[ dropStatements = GetScriptStatements(File.ReadAllText(Server.MapPath(SCRIPT_DROP), new System.Text.UTF8Encoding()));
          ExecuteStatements(dropStatements, connectionString);
          //Tables
          string[ tableStatements = GetScriptStatements(File.ReadAllText(Server.MapPath(SCRIPT_TABLES), new System.Text.UTF8Encoding()));
          ExecuteStatements(tableStatements, connectionString);
          if (useFullText)
          {
              //Full Text Catalog
              string[ fullTextStatements = GetScriptStatements(File.ReadAllText(Server.MapPath(SCRIPT_FULL_TEXT_CATALOG), new System.Text.UTF8Encoding()));
              ExecuteStatements(fullTextStatements, connectionString);
          }
          //Functions
          string[ functionStatements = GetScriptStatements(File.ReadAllText(Server.MapPath(SCRIPT_FUNCTIONS), new System.Text.UTF8Encoding()));
          ExecuteStatements(functionStatements, connectionString);
          //Views
          string[ viewStatements = GetScriptStatements(File.ReadAllText(Server.MapPath(SCRIPT_VIEWS), new System.Text.UTF8Encoding()));
          ExecuteStatements(viewStatements, connectionString);
          //Stored Procedures
          string spScript = useFullText ? SCRIPT_SPS : SCRIPT_SPS_NO_FULL_TEXT;
          string[ storedProcedureStatements = GetScriptStatements(File.ReadAllText(Server.MapPath(spScript), new System.Text.UTF8Encoding()));
          ExecuteStatements(storedProcedureStatements, connectionString);
          //Base Data
          string[ baseDataStatements = GetScriptStatements(File.ReadAllText(Server.MapPath(SCRIPT_BASE_DATA), new System.Text.UTF8Encoding()));
          ExecuteStatements(baseDataStatements, connectionString);
          //Membership
          string[ membershipStatements = GetScriptStatements(File.ReadAllText(Server.MapPath(SCRIPT_MEMBERSHIP_SCHEMA), new System.Text.UTF8Encoding()));
          ExecuteStatements(membershipStatements, connectionString);
          //Base Membership Data
          string[ baseMembershipDataStatements = GetScriptStatements(File.ReadAllText(Server.MapPath(SCRIPT_BASE_MEMBERSHIP_DATA), new System.Text.UTF8Encoding()));
          ExecuteStatements(baseMembershipDataStatements, connectionString);
        }

     

    There's really only a few lines that are changed in that method, I just thought it would be easier to post the whole thing so you could copy/paste if you want.

    That's it.  If the "useFullTextIndex" setting is "false" - then the web install will skip executing the "fulltextcatalog.sql" file, and call our custom "storedprocedures_nofulltext.sql" file instead of the default one.

    I'm pretty sure I got all the steps in there, please let me know if it helps you out. 

     

    @wlfman2k1: For me, all I had to do was set my subdirectory to be a virtual directory - and set it as the application root.  See one of my previous posts in this thread for the exact steps. 

  • 05-13-2008 5:54 PM In reply to

    • leftend
    • Top 100 Contributor
    • Joined on 03-05-2008
    • San Diego, CA
    • Posts 12

    Re: has Anyone gotten this thing to work on go daddy?

     Oops, forgot the link after this line:

    It was taken from an example found here:  http://weblogs.sqlteam.com/jeffs/archive/2004/11/02/2460.aspx

  • 05-13-2008 10:05 PM In reply to

    Re: has Anyone gotten this thing to work on go daddy?

    leftend, thanks for the hard work. Do you know if I will be required to build the solution before I upload to GoDaddy? The reason I ask is because I am running into problems building on my local system and also I am getting a Compilation Error after having uploaded the beta (unmodifed, unzipped and uploaded, that is)

    What I am trying to determine after reading everyone's posts is whether or not I have the system required to install DC 3.0 onto GoDaddy.

    I am running XP Home and using Visual Web Developer. I also have SQL Express 2005 installed.

    Compiler Error Message: CS0246: The type or namespace name 'MettleSystems' could not be found (are you missing a using directive or an assembly reference?)

    Source Error:

    [No relevant source lines]

  • 05-13-2008 10:13 PM In reply to

    Re: has Anyone gotten this thing to work on go daddy?

    To use the beta you will have build the solution before you Upload it to your web hoster.
    Check the Readm.txt file that is in the Web folder of the download.

    (If you download the latest from SVN then you can Build the site with the Scripts in the main Directory this does not require VS pro)

    Find a bug? Create a Work Item for a fast response.. Want to help? Create a patch for us!
  • 05-13-2008 10:52 PM In reply to

    Re: has Anyone gotten this thing to work on go daddy?

    this is not just thing

  • 05-14-2008 1:46 AM In reply to

    • leftend
    • Top 100 Contributor
    • Joined on 03-05-2008
    • San Diego, CA
    • Posts 12

    Re: has Anyone gotten this thing to work on go daddy?

    @phatPhil 

    Yeah, the change to the "database.ascx.cs" file was the thing that makes a recompile of the solution necessary.  Given the error you posted, I'm not sure what the issue might be.  Did you open the entire dashCommerce solution in Visual Studio?  What version of VS are you using?  I've been using 2005.  If you're using VS 2008, you MIGHT have to target ASP.NET version 2.0 instead of version 3.5 - I only say this because I haven't tried compiling the solution to target 3.5.

    Anyways, if that still doesn't help, you could STILL manually create the database using the SQL Server Web Admin tool.  Just open the Query Analyzer tool in there, and execute the scripts found in the "web/install/scripts" folder.  You'll need to run them in this order: 

    1) drop.sql, 2) tables.sql, 3) functions.sql, 4) views.sql, 5) storedprocedures_nofulltext.sql, 6) basedata.sql, 7) membership.sql, 8) basemembershipdata.sql

    **Please note, because you're running this directly against the database, you'll need to remove all the escaping that's currently in the "storedprocedure_nofulltext.sql" file.  The escaping is necessary if you're running this through the web install - but will NOT work if you're executing these scripts directly against the database like we are here.  To save you a little headache, replace the definition for the "dashCommerce_Store_ProductSearch" in this file, with the following version which has the escaping removed:

    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[dashCommerce_Store_ProductSearch]') AND type in (N'P', N'PC'))
    BEGIN
    EXEC dbo.sp_executesql @statement = N'
    CREATE PROCEDURE [dbo].[dashCommerce_Store_ProductSearch]
      @searchTerm nvarchar(100)
     
      -- searchTerm:  String of 1 or more search terms, all separated by spaces
      -- Results are returned in order of relevance
    AS
      BEGIN
        DECLARE @i1 int;
        DECLARE @i2 int;
        
        -- MatchType: 0=match any, 1 =match all, 2 = exact match of entire expression only
        DECLARE @MatchType int;
        SET @MatchType = 0
        
        DECLARE @Word varchar(100);
        DECLARE @Words table (Word varchar(100) not null);
        DECLARE @WordCount as integer;

        SET NOCOUNT ON

        -- Parse the searchTerm to extract all words:
        IF (@MatchType != 2)
          BEGIN
          SET @searchTerm = ' ' + @searchTerm  + ' ';
          SET @i1 = 1;
          WHILE (@i1 != 0)
            BEGIN
            SET @i2=charindex(' ', @searchTerm, @i1+1)
            IF (@i2 != 0)
              BEGIN
              SET @Word = RTRIM(LTRIM(SUBSTRING(@searchTerm, @i1+1, @i2-@i1)))
              IF @Word != '''' INSERT INTO @Words SELECT @Word
              END
            SET @i1 = @i2
            END
          END
        else
          INSERT INTO @Words SELECT LTRIM(RTRIM(@searchTerm))

        -- Get the total # of words:
        SET @WordCount = (SELECT COUNT(*) FROM @Words)

        -- Return Results in order of relevance:
        SELECT
           T.*, a.MatchPct
        FROM
          dashCommerce_Store_Product T
        INNER JOIN
          (
          SELECT
            ProductID, COUNT(*)  * 1.0 / @WordCount AS MatchPct
          FROM
            dashCommerce_Store_Product T
          INNER JOIN
            @Words W ON (
                ' ' + T.[Name] + ' ' LIKE '%[^a-z]' + Word + '[^a-z]%'
                OR
                ' ' + T.[ShortDescription] + ' ' LIKE '%[^a-z]' + Word + '[^a-z]%'
                OR
                ' ' + T.[BaseSku] + ' ' LIKE '%[^a-z]' + Word + '[^a-z]%'
                )
          GROUP BY
            ProductID
          ) a ON T.ProductID = a.ProductID
        WHERE
          MatchPct = 1 OR @MatchType <>1
        ORDER BY
          MatchPct    
      END

    '
    END
    GO

    Once you've done all that, you'll need to manually set your connection string in the "connectionString.config" file before you do anything else.  I *think* that you can then step into the next steps in the installation by browsing to this url: (www.[yourdomainname].com/install/install.aspx?step=3).  In my case, dashCommerce is installed under a "dev" subdirectory, so in my case the url would be: (www.[yourdomainname].com/dev/install/install.aspx?step=3).  This page should allow you to setup your Administrator account, and then complete the installation. 

    Hope that helps! 

  • 05-15-2008 12:04 AM In reply to

    Re: has Anyone gotten this thing to work on go daddy?

    Did you chance mean to be declaring Arrays of the String type? I see a lot of --> string[ <-- and Intellisense is saying "expected ;" I'm not that experienced with the code to know for sure, but based on my limited knowledge this is my best guess.

    Much appreciated.

  • 05-15-2008 12:09 AM In reply to

    Re: has Anyone gotten this thing to work on go daddy?

    Okay, I'm pretty sure you meant string[ in your listing of the RunScripts() method so I put the missing right brackets in and compiled successfully.

  • 05-15-2008 12:13 AM In reply to

    Re: has Anyone gotten this thing to work on go daddy?

    I got this error on Step 1 of the dc install wizard (see below) so I had to add the letter "s" to the name of the stored procedure file located in the directory referenced in the error message in order to continue.

     Message Center

     A critical error has occurred: Could not find file 'D:\CSM\Resources\Starter Kits\dashCommerce_3_0_RC1\dashCommerce\Web\install\scripts\storedprocedures_nofulltext.sql'.
  • 05-15-2008 12:38 AM In reply to

    Re: has Anyone gotten this thing to work on go daddy?

    To all the people using Visual Web Developer and running into problems,

    You can do what I did and download the 90-day trial of Visual Studio 2005 from Microsoft (search their site). It took me about 2.25 hours at 300k over a DSL wired connection.

    Once you do that then step 2 is to install SP 1 which will enable you to work with web projects.

    Once you do that then step 3 is to install AJAX extensions 1.0 if you are using .net framework 2.0.

    Note: the order of install from step 2 to step 3 is important. I did mine out of order and got an error about Scriptmanager not matching the type Scriptmanager.

  • 05-15-2008 2:48 AM In reply to

    • leftend
    • Top 100 Contributor
    • Joined on 03-05-2008
    • San Diego, CA
    • Posts 12

    Re: has Anyone gotten this thing to work on go daddy?

    phatPhil:

    Okay, I'm pretty sure you meant string[ in your listing of the RunScripts() method so I put the missing right brackets in and compiled successfully.

     

    Sorry about that, I just noticed that.  For some reason, when I pasted it in - it looks like it removed the ending bracket. 

  • 07-04-2008 8:40 AM In reply to

    • zcerkez
    • Not Ranked
    • Joined on 06-23-2008
    • Belgrade
    • Posts 1

    Re: has Anyone gotten this thing to work on go daddy?

    What was happened with your installation. I also have problems with godaddy. Do you have some advice for me.

    Zoran Cerkez
Page 2 of 4 (48 items) < Previous 1 2 3 4 Next >