In my page there is one TextBox, DatePicker & Listpicker, from SQLITE query I am getting data but it only shows in the TextBox field only, not shown in other controls like DatePicker and ListPicker.
Xaml CODE:
.CS CODE
protected override void OnNavigatedTo(NavigationEventArgs e)
{
{
dbConn = new SQLiteConnection(DB_PATH); // Create the table Task, if it doesn't exist.
dbConn.CreateTable(); // Retrieve the task list from the database.
try
{
string id = NavigationContext.QueryString["selectedItem"].ToString(); //this retrive the index of selected item from ListBox which on previous page
var note= dbConn.Query("select * from task where Id='" + id + "'").FirstOrDefault(); //use that index as ID of the table
if (note == null)
MessageBox.Show("Not Present in DataBase");
else
{
TextField.Text = note.Text; //Its working fine, the selected index value shown here
dpkDate.Value = DateTime.Parse(note.Text); //not working
((ListBoxItem)priority.SelectedItem).Content = note.Text; //not working
}
}
Where I am wrong? Please help.
dbConn.CreateTable
try
{
string id = NavigationContext.QueryString["selectedItem"].ToString(); //this retrive the index of selected item from ListBox which on previous page
var note= dbConn.Query
if (note == null)
MessageBox.Show("Not Present in DataBase");
else
{
TextField.Text = note.Text; //Its working fine, the selected index value shown here
dpkDate.Value = DateTime.Parse(note.Text); //not working
((ListBoxItem)priority.SelectedItem).Content = note.Text; //not working
}
}
Where I am wrong? Please help.

Guest UserPosted Jul 21, 2014, 10:27 AM
[email protected]
Aditya PatilPosted Jul 21, 2014, 10:25 AM
Teamviewer screenshot: http://prntscr.com/44unlg
Guest UserPosted Jul 21, 2014, 10:19 AM
Guest UserPosted Jul 21, 2014, 10:17 AM
Guest UserPosted Jul 21, 2014, 10:17 AM
Aditya PatilPosted Jul 21, 2014, 10:13 AM
note.time= 1:52 AM
TV details
944 847 769
5119
Aditya PatilPosted Jul 21, 2014, 9:50 AM
protected override void OnNavigatedTo(NavigationEventArgs e)
{
dbConn = new SQLiteConnection(DB_PATH);
// Create the table Task, if it doesn't exist.
dbConn.CreateTable
// Retrieve the task list from the database.
try
{
id = NavigationContext.QueryString["selectedItem"].ToString();
//MessageBox.Show(id); //this retrive the index of selected item and display in message
var note= dbConn.Query
if (note == null)
MessageBox.Show("Note Not Present in DataBase");
else
{
dpkDate.Value = DateTime.Parse(note.Date);
tpkDate.Value = DateTime.Parse(note.Time); //NOT WORKING (IN note.time have value but its not get assigned)
TextField.Text = note.Text;
((ListBoxItem)priority.SelectedItem).Content = note.Priority; //NOT WORKING (in note.Priority value shows while added breakpoint but its not get assigned to listpicker item.)
}
}
catch { }
// Create the database connection.
}
Guest UserPosted Jul 21, 2014, 3:57 AM
Aditya PatilPosted Jul 21, 2014, 3:52 AM
Guest UserPosted Jul 21, 2014, 3:34 AM
you can call me @9818719140 and give me join.me
we can troubleshoot together
Aditya PatilPosted Jul 21, 2014, 2:18 AM
TextField.Text = note.Text;
No issues are there regarding TextField.
var note= dbConn.Query
And I tried by putting breakpoint too it shows whole value in note variable. only from that note variable only half part shown in the textfield, but whatever I want to display in other part its not showing in DatePicker and ListPicker
Guest UserPosted Jul 21, 2014, 2:14 AM
this means note will have first row, and you want to have value e.g., note[0] or note["ID"]
so change your code accordingly
twitter @sumitjolly