API
Version 7.x > API > error in codes due the migration from Kentico 5.5 to 7 View modes: 
User avatar
Member
Member
rafik - 11/5/2012 12:52:09 PM
   
error in codes due the migration from Kentico 5.5 to 7
Hello I have some trouble with my coding due the changes in codes from Kentico 5.5 to 7.
It's been 2 days try to figure out the errors but I didn't found the solution.

First error:

I get Error Cannot implicitly convert type 'CMS.DocumentEngine.TreeNodeDataSet' to 'System.Data.DataSet'. And 'CMS.DocumentEngine.TreeNode' does not contain a constructor that takes 3 arguments

The code for this part is

  public static void AddInDocsAndFields(Dictionary<string, List<string>> docsAndFields, List<string> keywordsList)
{
foreach (KeyValuePair<string, List<string>> pair in docsAndFields)
{
string key = pair.Key;
List<string> columns = pair.Value;
TreeProvider provider = new TreeProvider(CMSContext.CurrentUser);
DataSet set = provider.SelectNodes(CMSContext.CurrentSiteName, null, CMSContext.CurrentUser.PreferredCultureCode, false, key);
if (((set != null) && (set.Tables.Count != 0)) && (set.Tables[0].Rows.Count != 0))
{
for (int i = 0; i < set.Tables[0].Rows.Count; i++)
{
TreeNode node = new TreeNode(set.Tables[0].Rows, key, provider);
AddInFields(node, columns, keywordsList);
}
}
}
}

Second major error I get:

get_DataRow, I tried to found something similar but no success

   if (node2..Table.Columns.Contains(columns[j]))
{
string columnHtml = node2.get_DataRow()[columns[j]] as string;
list2 = GetJustNeededKeywords(columnHtml, node2.get_DocumentID().ToString(), keywordsAndUrlDocIds);
if ((list2 != null) && (list2.Count != 0))
{
str2 = replacer.ChangeKeywordsSgml(columnHtml, list2);
if (columnHtml != str2)
{
node2.SetValue(columns[j], str2);
flag = true;
}


Thank you for your time


User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 11/5/2012 7:43:29 PM
   
RE:error in codes due the migration from Kentico 5.5 to 7
Hello,

You can find all the API changes listed in the following blog posts together with the new methods and classes to use:

Changes from 5.5R2 to 6.0
Changes from 6.0 to 7.0

Best regards,
Boris Pocatko

User avatar
Guest
Rafik - 11/7/2012 1:33:53 PM
   
RE:error in codes due the migration from Kentico 5.5 to 7
I looked in the documents and the api doc of v7.
I figure out that a lot of changes happen.
But to do get_datarow().table.column.etc....

How we can get them now, i still don't get this part

My best regards

User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 11/14/2012 5:34:17 PM
   
RE:error in codes due the migration from Kentico 5.5 to 7
Hello,

Could you please let me know what is the type variable node2?

Best regards,
Boris Pocatko