exceptive
exceptive
CC#
Created by exceptive on 11/14/2024 in #help
Looking for a logging solution
private void LoadData(string connectionString) { string query = "SELECT * FROM railroad"; try { using (var connection = new SqlConnection(connectionString)) using (var adapter = new SqlDataAdapter(query, connection)) { DataTable dataTable = new DataTable(); adapter.Fill(dataTable); if (dataTable.Rows.Count > 0) { dataGridView1.DataSource = dataTable; } else { MessageBox.Show("No data found in the table.", "No Data", MessageBoxButtons.OK, MessageBoxIcon.Information); } } } catch (Exception ex) { MessageBox.Show($"Error loading data: {ex.Message}", "Data Load Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
9 replies
CC#
Created by exceptive on 11/14/2024 in #help
Looking for a logging solution
using mms if that matters
9 replies
CC#
Created by exceptive on 11/14/2024 in #help
Looking for a logging solution
SQL is on a local sql server db, everything is already initialized besides the logging
9 replies