Hi I would like to connect to a database and both receive and insert data into tables via SQL. How can you do that in nav 2013? I dont mean the database on which NAV is running
In C# it would look something like this:
string DB = "nav104_final";
string Table = "[Kjærulff Fodpleje A_S$Item]";
string Kolonne = "[Item Disc_ Group]";
string NO = line.No;
ProjectConnection connect = new ProjectConnection();
connect.GetDWIConnection(dwiServer, DB);
SqlDataReader MyOrderReader = null;
string Query = "SELECT " + Kolonne + " FROM " + Table + " WHERE " + "[No_] = " + "'" + NO + "'";
SqlCommand MySQLCommand = new SqlCommand(Query, ProjectConnection.dwiConnection);
MyOrderReader = MySQLCommand.ExecuteReader();
MyOrderReader.Read();
string result = string.Format("{0}",MyOrderReader[0]);
MyOrderReader.Close();
*This post is locked for comments