web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Dot net variables in NAV 2013 R2

(0) ShareShare
ReportReport
Posted on by 205

Using Dot Net variable I am Selecting record from External SQL table (Separate DB), To read a data I used SQLREADER. Once I read the data from SQL I want to update the Boolean field true which is available in External table. How to Achieve " Update Query "  Using Data Adapter, and  how to initialize data adapter using CAL code.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    keoma Profile Picture
    32,729 on at
    RE: Dot net variables in NAV 2013 R2

    hi

    to update the value you do not need the sqldatareader.

    you need sqlconnection and sqlcommand.

    in c# the code it's like that:

    using (SqlConnection connection = new SqlConnection(

                  connectionString))

       {

           SqlCommand command = new SqlCommand(queryString, connection);

           command.Connection.Open();

           command.ExecuteNonQuery();

       }

    queryString is a string/text variable, e.g. queryString = "update table1 set boolVar=true where id=@id";

    not a big thing to adopt it to c/al.

    you'll find tons of infos and tutorials about that topic.

  • Rashed Profile Picture
    3,765 on at
    RE: Dot net variables in NAV 2013 R2

    here is a link with example in cal.  

    mibuso.com/.../using-ado-on-rtc-in-nav

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans