how to insert table data using dotNet and sql server

somnathsomnath Member Posts: 3
edited 2009-02-11 in SQL General
Hi
Any one knows how insert data in sql server through navision database tables using aspdotNet.

Comments

  • kinekine Member Posts: 12,562
    And why you want to do that? Do you want to write into standard tables or into some special tables just for this purpose?
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • jlandeenjlandeen Member Posts: 524
    I think it really depends on what you're trying to do - are you using staging tables? Have you looked into using C/ODBC?
    Jeff Landeen - Sr. Consultant
    Epimatic Corp.

    http://www.epimatic.com
  • somnathsomnath Member Posts: 3
    I need use it on line concept using dot net to acess Navision data base which is in sql server
  • garakgarak Member Posts: 3,263
    edited 2009-02-11
    if you need to write datas from your asp.net site into a sql database use the .net functionality. If the NAV database is on the sql server you can handle the database like some other sql database.
    If you then want to run some NAV code (C/AL like in codeunits, triggers or so) you must run a Client or better a NAS that process your datas which are written from asp.net application into the database.
    But doen't forgett: If you write datas into a navision table (like Sales Header) the Navision C/AL code (business logic) will not run, because only a Nav / NAS Client can run this code.
    So, better is to use a Pre-Preocess table. Store there all infos and the NAS process this datas.

    Is it that what you need?
    Do you make it right, it works too!
  • jlandeenjlandeen Member Posts: 524
    I would always be very careful about writing to SQL tables that are Navision controlled. Navision is picky about it's data types and underlying structures and if any external application writes invalid data to a Navision table this can corrupt your system.

    My general recommendation to clients and other developers when trying to access Navision via SQL through other non Navision client methods is: 1) for read access to data simply read from the tables via SQL directly 2) for write access make sure to use a staging table, MSMQ, C/ODBC or other Navision supported and controlled integration method. This will then ensure that any business logic and data validation is fully controlled by Navision.
    Jeff Landeen - Sr. Consultant
    Epimatic Corp.

    http://www.epimatic.com
  • DenSterDenSter Member Posts: 8,307
    I agree 100% with Jeff. Maybe we should have a sticky subject with that answer :)
  • garakgarak Member Posts: 3,263
    read this, it's the same principle and it will open your eyes.

    viewtopic.php?f=23&t=31374
    viewtopic.php?f=23&t=31713
    Do you make it right, it works too!
  • jlandeenjlandeen Member Posts: 524
    thnx Daniel :wink:
    Jeff Landeen - Sr. Consultant
    Epimatic Corp.

    http://www.epimatic.com
Sign In or Register to comment.