Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/PlanViewer.App/Controls/QuerySessionControl.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -495,12 +495,16 @@ private async void ExecuteEstimated_Click(object? sender, RoutedEventArgs e)

private async Task CaptureAndShowPlan(bool estimated, string? queryTextOverride = null)
{
if (_connectionString == null || _selectedDatabase == null)
if (_serverConnection == null || _selectedDatabase == null)
{
SetStatus("Connect to a server first", autoClear: false);
return;
}

// Always rebuild connection string from current database selection
// to guarantee the picker state is reflected at execution time
_connectionString = _serverConnection.GetConnectionString(_credentialService, _selectedDatabase);

var queryText = queryTextOverride?.Trim()
?? GetSelectedTextOrNull()?.Trim()
?? QueryEditor.Text?.Trim();
Expand Down
Loading