Alix
Alix
Explore posts from servers
CC#
Created by Alix on 11/27/2023 in #help
await Shell.Current.GoToAsync($"///MainPage"); not working
??????
6 replies
CC#
Created by Alix on 11/27/2023 in #help
await Shell.Current.GoToAsync($"///MainPage"); not working
someone?
6 replies
CC#
Created by Alix on 11/27/2023 in #help
await Shell.Current.GoToAsync($"///MainPage"); not working
c#
private async void OnLoginSuccess()
{
Debug.WriteLine("Before navigation");
await Shell.Current.GoToAsync($"///MainPage");
Debug.WriteLine("After navigation");
}
c#
private async void OnLoginSuccess()
{
Debug.WriteLine("Before navigation");
await Shell.Current.GoToAsync($"///MainPage");
Debug.WriteLine("After navigation");
}
6 replies
CC#
Created by Alix on 11/27/2023 in #help
await Shell.Current.GoToAsync($"///MainPage"); not working
and this is my appshell.xaml
c#
<?xml version="1.0" encoding="UTF-8" ?>
<Shell
x:Class="MauiInvoiceApplication.AppShell"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:MauiInvoiceApplication"
xmlns:pages="clr-namespace:MauiInvoiceApplication.Pages"
Shell.FlyoutBehavior="Disabled">

<ShellContent Title="Home" ContentTemplate="{DataTemplate local:MainPage}" Route="MainPage" />

</Shell>
c#
<?xml version="1.0" encoding="UTF-8" ?>
<Shell
x:Class="MauiInvoiceApplication.AppShell"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:MauiInvoiceApplication"
xmlns:pages="clr-namespace:MauiInvoiceApplication.Pages"
Shell.FlyoutBehavior="Disabled">

<ShellContent Title="Home" ContentTemplate="{DataTemplate local:MainPage}" Route="MainPage" />

</Shell>
6 replies
CC#
Created by Alix on 11/27/2023 in #help
await Shell.Current.GoToAsync($"///MainPage"); not working
this app.xaml.cs
c#
using MauiInvoiceApplication.Pages;

namespace MauiInvoiceApplication
{
public partial class App : Application
{
public App()
{
InitializeComponent();

MainPage = new NavigationPage(new LoginPage());
}
}
}
c#
using MauiInvoiceApplication.Pages;

namespace MauiInvoiceApplication
{
public partial class App : Application
{
public App()
{
InitializeComponent();

MainPage = new NavigationPage(new LoginPage());
}
}
}
6 replies
CC#
Created by Alix on 11/13/2023 in #help
error about datareader
so i renamed one and it is fixed now
16 replies
CC#
Created by Alix on 11/13/2023 in #help
error about datareader
the code didn't like that i had 2 dbconnect with the same name (db)
16 replies
CC#
Created by Alix on 11/13/2023 in #help
error about datareader
i found out what the problem was
16 replies
CC#
Created by Alix on 11/13/2023 in #help
error about datareader
i am using row.close() right so it should close the datareader right?
16 replies
CC#
Created by Alix on 11/13/2023 in #help
error about datareader
but i do close them everywhere correctly right
16 replies
CC#
Created by Alix on 11/13/2023 in #help
error about datareader
yeah i know that
16 replies
CC#
Created by Alix on 11/13/2023 in #help
error about datareader
got nothing more sadly
16 replies
CC#
Created by Alix on 11/13/2023 in #help
error about datareader
No description
16 replies
CC#
Created by Alix on 11/13/2023 in #help
error about datareader
and i am not getting any line
16 replies
CC#
Created by Alix on 11/13/2023 in #help
error about datareader
that is my db connect
16 replies
CC#
Created by Alix on 11/13/2023 in #help
error about datareader
c#
using MySql.Data.MySqlClient;
using System;
using System.Data;
using System.Diagnostics;

namespace MauiInvoiceApplication.Classes
{
class DBConnect : IDisposable
{
MySqlConnection conn;
string myConnectionString;
static string host = "phpmyadmin.adonkers.com";
static string database = "InvoiceApp";
static string userDB = "";
static string password = "";
static string ssltype = "None";
static string dbport = "3306";
static string dbpubkeyre = "true";
static string Multipleact = "true";
static string strProvider = "server=" + host + ";Database=" + database + ";User ID=" + userDB + ";Password=" + password + ";SslMode=" + ssltype + ";Port=" + dbport + "AllowPublicKeyRetrieval=" + dbpubkeyre + "MultipleActiveResultSets=" + Multipleact;

public bool Open()
{
strProvider = "server=" + host + ";Database=" + database + ";User ID=" + userDB + ";Password=" + password +
";SslMode=" + ssltype + ";Port=" + dbport + ";AllowPublicKeyRetrieval=" + dbpubkeyre;
conn = new MySqlConnection(strProvider);
conn.Open();
return true;
}

public void Close()
{
conn.Close();
conn.Dispose();
}

public DataSet ExecuteDataSet(string sql)
{
try
{
DataSet ds = new DataSet();
MySqlDataAdapter da = new MySqlDataAdapter(sql, conn);
da.Fill(ds, "result");
return ds;
}
catch (Exception ex)
{
Debug.WriteLine("Error DBConnect" + ex.Message);
}
return null;
}

public MySqlDataReader ExecuteReader(string sql)
{
try
{
MySqlDataReader reader;
MySqlCommand cmd = new MySqlCommand(sql, conn);
reader = cmd.ExecuteReader();
return reader;
}
catch (Exception ex)
{
Debug.WriteLine("Error DBConnect" + ex.Message);
}
return null;
}

public int ExecuteNonQuery(string sql)
{
try
{
int affected;
MySqlTransaction mytransaction = conn.BeginTransaction();
MySqlCommand cmd = conn.CreateCommand();
cmd.CommandText = sql;
affected = cmd.ExecuteNonQuery();
mytransaction.Commit();
return affected;
}
catch (Exception ex)
{
Debug.WriteLine("Error DBConnect" + ex.Message);
}
return -1;
}

public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}

protected virtual void Dispose(bool disposing)
{
if (disposing)
{
if (conn != null)
{
conn.Dispose();
conn = null;
}
}
}
}
}
c#
using MySql.Data.MySqlClient;
using System;
using System.Data;
using System.Diagnostics;

namespace MauiInvoiceApplication.Classes
{
class DBConnect : IDisposable
{
MySqlConnection conn;
string myConnectionString;
static string host = "phpmyadmin.adonkers.com";
static string database = "InvoiceApp";
static string userDB = "";
static string password = "";
static string ssltype = "None";
static string dbport = "3306";
static string dbpubkeyre = "true";
static string Multipleact = "true";
static string strProvider = "server=" + host + ";Database=" + database + ";User ID=" + userDB + ";Password=" + password + ";SslMode=" + ssltype + ";Port=" + dbport + "AllowPublicKeyRetrieval=" + dbpubkeyre + "MultipleActiveResultSets=" + Multipleact;

public bool Open()
{
strProvider = "server=" + host + ";Database=" + database + ";User ID=" + userDB + ";Password=" + password +
";SslMode=" + ssltype + ";Port=" + dbport + ";AllowPublicKeyRetrieval=" + dbpubkeyre;
conn = new MySqlConnection(strProvider);
conn.Open();
return true;
}

public void Close()
{
conn.Close();
conn.Dispose();
}

public DataSet ExecuteDataSet(string sql)
{
try
{
DataSet ds = new DataSet();
MySqlDataAdapter da = new MySqlDataAdapter(sql, conn);
da.Fill(ds, "result");
return ds;
}
catch (Exception ex)
{
Debug.WriteLine("Error DBConnect" + ex.Message);
}
return null;
}

public MySqlDataReader ExecuteReader(string sql)
{
try
{
MySqlDataReader reader;
MySqlCommand cmd = new MySqlCommand(sql, conn);
reader = cmd.ExecuteReader();
return reader;
}
catch (Exception ex)
{
Debug.WriteLine("Error DBConnect" + ex.Message);
}
return null;
}

public int ExecuteNonQuery(string sql)
{
try
{
int affected;
MySqlTransaction mytransaction = conn.BeginTransaction();
MySqlCommand cmd = conn.CreateCommand();
cmd.CommandText = sql;
affected = cmd.ExecuteNonQuery();
mytransaction.Commit();
return affected;
}
catch (Exception ex)
{
Debug.WriteLine("Error DBConnect" + ex.Message);
}
return -1;
}

public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}

protected virtual void Dispose(bool disposing)
{
if (disposing)
{
if (conn != null)
{
conn.Dispose();
conn = null;
}
}
}
}
}
16 replies
CC#
Created by Alix on 9/24/2023 in #help
❔ replace oldblockscollection with new blockscollection
yeah i see he is now complaining about this System.Windows.Data Error: 26 : ItemTemplate and ItemTemplateSelector are ignored for items already of the ItemsControl's container type; Type='TextBlock'
35 replies
CC#
Created by Alix on 9/24/2023 in #help
❔ replace oldblockscollection with new blockscollection
alright it works Thank you
35 replies
CC#
Created by Alix on 9/24/2023 in #help
❔ replace oldblockscollection with new blockscollection
is it a big problem if i make the string to a textblock since i need to use that to get background etc?
35 replies
CC#
Created by Alix on 9/24/2023 in #help
❔ replace oldblockscollection with new blockscollection
i just need to know how to render the updated observable collection
35 replies