WPF filling a DataGrid I'm creating a WPF application with a DataGrid. I'd like some advice on the code I've written:

&lt;DataGrid  Margin="0,10,10,10" LoadingRow="DataGrid_LoadingRow"    Name="user_view" EnableRowVirtualization="False" Grid.Column="2"    CanUserReorderColumns="True" CanUserResizeColumns="True"  CanUserResizeRows="True" CanUserSortColumns="True" 
    AlternatingRowBackground="Gainsboro" CanUserAddRows="False" CanUserDeleteRows="False" IsReadOnly="True" AutoGenerateColumns="False" IsSynchronizedWithCurrentItem="True"&gt;
    &lt;DataGrid.Columns&gt;          
        &lt;DataGridTextColumn  Header="Name" Width="*" Binding="{Binding name}" &gt;&lt;/DataGridTextColumn&gt;
        &lt;DataGridTextColumn Header="Surname" Width="*" Binding="{Binding surname}"&gt;&lt;/DataGridTextColumn&gt;
        &lt;DataGridTextColumn Header="Address" Width="*" Binding="{Binding address}"&gt;&lt;/DataGridTextColumn&gt;

 // and so on
 // and so on
 // and so on


...are all the cells that I bound my SQL View to.

Now, to fill the DataGrid:

public void LoadView()
{
    try
    {
        SQLiteCommand command = new SQLiteCommand(connection);
        command.CommandText = MyApk.Properties.Resources.user_datagrid; 

        DataSet DST = new DataSet();
        DataTable DT = new DataTable();
        SQLiteDataAdapter SDA = new SQLiteDataAdapter(command);
        SDA.Fill(DT);
        this.user_view.ItemsSource = DT.AsDataView();
    }
    catch (Exception ex)
    {
        MessageBox.Show(ex.Message);
    }
}


And the query to create the view is basically:

CREATE VIEW IF NOT EXISTS user_details AS SELECT name,surname,address //more stuff here


The specific points I'd like addressed are:


Is this the right way to fill the DataGrid? 
Is it hard coded? 
How can I make it even better?
public void LoadView()
{
    try
    {
        SQLiteCommand command = new SQLiteCommand(connection);
        command.CommandText = MyApk.Properties.Resources.user_datagrid; 

        DataSet DST = new DataSet();
        DataTable DT = new DataTable();
        SQLiteDataAdapter SDA = new SQLiteDataAdapter(command);
        SDA.Fill(DT);
        this.user_view.ItemsSource = DT.AsDataView();
    }
    catch (Exception ex)
    {
        MessageBox.Show(ex.Message);
    }
}  




DataSet DST = new DataSet(); is never used and should be deleted.  
both SQLiteCommand and SQLiteDataAdapter are implementing IDisposable so you should enclose them in a using statement to automatically dispose them after their usage. In addition the constructor of the SQLiteCommand is overloaded to take a commandtext too.   
variables should be named using camelCase casing and shouldn't be named using abbreviations so SDA could simply be dataAdapter and DT will be dataTable.  


Implementing the mentioned points will lead to  

public void LoadView()
{
    try
    {

        using (SQLiteCommand command = new SQLiteCommand(MyApk.Properties.Resources.user_datagrid, connection))
        using (SQLiteDataAdapter dataAdapter = new SQLiteDataAdapter(command))
        {            
            DataTable dataTable = new DataTable();
            dataAdapter.Fill(dataTable);
            this.user_view.ItemsSource = dataTable.AsDataView();
        }
    }
    catch (Exception ex)
    {
        MessageBox.Show(ex.Message);
    }
}  


But now this is tightly coupled to the user_view control and the query MyApk.Properties.Resources.user_datagrid which is suboptimal.  

If we pass an ItemsControl object and a string to this method it would be more flexible like so  

public void LoadView(ItemsControl control, string commandText)
{
    try
    {

        using (SQLiteCommand command = new SQLiteCommand(commandText, connection))
        using (SQLiteDataAdapter dataAdapter = new SQLiteDataAdapter(command))
        {            
            DataTable dataTable = new DataTable();
            dataAdapter.Fill(dataTable);
            control.ItemsSource = dataTable.AsDataView();
        }
    }
    catch (Exception ex)
    {
        MessageBox.Show(ex.Message);
    }
}   


and can be called like  

LoadView(this.user_view, MyApk.Properties.Resources.user_datagrid);