C
C#5mo ago
Vegas

maui Datagrid From ( akgul.Maui.DataGrid )

So i have asked in StackOverflow and i receved awnser of (dont use datatable). So im hoping to come here to the professionals. I have been working on finding a solution to making datagrid fill info from the sql query. I have worked off my working WPF build and for some reason i cant get the data to fill the Table. I have used dg:datagrid , Uranium , (DevExpress (Gives Loading Errors)) , and Making My own Grid. None have given me data back.
c#

string jobs = ("SELECT * FROM " + Table); // Selecting All Jobs ---------
SqlCommand cmd = new SqlCommand(jobs, conn);

try
{
conn.Open();
SqlDataAdapter sda = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
sda.Fill(ds,Table);
dataview.ItemsSource = ds.Tables;
c#

string jobs = ("SELECT * FROM " + Table); // Selecting All Jobs ---------
SqlCommand cmd = new SqlCommand(jobs, conn);

try
{
conn.Open();
SqlDataAdapter sda = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
sda.Fill(ds,Table);
dataview.ItemsSource = ds.Tables;
<dg:DataGridColumn Title="Id" Width="30">
<dg:DataGridColumn.CellTemplate>
<DataTemplate>
<Label Text="{Binding Id}"/>
</DataTemplate>
</dg:DataGridColumn.CellTemplate>
</dg:DataGridColumn>
<dg:DataGridColumn Title="Id" Width="30">
<dg:DataGridColumn.CellTemplate>
<DataTemplate>
<Label Text="{Binding Id}"/>
</DataTemplate>
</dg:DataGridColumn.CellTemplate>
</dg:DataGridColumn>
Thanks
No description
1 Reply
Vegas
VegasOP5mo ago
So the owner of akgul reached out to me and told me to make a table from query then pull from that table to the datagrid. ( Going Grey Quick )
c#
conn.Open();
using (SqlDataReader reader = cmd.ExecuteReader())
{
while (reader.Read())
{
datalist.Add(reader.GetValue("Id").ToString());
StatusArea.Text = "ID Added";
datalist.Add(reader.GetValue("c_location").ToString());
StatusArea.Text = "C Loc Added";
datalist.Add(reader.GetValue("job_date").ToString());
StatusArea.Text = "Date Added";
datalist.Add(reader.GetValue("l_location").ToString());
StatusArea.Text = "Table Made";
}
}
c#
conn.Open();
using (SqlDataReader reader = cmd.ExecuteReader())
{
while (reader.Read())
{
datalist.Add(reader.GetValue("Id").ToString());
StatusArea.Text = "ID Added";
datalist.Add(reader.GetValue("c_location").ToString());
StatusArea.Text = "C Loc Added";
datalist.Add(reader.GetValue("job_date").ToString());
StatusArea.Text = "Date Added";
datalist.Add(reader.GetValue("l_location").ToString());
StatusArea.Text = "Table Made";
}
}
Stopping at first line
Want results from more Discord servers?
Add your server