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

Announcements

No record found.

News and Announcements icon
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

  • Suggested answer
    keoma Profile Picture
    32,729 on at

    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

    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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans