We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

KanbanBoard - SQL Database Issue with Assignee (Swimlane)

Hi there!

So, I've been working with putting a Database into my Kanban project and I ended up getting everything working. I also checked out the example you gave someone on thread 134560.

So, I have an issue where when I add in and read the KanbanModels from the database and add it to a specific assignee (in swimlane view), the card does not show up, but it gets added to the count of items for the column? So, I stepped through the program completely and checked to make sure all of the calls and variables and types were correct, but I was unable to fix it. 

I even went off of your example you gave on that thread with no luck. I created the ObservableCollection<KanbanModel> and did the same setup but with no luck, even by setting the KanabanControl.ItemsSource equal to the collection and I even tried to manually Bind from Xaml, also with no luck. 

Currently, I switched to the Basic UI view by taking away the Assignee parameter, and it works perfectly....? All I did was take out the Assignee property within the model creation and all to go back to the UI without swimlane. 

I was adding into the db like this, where cols are setup as (ID, Title, Description, Category, ColorKey, Tags) and ID is the primary key which auto increments:
           
  1.                 db.Open();
  2.                 SqliteCommand insertCommand = new SqliteCommand();
  3.                 insertCommand.Connection = db;

  4.                 // Use parameterized query to prevent SQL injection attacks
  5.                 insertCommand.CommandText = "INSERT INTO MyTable VALUES (NULL, @title, @desc, @categ, @colorKey, @tags);";
  6.                 insertCommand.Parameters.AddWithValue("@title", title);
  7.                 insertCommand.Parameters.AddWithValue("@desc", desc);
  8.                 insertCommand.Parameters.AddWithValue("@categ", categ);
  9.                 insertCommand.Parameters.AddWithValue("@colorKey", colorKey);
  10.                 insertCommand.Parameters.AddWithValue("@tags", tags);
  11.                 insertCommand.ExecuteReader();
  12.                 db.Close();

I was getting the data from the db like this, though I've tried many different ways to get it to work and nothing helped, including how yours was setup. The code below is currently in the GetData function which returns the observable collection:
  1.                ObservableCollection<KanbanModel> tasks = new ObservableCollection<KanbanModel>();
  2.  
  3.             // Get tasks and return the collection
  4.             using (SqliteConnection db =
  5.                 new SqliteConnection("Filename=sqliteNewTest.db"))
  6.             {
  7.                 db.Open();
  8.  
  9.                 SqliteCommand selectCommand = new SqliteCommand
  10.                     ("SELECT Id, Title, Description, Category, ColorKey, Tags from MyTable", db);
  11.  
  12.                 SqliteDataReader query = selectCommand.ExecuteReader();
  13.  
  14.                 // Query the db and get the tasks
  15.                 while (query.Read())
  16.                 {
  17.                     KanbanModel row = new KanbanModel()
  18.                     {
  19.                         ID = query.GetString(0),
  20.                         Title = query.GetString(1),
  21.                         Description = query.GetString(2),
  22.                         Category = query.GetString(3),
  23.                         ColorKey = query.GetString(4),
  24.                         Tags = query.GetString(5).Split(",") // Turn string of tags into string array, fills listview
  25.                     };
  26.                     tasks.Add(row);
  27.                 }
  28.                 db.Close();
  29.             }
  30.             return tasks;
 
Once GetData() returns, it's being set to the ItemSource of Kanban, i.e., kanbanControl.ItemsSource = DataAccess.GetData(); 

Just for the context again, I did go off of your example from the thread listed above, and had the ObservableCollection placed in the same area as you, but no luck :( Really wanted to use the Swimlane view both for appearances and to use myself after I'm finished with the program. If you'd like a copy of my project to test, I'll attach it but please let me know. Would love to get this issue figured out! 

As I said, I did remove the Assignee property for the KanbanModels and that took it out of Swimlane view, which made things work fine. So, I just took it out of the table completely and as of right now I took away the option for the user to add their own Assignee. It was working perfectly before I started working with a database too. 


15 Replies

HU Hunter June 4, 2019 06:12 PM UTC

^^^ Pertaining to the above code. 

So, before hand, when I had the assignee property in, the AddData function would have an extra parameter in there (also the values are passed as a parameter to AddData:
  1.                 db.Open();
  2.                 SqliteCommand insertCommand = new SqliteCommand();
  3.                 insertCommand.Connection = db;

  4.                 // Use parameterized query to prevent SQL injection attacks
  5.                 insertCommand.CommandText = "INSERT INTO MyTable VALUES (NULL, @title, @assignee, @desc, @categ, @colorKey, @tags);";
  6.                 insertCommand.Parameters.AddWithValue("@title", title);
  7.                 insertCommand.Parameters.AddWithValue("@assignee", assignee);
  8.                 insertCommand.Parameters.AddWithValue("@desc", desc);
  9.                 insertCommand.Parameters.AddWithValue("@categ", categ);
  10.                 insertCommand.Parameters.AddWithValue("@colorKey", colorKey);
  11.                 insertCommand.Parameters.AddWithValue("@tags", tags);
  12.                 insertCommand.ExecuteReader();
  13.                 db.Close();

and then if I were to have the assignee property in the GetData function, then it'd look as follows: 
  1.    ObservableCollection<KanbanModel> tasks = new ObservableCollection<KanbanModel>();
  2.  
  3.             // Get tasks and return the collection
  4.             using (SqliteConnection db =
  5.                 new SqliteConnection("Filename=sqliteNewTest.db"))
  6.             {
  7.                 db.Open();
  8.  
  9.                 SqliteCommand selectCommand = new SqliteCommand
  10.                     ("SELECT Id, Title, Assignee, Description, Category, ColorKey, Tags from MyTable", db);
  11.  
  12.                 SqliteDataReader query = selectCommand.ExecuteReader();
  13.  
  14.                 // Query the db and get the tasks
  15.                 while (query.Read())
  16.                 {
  17.                     KanbanModel row = new KanbanModel()
  18.                     {
  19.                         ID = query.GetString(0),
  20.                         Title = query.GetString(1),
  21.                         Assignee = query.GetString(2),
  22.                         Description = query.GetString(3),
  23.                         Category = query.GetString(4),
  24.                         ColorKey = query.GetString(5),
  25.                         Tags = query.GetString(6).Split(",") // Turn string of tags into string array, fills listview
  26.                     };
  27.                     tasks.Add(row);
  28.                 }
  29.                 db.Close();
  30.             }
  31.             return tasks;



HU Hunter June 5, 2019 12:45 PM UTC

UPDATE 6/5/2019

I started with your sample from the thread ID I put in this post with the KanbanSQL example you did. I added the Assignee property to both the table, params and all and it wasn't working with just that. 


MK Muneesh Kumar G Syncfusion Team June 6, 2019 12:53 PM UTC

Hi Hunter, 
 
Greetings from Syncfusion.  
 
Due to the source complexity, we need some more time to check the provided sample with database connection. We will update you the details on June 7th, 2019. We appreciate your patience until then.  
  
Regards,  
Muneesh Kumar G.  



HU Hunter June 6, 2019 01:42 PM UTC

Hi Muneesh, 

Sure thing, no problem! If you need any additional context please feel free to let me know. I do have the samples I wrote too! 




HU Hunter June 6, 2019 07:09 PM UTC

Hi Again, 

Sorry, just trying to give as much context as I can! 

I've uploaded my test program with my code. You should be able to run it and see my example of what is going wrong. I also uploaded a screen recording video of the problem that I am having with my application. This should help a ton on narrowing down the issue. I will continue to work on it on my end and see if I find a solution. 

NOTE: If you run my project and get a read-access memory error when you make your first task, just restart the program and it'll be added and it'll be fine after that. I haven't figured out why it does that yet, but it still works perfect afterwards, sooo, that'll be saved for a later date (presumably after this bug). 

Thank you for your time, patience, and help on this issue.

Attachment: ScreenRecordedExample_a0853f52.zip


HU Hunter June 6, 2019 07:10 PM UTC

It wouldn't let me upload two ZIP folders in the same comment, so I'll attach the project here. The video recording is in the previous comment. 

Attachment: SyncfusionUWPApp2_v6.4.19_DatabaseTest_Swimlane_1b988c96.zip


IM Iyyappan Mani Syncfusion Team June 9, 2019 03:12 PM UTC

Hi Hunter, 
Sorry for the inconvenience caused,  
 
Since, we are checking the reported issue with source level and we will update you with more details on 10th June 2019. We appreciate your patience until then.  
 
Regards, 
Iyyappan M


HU Hunter June 9, 2019 03:29 PM UTC

It's no problem at all! I hope I gave enough context so that you're able to pinpoint where I'm going wrong or if something is broken that I'm unaware of :) 

Thank you for your time and help! 


MK Muneesh Kumar G Syncfusion Team June 10, 2019 12:46 PM UTC

Hi Hunter, 
 
Since we have checked the reported problem by generating another application and the issue in that application did not occur. Since we need some more time to validate your sample, we will update you on June 11, 2019 with more information.  
 
Regards,
Muneesh Kumar G
 



MK Muneesh Kumar G Syncfusion Team June 11, 2019 01:43 PM UTC

Hi Hunter, 
 
We have logged the defect report “Swimline Cards not gets refereshed“ in UWP Platform and you can track it from the below link. 
 
 
We will fix the issue and include in our upcoming volume 2 Main release and it will be planned to release on end of the June 2019.  
 
If you have any more specification/precise replication procedure or a scenario to be tested, you can add it as a comment in the portal. 
 
Regards,
Muneesh Kumar G 
 



HU Hunter June 11, 2019 02:37 PM UTC

Hi Muneesh, 

Thank you for your update! Was your team able to pinpoint the issue with my provided information? 

I appreciate the time taken to look over my issue and look for a solution :) 


HU Hunter June 11, 2019 02:44 PM UTC

Hi Muneesh,

I hope you are doing well!
Thank you for the update. I appreciate the time taken to look into this :) 


MK Muneesh Kumar G Syncfusion Team June 12, 2019 05:59 AM UTC

Hi Hunter,   
 
Thanks for your update. Please let us know if you have any other queries.  
 
Regards,
Muneesh Kumar G 
 



NT Nihaal Tayob June 17, 2021 02:37 PM UTC

hi please send me the code im struggling a bit with mine



YP Yuvaraj Palanisamy Syncfusion Team June 20, 2021 02:51 PM UTC

Hi Nihaal, 
 
We have prepared the Kanban sample with Sqlite database in UWP platform. Please find the sample from the below link. 
 
  
Please let us know if you have any concern. 

Regards,
 
Yuvaraj. 


Loader.
Live Chat Icon For mobile
Up arrow icon