User Profile

Collapse

Profile Sidebar

Collapse
djpaul
djpaul
Last Activity: Nov 25 '12, 11:33 PM
Joined: Oct 27 '06
Location: Netherlands
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • djpaul
    replied to Converting php code to c#
    Hello,
    This was my solution. After a lot of testing, it works great now! It's a part of the free Prestashop online store.

    Code:
    public static void ReGenerateEntireTree()
           {
               DataTable Table = SelectQuery("SELECT id_category, id_parent FROM ps_category ORDER BY id_parent ASC, position ASC");
               Dictionary<int, int> categoryArray = new Dictionary<int,int>();
    ...
    See more | Go to post

    Leave a comment:


  • djpaul
    replied to Converting php code to c#
    Never mind, I resolved the prob...
    Thanks anyway!
    See more | Go to post

    Leave a comment:


  • djpaul
    started a topic Converting php code to c#

    Converting php code to c#

    Hello,
    I am converting a php code to c# but I'm stuck.. Or the code is stuck. whatever.. :)
    In the second function, it keeps on looping now (of course) but I can't figure out who, why, or what.

    First the original php code (from prestashop). The code sets the left and right values in the database. This is for the breadcrumb.
    Code:
    public static function regenerateEntireNtree()
    	{
    		$categories = Db::getInstance()->ExecuteS('SELECT
    ...
    See more | Go to post

  • djpaul
    started a topic Read xlsx file in xml document

    Read xlsx file in xml document

    Hello,
    I'm trying to load a xlsx file into an XmlDocument and want to read some values within that document.
    What I did:
    Extract the Xlsx file to a temporary folder and loaded the 'xl\worksheets\ sheet1.xml' into the xmlDocument.
    But after that it looks almost impossible to get data out of it.

    This is my code:
    Code:
    xml.Load(TempFolder + "xl\\worksheets\\sheet1.xml");
    XmlNodeList elemList
    ...
    See more | Go to post

  • djpaul
    started a topic Replace bbcode with increment value
    in PHP

    Replace bbcode with increment value

    Hello,
    I have an text field where some bb codes are in.
    So i want 1 kind of bbcode to be replaced with some other data and add a number for the css.
    The bbcode [readmore] has to be replaced with:
    Code:
    <pre><a class="show_hide" href="#" rel="#slidingDiv_x">View</a></pre><div id="slidingDiv_x" class="toggleDiv" style="display: none;">
    ...
    See more | Go to post

  • djpaul
    replied to Select right price by products..
    Well, done that and it''s working!
    Jees, what a query was that!

    Added this:
    Code:
    ...LEFT OUTER JOIN
      (SELECT id, onze_prijs, producten_id, verwijderings_bijdrage_id
                                FROM(SELECT MAX(id) as maxid
                                FROM(producten_prijzen)
                                      GROUP BY producten_id)
                                 AS x
         INNER JOIN producten_prijzen
    ...
    See more | Go to post

    Leave a comment:


  • djpaul
    replied to Select right price by products..
    Well, i have this query but i have 2 prices for this product.
    And it returns 2 records.

    Code:
    SELECT p.id, artikel, merk, type, onze_prijs, garantie, verwijderings_bijdrage.bedrag,
                                (producten_historie.aantal_ingekocht - (p.uitgeleend + p.reparatie) - producten_historie.aantal_verkocht) AS Stock
                                FROM producten as p 
                                INNER JOIN
    ...
    See more | Go to post

    Leave a comment:


  • djpaul
    started a topic Select right price by products..

    Select right price by products..

    Hello,
    I have a database for my products.
    In there is a table with all the products and there is a table with te actual prices.
    I need to select a product and inner join the price table an get the latest (read latest id) from the price table.

    What is the best way?
    Code:
    Table structure:
    products:
    ID               int(3) PK
    Description     text
    value           varchar(250)
    lokation
    ...
    See more | Go to post

  • djpaul
    started a topic Currency in datatable

    Currency in datatable

    Hello!
    I am recieving data from my database and i want to view the data in a datagridview.
    So, i wrote the query:
    Code:
    Dim Sql as String
    Sql = "SELECT workorder.ID, merk.merk, type.type, workorder.klacht, CONCAT('€', CONVERT(workorder.totaal, CHAR)) AS totaal
                  FROM workorder
                  INNER JOIN merk ON workorder.merk_id = merk.id
                  INNER JOIN type ON workorder.type_id
    ...
    See more | Go to post

  • djpaul
    replied to Select rows with inner join and max id
    Well, i finally found the answer.
    A lot of testing, but it's working fine now.
    Thanks for your support!
    See more | Go to post

    Leave a comment:


  • djpaul
    replied to Select rows with inner join and max id
    Well, the query did work but with the same (wrong) results.
    This is what i changed:
    Code:
        SELECT verkoop_order.sub_totaal, verkoop_order.btw_percentage, verkoop_order.btw_bedrag, verkoop_order.verzendkosten,
                        verkoop_order.datum_verkoop, verkoop.artikel_groep, verkoop.Omschrijving,
                        verwijderings_bijdrage.bedrag AS verwijderingsbijdrage, verkoop.Aantal, (
       SELECT prijs
    ...
    See more | Go to post

    Leave a comment:


  • djpaul
    replied to Select rows with inner join and max id
    Sadly it doesn't work..
    Uuuhhmmm maybe this will help you more to understand it.

    In the invoice i sold 2 devices.
    1 laser and 1 led effect.
    The laser has 2 prices
    So i get this result
    Code:
    quantity    description    price
    1           Laser          99,-
    1           Laser          99,-
    1           Led effect     79,-
    But i want:
    Code:
    quantity    description
    ...
    See more | Go to post

    Leave a comment:


  • djpaul
    replied to Select rows with inner join and max id
    table price
    Code:
    ID  product_id   price
    1       1        99,-
    2       1        79,-
    3       1        89,-
    4       2        40,-
    Product list:
    Code:
    product_id     make_id     type_id      category_id
    1              1           3            1
    2              2           4            7
    The results must be:
    Code:
    Make              quantity      price
    ...
    See more | Go to post

    Leave a comment:


  • djpaul
    replied to Select rows with inner join and max id
    Well i know, but it's hard to explain...
    Simple said.. when there are 2 or more records in the price table of that product, it is shown also that many times.
    But when i use another product (with 1 price record) more then once it now shows 1 record.
    But before the change i made (without the GROUP BY) it shows the correct rows but if that product has 2 or more prices it shows for every price a row.
    In the above example i did...
    See more | Go to post

    Leave a comment:


  • djpaul
    replied to Select rows with inner join and max id
    Let's try:
    Last week i sold 1 laser and 1 light effect.
    But the laser had 2 prices in his table (producten_prij zen)
    When i roll it out this came up:
    Laser American Dj micro galaxian 0,00 1 95,00 95,00
    Laser American Dj micro galaxian 0,00 1 95,00 95,00
    Led effect American Dj Jewel led 0,00 1 69,00 69,00

    So i changed it at the end with a GROUP BY
    So i thought...
    See more | Go to post

    Leave a comment:


  • djpaul
    started a topic Select rows with inner join and max id

    Select rows with inner join and max id

    Hello,
    I have wrote this query but it's not completely right.
    In my database are more tables and 1 of those tables contains more rows about a product (prices).
    So when i want to select the records from a invoice with for example 3 products from the same id en 2 products from another id, it has to show all rows in that invoice but with the last added price.

    This is my query so far:
    Code:
    SELECT verkoop_order.sub_totaal,
    ...
    See more | Go to post

  • djpaul
    replied to no results in WHERE LIKE without capital
    Well, it was the collation.
    1 column was set to latin and the other was set to (i think is was..) latin1_ch
    Changed to latin1 and it worked!

    Thanks!
    See more | Go to post

    Leave a comment:


  • djpaul
    started a topic no results in WHERE LIKE without capital

    no results in WHERE LIKE without capital

    Hello!
    I have this query but it only works if the first letter is a capital.

    This is the query:
    Code:
    SELECT id, companyname, city FROM crediteuren 
    WHERE ( companyname LIKE '%Someon%' ) OR (city LIKE '%Someon%' )
    ORDER BY companyname
    And this doesn't work....:
    Code:
    SELECT id, companyname, city FROM crediteuren 
    WHERE ( companyname LIKE '%someon%' ) OR (city LIKE '%someon%' )
    ORDER
    ...
    See more | Go to post

  • djpaul
    started a topic Declare a variable inside your program

    Declare a variable inside your program

    Hello,
    I am busy making a program to create scripts.
    In there i also want to use variables.
    But how can i declare a new variable just by entering a name and selecting a type (eg, string, int, float etc) on a form??

    Thanks!
    Paul
    See more | Go to post

  • djpaul
    replied to Trigger public sub Test()
    Thanks Joseph!
    It works now!

    Greetz, Paul
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...